Facebook Marketplace
GET /v1/facebook/marketplace-location-search

Facebook Marketplace Location Search API

Disambiguate city names into Marketplace hubs — id + lat/lng. Flat 2 credits.

2 credits per request
TL;DR
Disambiguate city names into Marketplace hubs — id + lat/lng. Flat 2 credits. The Facebook Marketplace Location Search API (Facebook Marketplace) is a single authenticated GET request to /v1/facebook/marketplace-location-search that responds with clean JSON and costs 2 credits. Pass cache=true for a free 24h cache hit; default is always fresh. Start with 100 free credits — no credit card.

What is the Facebook Marketplace Location Search API?

Resolve a city/place query into Facebook Marketplace location hubs with id (Facebook city_page.id — same value marketplace-search listings expose as cityPageId), slug, city/state, and coordinates when available. marketplace-search already accepts a city string with no lat/lng required — use this endpoint when the name is ambiguous (Austin TX vs Austin MN vs Austin IN) or you need id/coordinates before searching. Bare ambiguous cities (Austin, Portland, Springfield) resolve from a local table in typically under 1s; every other query geocodes globally (typically under 2s) instead of a ~28s Facebook hub scrape. id resolves instantly for ~60 major US metros from a baked directory verified against live listing cityPageId values; smaller cities and non-US places return idResolved:false — those rows are still valid marketplace-search location values via name/slug. Envelope timings{path,hubMs,hubCount,geocodeMs,totalMs} including on 504/404. Flat 2 credits.

What you get

  • id = Facebook city_page.id — instant for ~60 major US metros (verified join to listing cityPageId)
  • idResolved on every row — false rows still work as marketplace-search location via name/slug
  • Global geocode for cities outside the US table (İzmir, Şanlıurfa, West Lafayette, …)

Try it

Open in Playground

Fill in the parameters below and copy a ready-to-run request, or open the live Playground to run it against your account (no API key paste).

Parameters

Sign in to run live
curl "https://api.captapi.com/v1/facebook/marketplace-location-search?q=Austin" \
  -H "Authorization: Bearer capt_live_..."
# or: -H "x-api-key: capt_live_..."

Edit the parameters and the code updates instantly. Switch languages and hit copy.

Example response

{
  "success": true,
  "data": {
    "query": "Austin",
    "totalReturned": 2,
    "locations": [
      {
        "id": "109791499039942",
        "cityPageId": "109791499039942",
        "slug": "austin",
        "name": "Austin, TX",
        "city": "Austin",
        "state": "TX",
        "latitude": 30.2677,
        "longitude": -97.7475
      },
      {
        "slug": "austin-minnesota",
        "name": "Austin, MN",
        "city": "Austin",
        "state": "MN",
        "latitude": 43.6666,
        "longitude": -92.9746
      }
    ]
  }
}

Billing metadata is returned in response headers: X-Captapi-Credits (credits charged), X-Captapi-Cache (hit or miss), and X-Captapi-Source. Failed requests (4xx/5xx) are never charged. See the full list of error codes in the error reference.

Response structure

A successful call returns success and a data object with the following fields:

Top-level fields

  • queryEcho of the q parameter you sent.
  • totalReturnedNumber of location candidates in this response.

Locations

Each item in locations contains:

  • idId of this locations item.
  • cityPageIdCity page id. Example: "109791499039942".
  • slugMarketplace hub path slug (e.g. austin, austin-minnesota, izmir).
  • nameName of this locations item.
  • cityCity name from the query / hub / geocode.
  • stateUS state abbreviation when known.
  • latitudeHub latitude when known (included by default — no details flag).
  • longitudeHub longitude when known.

Parameters

NameTypeRequiredDescription
qstringYesCity/place query. Bare names like 'Austin' may return multiple candidates (TX/MN/IN); include a state for a single hit (e.g. 'Austin, TX').
limitintegerNoMax items to return (default 10, max 50). Flat 2 credits per call.
cachebooleanNoSet true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh.

