100 free credits. No credit card required. Get a key

How to scrape Facebook Marketplace search with cURL

Facebook Marketplace listings for a keyword near a point or place: title, price, city, photo and listed time, filtered by radius, price, condition, delivery, listing date and availability, sorted as Marketplace sorts.

The examples use curl with jq to pick fields out of the JSON, which is the quickest way to see the data and to script it in a shell.

GET /v1/facebook/marketplace/search1 credit per callRefunded on failureBeta

Before you start

  1. Get an API keySign up for 100 free credits, no card. Keys start with gs_live_.
  2. Put it in the environmentEvery example reads it from GROUNDSOCIAL_API_KEY: export GROUNDSOCIAL_API_KEY=gs_live_…
  3. Set up cURLjq --version # brew install jq, or apt install jq

Call Facebook Marketplace search API from cURL

GET /v1/facebook/marketplace/search. Save this as fetch.sh and run bash fetch.sh. It reads the items in listings and prints location.reverse_geocode.city_page.display_name and listing_price.amount for each.

fetch.sh
# The whole response, pretty-printed:
curl -sS "https://api.groundsocial.dev/v1/facebook/marketplace/search?q=bike&location=austin&max_price=300" \
  -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" | jq .

# Just the display_name and amount, one line per item:
curl -sS "https://api.groundsocial.dev/v1/facebook/marketplace/search?q=bike&location=austin&max_price=300" \
  -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \
  | jq -r '.listings[] | [.location.reverse_geocode.city_page.display_name, .listing_price.amount] | @tsv'

The response

A real Facebook response to this call, recorded from the live source and shortened for display: arrays keep their first items and … marks every cut. The recorded page had 4 items in listings. Live calls return current data in the same shape.

200 OK
{
  "listings": [
    {
      "id": "1419760300351909",
      "marketplace_listing_title": "Retrospec Comfort Hybrid Bike - 7 Speed",
      "listing_price": {
        "formatted_amount": "$100",
        "amount": "100.00",
        "amount_with_offset_in_currency": "10000"
      },
      "strikethrough_price": {
        "formatted_amount": "$275",
        "amount": "275.00"
      },
      "location": {
        "reverse_geocode": {
          "city": "Los Angeles",
          "state": "CA",
          "city_page": {
            "display_name": "Los Angeles, California",
            "id": "110970792260960"
          }
        }
      },
      "primary_listing_photo": {
        "__typename": "CatalogMarketplaceEnhancementTransformedImage",
        "image": {
          "uri": "https://scontent-phx1-1.xx.fbcdn.net/v/t39.84726-6/863451975_1640851144088320_5756440697907607365_n.jpg?stp=c90.0.540.54…"
        },
        "id": "1640851140754987"
      },
      "is_sold": false,
      "is_pending": false,
      "is_live": true,
      "marketplace_listing_category_id": "1658310421102081",
      "creation_time": 1792873200,
      "delivery_types": [
        "IN_PERSON"
      ],
      "__typename": "GroupCommerceProductItem",
      "__isMarketplaceListingRenderable": "GroupCommerceProductItem",
      "is_hidden": false,
      "is_viewer_seller": false,
      "min_listing_price": null,
      "max_listing_price": null,
      "__isMarketplaceListingWithPulseAttribution": "GroupCommerceProductItem",
      "created_with_seller_app": false,
      "custom_title": null,
      "custom_sub_titles_with_rendering_flags": [],
      "origin_group": null,
      "listing_video": null,
      "…": "6 more fields"
    },
    {
      "id": "2066072307423375",
      "marketplace_listing_title": "Silver Mountain Bike",
      "listing_price": {
        "formatted_amount": "$115",
        "amount": "115.00",
        "amount_with_offset_in_currency": "11500"
      },
      "strikethrough_price": null,
      "location": {
        "reverse_geocode": {
          "city": "Los Angeles",
          "state": "CA",
          "city_page": {
            "display_name": "Los Angeles, California",
            "id": "110970792260960"
          }
        }
      },
      "primary_listing_photo": {
        "__typename": "CatalogMarketplaceEnhancementTransformedImage",
        "image": {
          "uri": "https://scontent-phx1-1.xx.fbcdn.net/v/t39.84726-6/913926426_1458864976396572_6141599406701477433_n.jpg?stp=c316.0.540.5…"
        },
        "id": "1458864969729906"
      },
      "is_sold": false,
      "is_pending": false,
      "is_live": true,
      "marketplace_listing_category_id": "1658310421102081",
      "creation_time": 1795037231,
      "delivery_types": [
        "IN_PERSON"
      ],
      "__typename": "GroupCommerceProductItem",
      "__isMarketplaceListingRenderable": "GroupCommerceProductItem",
      "is_hidden": false,
      "is_viewer_seller": false,
      "min_listing_price": null,
      "max_listing_price": null,
      "__isMarketplaceListingWithPulseAttribution": "GroupCommerceProductItem",
      "created_with_seller_app": false,
      "custom_title": null,
      "custom_sub_titles_with_rendering_flags": [],
      "origin_group": null,
      "listing_video": null,
      "…": "6 more fields"
    },
    "… 2 more"
  ]
}

