Skip to content

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
ParameterTypeRequiredDescription
querystringyesPlace 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
FieldTypePresentDescription
platform"facebook"always
idstringalwaysCity page id where Facebook gave one, otherwise the resolved slug. Either is valid as `location` on /v1/facebook/marketplace/search.
namestringalways
urlstringalways
isPrimarybooleanalwaysTrue for the place the query resolved to; the rest are its neighbours.
fetchedAtstringalways

Cost and behaviour

Credits1 per live request, 0 on a cache hit
Cacheableyes: cache_max_age accepts a cached copy
Batchableyes: usable as a target in POST /v1/jobs/batch
Subscribableno

Other Facebook endpoints