Authentication: send your key as Authorization: Bearer capt_live_.... A typical call costs 2 credits. Pass cache=true for a free 24h cache hit; default is always fresh.

Using an AI agent? This endpoint is the MCP tool facebook_marketplace_location_search via @captapi/mcp. Set it up →

How it works

  1. 1. Sign up — get 100 free credits, no card required.
  2. 2. Create a key from your dashboard.
  3. 3. Send one request to /v1/facebook/marketplace-location-search and parse the JSON response.

Use cases

City disambiguation

Bare 'Austin' can mean TX, MN, or IN — pick the hub whose id/state matches before searching listings. Rows with idResolved=false still work as marketplace-search location via name/slug.

Canonical place id

When idResolved is true, location.id is Facebook city_page.id — the same identifier marketplace-search cards expose as cityPageId.

Global geocode

Cities outside the US table (İzmir, Şanlıurfa, Chicago, …) geocode in typically under 2s instead of a ~28s Facebook hub scrape.

Frequently asked questions

What does the Facebook Marketplace Location Search API do?+

The Facebook Marketplace Location Search API lets you search and return matching results from a public Facebook Marketplace query using one GET request to /v1/facebook/marketplace-location-search. It returns clean JSON — no OAuth or infrastructure setup required.

How many credits does the Facebook Marketplace Location Search API cost?+

Each successful call costs 2 credits. Pass cache=true to serve from the 24h cache (0 credits on hit); default is always fresh. Selected profile endpoints also accept cacheMaxAge=1d|3d|7d|14d|30d. Failed or empty results are never charged.

Do I need a Facebook Marketplace API key or OAuth?+

No. A single Captapi key works across every platform Captapi supports — YouTube, TikTok, Instagram, Facebook, Twitter/X, Reddit, Threads, Bluesky, Pinterest, LinkedIn, Rumble, Spotify, Kwai, and more. We handle proxies, rate limits, retries, and authentication for you.

When should I call this instead of marketplace-search?+

marketplace-search already accepts a city/place name with no lat/lng required. Use location search when the name is ambiguous (Austin TX vs Austin MN) or you need Facebook's cityPageId / coordinates before searching. Otherwise skip it — it is an optional 2-credit geocode/disambiguation step.

What is id on a location row?+

Facebook's Marketplace city_page.id — the same value marketplace-search listings expose as cityPageId. Join with location.id === listing.cityPageId. It is not a fabricated "city|city|state" string, and it is not duplicated as cityPageId on the location row. When Facebook does not expose that id, the field is omitted and idResolved is false — pass name or slug to marketplace-search instead.

Why is id missing on some geocode rows (idResolved:false)?+

id resolves instantly for ~60 major US metros from a baked directory verified against live listing cityPageId values (Kansas City, Chicago, Austin TX, …). Smaller cities (West Lafayette, IN) and non-US places have no verified id — idResolved is false and the row is still a valid marketplace-search location via name or slug.

Do I need the id for marketplace-search to hit the right city?+

No — pass the "City, ST" string and search resolves the hub itself. This mattered historically: unknown vanity slugs (multi-word cities like kansas-city) silently fell back to a default hub, so a Kansas City search could return another city's listings. Search now uses the verified numeric city-page id for known metros, which scopes correctly.

Is the Facebook Marketplace Location Search API suitable for production use?+

Yes. It is a stable REST endpoint with predictable JSON and automatic retries. Pass cache=true to serve from the 24h cache (0 credits on hit); default is always fresh. Selected profile endpoints also accept cacheMaxAge=1d|3d|7d|14d|30d. Use it for analytics, monitoring, and content automation.

More Facebook Marketplace APIs

Ready to use the Facebook Marketplace Location Search API?

Sign up, grab your key, and make your first call in 60 seconds.

Facebook Marketplace Location Search API | Captapi — Captapi