Top-level fields

FieldTypeDescription
listingsFacebookMarketplaceListing[]–

Parameters

NameInTypeDescription
q (required)querystringWhat to search for. Example: bike.
latquerynumber | nullLatitude of the search centre.
lngquerynumber | nullLongitude of the search centre.
locationquerystringA place name instead of lat/lng (first match).
radius_kmquerynumber | nullSearch radius in km (1-500, default 40).
min_pricequerynumber | nullMinimum price, in the local currency.
max_pricequerynumber | nullMaximum price, in the local currency.
sort_byquery"suggested" | "distance_ascend" | "creation_time_descend" | "price_ascend" | "price_descend"One of suggested, distance_ascend, creation_time_descend, price_ascend, price_descend.
conditionquerystringComma list: new, used_like_new, used_good, used_fair.
delivery_methodquery"all" | "local_pickup" | "shipping"One of all, local_pickup, shipping.
date_listedquery"1" | "7" | "30" | "all" | "last_24_hours" | "last_7_days" | "last_30_days"One of 1, 7, 30, all, last_24_hours, last_7_days, last_30_days.
availabilityquery"available" | "sold"One of available, sold.
category_idquerystringA listing’s marketplace_listing_category_id.

Errors and retries

Every error is JSON with error.code (stable: branch on it), message, hint (what to do next), docs_url and retryable. A failed call is never charged. Retry only when retryable is true, after the Retry-After header.

Errors
# --fail-with-body exits non-zero on a 4xx/5xx and still saves the error JSON.
curl -sS "https://api.groundsocial.dev/v1/facebook/marketplace/search?q=bike&location=austin&max_price=300" \
  -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \
  --fail-with-body -o page.json \
  || jq -r '.error | "\(.code): \(.hint)"' page.json
StatusMeaning
200Matching listings.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404The ad, Page or advertiser is not in the Meta Ad Library.
429Too many requests. Wait for Retry-After seconds.
503Facebook is temporarily unavailable. Retryable; nothing was charged.

Every error code and what to do about it.

Pricing

Cost
Per call1 credit per call
1,000 calls$1.00 on the starter pack, $0.40 at volume
No key (MPP or x402)$0.01 per call
Failed callRefunded, never charged

Every response has x-credits-charged and x-credits-remaining headers. Credits never expire. Packs and calculator.

From an AI agent (MCP)

The same call is the facebook_marketplace_search tool on the hosted MCP server, so Claude, Cursor or any MCP client can make it without code. Add the server once:

bash
claude mcp add --transport http groundsocial https://api.groundsocial.dev/mcp

Then ask for it in words (“Search Facebook Marketplace listings near a place, with price, condition, delivery, date and sort filters”), or call the tool directly:

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "facebook_marketplace_search",
    "arguments": {
      "q": "bike",
      "location": "austin",
      "max_price": "300"
    }
  }
}

MCP setup for Claude Desktop, Cursor, VS Code and ChatGPT.

Spot underpriced items

Search with sort_by=creation_time_descend&date_listed=1 every hour and compare listing_price.amount with what the same item usually sells for.

Questions

Is there a next page?

No: Marketplace shows a logged-out visitor one page (up to about 24). Narrow the radius or filters to see different listings.

Keep going

Run it on your own data

One key for Facebook and 76 more platforms, over REST or MCP. Free credits on signup, no card.

Facebook is a trademark of Meta Platforms, Inc. We are not affiliated with or endorsed by Meta.