A write-gated Marketplace seller CLI for search, listing creation, photo upload, local watches, and replies.
Facebook Marketplace is an authenticated browser surface, so this CLI treats the browser session as the credential and keeps writes opt-in. It turns captured Marketplace GraphQL traffic into repeatable commands, then layers local watches, matches, stale listing checks, and seller drafting on top.
Learn more at Facebook Marketplace.
Authentication
Run facebook-marketplace-pp-cli auth login --chrome while logged in to Facebook in Chrome. The captured browser session is the credential; do not store session material in the Dropbox project workspace.
Quick Start
# Capture the local Facebook browser session before any live command.
facebook-marketplace-pp-cli doctor
# Confirm the session still reaches Marketplace.
facebook-marketplace-pp-cli doctor
# Run the captured search operation with a realistic variable payload.
facebook-marketplace-pp-cli marketplace-search content --json
Unique Features
These capabilities aren't available in any other tool for this API.
Seller workflow
-
draft — Draft a Marketplace title, description, and price suggestion from photos and notes.
Use this when preparing a seller listing before opening a write-gated post flow.
facebook-marketplace-pp-cli draft --photos chair-front.jpg,chair-tag.jpg --notes "walnut dining chair, small scratch on back" --json
-
reply — Prepare and send a seller inbox reply only when --write and doctor gating both pass.
Use this only for human-approved sell-side messaging.
facebook-marketplace-pp-cli reply --thread 1525836598898750 --message "Yes, it is still available." --write --json
Buy-side workflow
-
watch add — Persist a Marketplace search watch with deterministic keyword, price, and distance filters.
Use this when the agent needs to monitor Marketplace without deciding relevance on every raw result.
facebook-marketplace-pp-cli watch add --name "eames" --query "eames lounge" --max-price 1500 --radius 60 --must-have-keywords "chair,lounge" --json
-
matches — Show new watch matches after deterministic filtering.
Use this when an agent needs the shortlist worth showing a human buyer.
facebook-marketplace-pp-cli matches --new --json
Local mirror
-
stale — Find local seller listings older than seven days with no engagement.
Use this when deciding which seller listings need price changes or renewal.
facebook-marketplace-pp-cli stale --days 7 --json
Usage
Run facebook-marketplace-pp-cli --help for the full command reference and flag list.
Commands
composer
Sell-side composer helper operations.
facebook-marketplace-pp-cli composer price_prediction - Fetch Marketplace composer price prediction.
facebook-marketplace-pp-cli composer root - Fetch Marketplace listing composer metadata.
facebook-marketplace-pp-cli composer shipping_options - Fetch calculated shipping options for a draft listing.
inbox
Marketplace inbox and messaging operations.
facebook-marketplace-pp-cli inbox list - Fetch Marketplace inbox overview.
facebook-marketplace-pp-cli inbox message_seller - Send a Marketplace seller message.
facebook-marketplace-pp-cli inbox seller_threads - Fetch Marketplace seller inbox threads.
facebook-marketplace-pp-cli inbox seller_threads_page - Fetch a page of Marketplace seller inbox threads.
listing
Listing detail and sell-side listing operations.
facebook-marketplace-pp-cli listing change_availability - Change a Marketplace listing availability state.
facebook-marketplace-pp-cli listing create - Create a Marketplace listing from a prepared composer payload; pass --photo to upload local photos first.
facebook-marketplace-pp-cli listing delete - Delete a Marketplace for-sale item.
facebook-marketplace-pp-cli listing get - Fetch a Marketplace listing detail page payload.
facebook-marketplace-pp-cli listing media - Fetch Marketplace listing media payload.
facebook-marketplace-pp-cli listing upload-photo - Upload a local photo and return the Marketplace composer photo_id.
marketplace
Marketplace browse and location operations.
facebook-marketplace-pp-cli marketplace browse_feed - Fetch Marketplace browse feed results.
facebook-marketplace-pp-cli marketplace set_browse_radius - Set Marketplace browse radius.
facebook-marketplace-pp-cli marketplace set_buy_location - Set Marketplace buying location.
marketplace_search
Marketplace search operations.
facebook-marketplace-pp-cli marketplace_search content - Search Marketplace listings.
Output Formats
# Human-readable table (default in terminal, JSON when piped)
facebook-marketplace-pp-cli inbox list --fb-api-req-friendly-name example-resource
# JSON for scripting and agents
facebook-marketplace-pp-cli inbox list --fb-api-req-friendly-name example-resource --json
# Filter to specific fields
facebook-marketplace-pp-cli inbox list --fb-api-req-friendly-name example-resource --json --select id,name,status
# Dry run — show the request without sending
facebook-marketplace-pp-cli inbox list --fb-api-req-friendly-name example-resource --dry-run
# Agent mode — JSON + compact + no prompts in one flag
facebook-marketplace-pp-cli inbox list --fb-api-req-friendly-name example-resource --agent
Agent Usage
This CLI is designed for AI agent consumption:
- Non-interactive - never prompts, every input is a flag
- Pipeable -
--json output to stdout, errors to stderr
- Filterable -
--select id,name returns only fields you need
- Previewable -
--dry-run shows the request without sending
- Explicit retries - add
--idempotent to create retries when a no-op success is acceptable
- Confirmable -
--yes for explicit confirmation of destructive actions
- Piped input - write commands can accept structured input when their help lists
--stdin
- Agent-safe by default - no colors or formatting unless
--human-friendly is set
Exit codes: 0 success, 2 usage error, 3 not found, 4 auth error, 5 API error, 7 rate limited, 10 config error.
Health Check
facebook-marketplace-pp-cli doctor
Verifies configuration, credentials, and connectivity to the API.
Configuration
Config file: ~/.config/facebook-marketplace-pp-cli/config.toml
Static request headers can be configured under headers; per-command header overrides take precedence.
Environment variables:
| Name | Kind | Required | Description |
|---|
FACEBOOK_MARKET_COOKIES | harvested | Yes | Populated automatically by auth login. |
Troubleshooting
Authentication errors (exit code 4)
- Run
facebook-marketplace-pp-cli doctor to check credentials
- Verify the environment variable is set:
echo $FACEBOOK_MARKET_COOKIES
Not found errors (exit code 3)
- Check the resource ID is correct
- Run the
list command to see available items
API-specific
- Marketplace commands return a login or checkpoint page. — Open Facebook in Chrome, resolve the checkpoint manually, rerun
auth login --chrome, then rerun doctor.
- A write command refuses to run. — Rerun
doctor; writes require both --write and a recent passing doctor check.
HTTP Transport
This CLI uses Chrome-compatible HTTP transport over HTTP/3 for browser-facing endpoints. It does not require a resident browser process for normal API calls.
Generated by CLI Printing Press