Facebook Marketplace Locations API
Resolve a place name to the Marketplace location ids /v1/facebook/marketplace/search accepts, plus the neighbouring locations Facebook offers around it. Marketplace is city-scoped, so this is how you search a city you are not sitting in. Calls cost 1 credit each. A cache hit is free, and a failed or empty response is never charged.
Try it
Prefilled with the request that produced the example below. No key yet? Get a free key.
Request
GET
/v1/facebook/marketplace/locations| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | yes | Place name, e.g. "London" or "San Francisco" |
Also accepts cache_max_age (a hit costs 0 credits) and include_raw (returns the untouched upstream payload under raw).
curl
curl "$API/v1/facebook/marketplace/locations?query=San%20Francisco&cache_max_age=7d" \
-H "x-api-key: $KEY"JavaScript
const query = new URLSearchParams({
query: 'San Francisco',
cache_max_age: '7d',
});
const response = await fetch(`${API}/v1/facebook/marketplace/locations?${query}`, {
headers: { 'x-api-key': KEY },
});
const body = await response.json();
if (!body.success) throw new Error(body.error.code);
// 1 credit, 0 on a cache hit
console.log(body.data, body.meta.creditsCharged);Python
import os, httpx
r = httpx.get(
f"{os.environ['API']}/v1/facebook/marketplace/locations",
params={
"query": "San Francisco",
"cache_max_age": "7d",
},
headers={"x-api-key": os.environ["KEY"]},
timeout=30,
)
body = r.json()
if not body["success"]:
raise RuntimeError(body["error"]["code"])
print(body["data"], body["meta"]["creditsCharged"])Example response
Captured on , with raw removed and lists cut to two items. A live call returns current data.
response
{
"success": true,
"data": {
"items": [
{
"platform": "facebook",
"id": "114952118516947",
"name": "San Francisco, California",
"url": "https://www.facebook.com/marketplace/sanfrancisco/",
"isPrimary": true,
"fetchedAt": "2026-10-21T01:58:49.391Z"
},
{
"platform": "facebook",
"id": "107986399221453",
"name": "Castro Valley, California",
"url": "https://www.facebook.com/marketplace/107986399221453/",
"isPrimary": false,
"fetchedAt": "2026-10-21T01:58:49.391Z"
}
]
},
"meta": {
"platform": "facebook",
"endpoint": "facebook.marketplaceLocations",
"creditsCharged": 1,
"cached": false,
"cacheAgeSeconds": null,
"durationMs": 17441,
"requestId": "req_uq2wp1e3h4t20vobqoen"
}
}Returns
Returns a list of object in data.items.
Fields
| Field | Type | Present | Description |
|---|---|---|---|
| platform | "facebook" | always | |
| id | string | always | City page id where Facebook gave one, otherwise the resolved slug. Either is valid as `location` on /v1/facebook/marketplace/search. |
| name | string | always | |
| url | string | always | |
| isPrimary | boolean | always | True for the place the query resolved to; the rest are its neighbours. |
| fetchedAt | string | always |
Cost and behaviour
| Credits | 1 per live request, 0 on a cache hit |
| Cacheable | yes: cache_max_age accepts a cached copy |
| Batchable | yes: usable as a target in POST /v1/jobs/batch |
| Subscribable | no |
Other Facebook endpoints
- /v1/facebook/ad-library/ad Ad details
- /v1/facebook/ad-library/ad-transcript Ad video transcript
- /v1/facebook/ad-library/advertisers Find advertisers running ads
- /v1/facebook/ad-library/page-ads All ads for one advertiser
- /v1/facebook/ad-library/search Search the Meta Ad Library
- /v1/facebook/city-events Get the events of a city
- /v1/facebook/comment-replies Replies to a comment
- /v1/facebook/event Event details