Facebook Marketplace Location Search API
Disambiguate city names into Marketplace hubs — id + lat/lng. Flat 2 credits.
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. Each row carries idResolved — true when id is present and joinable to listing.cityPageId; false 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 when known (join to search 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, Chicago, …)
Platform limits
Honest ceilings from the upstream platform surface — not Captapi bugs. Unexpected truncation here is usually the platform, not us.
- Optional geocode — skip when marketplace-search's city string is enough.
- id is omitted (idResolved=false) when Facebook's city_page.id is unknown — pass name or slug to marketplace-search.
- Typical latency under 2s; the old ~28s Facebook hub scrape is no longer the default path.
Try it
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
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": 3,
"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, cached, creditsUsed, 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:
idFacebook Marketplace city_page.id — same value search listings expose as cityPageId. Omitted when unknown. Not duplicated as cityPageId.cityPageIdCity page id. Example: "109791499039942".slugMarketplace hub path slug (e.g. austin, austin-minnesota, izmir).nameDisplay label, usually 'City, ST' or 'City, Country'. Pass this (or slug) to marketplace-search as location.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
| Name | Type | Required | Description |
|---|---|---|---|
| q | string | Yes | City/place query. Bare names like 'Austin' may return multiple candidates (TX/MN/IN); include a state for a single hit (e.g. 'Austin, TX'). |
| limit | integer | No | Max items to return (default 10, max 50). Flat 2 credits per call. |
| cache | boolean | No | Set true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh. Envelope includes cached + cachedAt on hits. |
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.
facebook_marketplace_location_search via @captapi/mcp. Set it up →How it works
- 1. Sign up — get 100 free credits, no card required.
- 2. Create a key from your dashboard.
- 3. Send one request to
/v1/facebook/marketplace-location-searchand 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. Hits include cached + cachedAt. 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 Austin / geocode rows?+
id is Facebook's city_page.id, which we only have for some table hubs (Austin TX) and when a hub page exposes it. idResolved=false means that join is not available; the row is still a valid marketplace-search location via name or slug.
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. Hits include cached + cachedAt. 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.