Facebook Marketplace location search API

Marketplace cities and areas matching a name, with the coordinates to pass to marketplace/search as lat and lng.

GETapi.socialscrape.io/v1/facebook/marketplace/location/search
Cost
1 credit
Cached repeats
0 creditssend max_age_days, results kept 30 days
Failed requests
0 credits
Status
Betashape may still gain fields

You send query.

Request

Send your key in the x-api-key header.

curl
curl -G "https://api.socialscrape.io/v1/facebook/marketplace/location/search" \
  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \
  --data-urlencode 'query=Austin'
Python
import os
import requests

params = {
    "query": "Austin",
}
res = requests.get(
    "https://api.socialscrape.io/v1/facebook/marketplace/location/search",
    headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
    params=params,
    timeout=60,
)
body = res.json()

if body["ok"]:
    print(body["data"])
else:
    print(body["error"]["code"], body["error"]["message"])
TypeScript
const url = new URL("https://api.socialscrape.io/v1/facebook/marketplace/location/search");
url.search = new URLSearchParams({
  query: "Austin",
}).toString();
const res = await fetch(url, {
  headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();

if (body.ok) {
  console.log(body.data);
} else {
  console.error(body.error.code, body.error.message);
}
n8n
{
  "nodes": [
    {
      "name": "SocialScrape Facebook Marketplace location search",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "method": "GET",
        "url": "https://api.socialscrape.io/v1/facebook/marketplace/location/search",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "query",
              "value": "Austin"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
            }
          ]
        }
      }
    }
  ],
  "connections": {}
}

Parameters

NameTypeRequiredDescription
querystringyesCity or area name. Also accepted as keyword, q.
cursorstringOpaque cursor from the previous page; pass it back unchanged. Also accepted as continuationToken, continuation_token, next_max_id, max_id, max_cursor, min_time, after, page_token, pageToken, paginationToken, next_page_id, page.

Every request also accepts trim, raw and max_age_days.

Response

Sample from a recorded response, shortened. Values are public data, not yours.

Status 200Sample
{
  "ok": true,
  "credits_charged": 1,
  "credits_remaining": 4999,
  "cached": false,
  "cached_at": null,
  "request_id": "req_be660eba9b12c2ed37caba2e",
  "data": {
    "object": "list",
    "items": [
      {
        "object": "location",
        "platform": "facebook",
        "id": "106224666074625",
        "name": "Austin, Texas",
        "region": "Texas",
        "country": null,
        "latitude": 30.2677,
        "longitude": -97.7475,
        "extra": {
          "slug": "austin",
          "source": "logged_out_public_view"
        }
      }
    ],
    "cursor": null,
    "has_more": false,
    "parent": null
  },
  "cursor": null,
  "has_more": false
}

Fields

A page of results. Each entry in items is a Location. cursor and has_more page through the rest.

A field the platform does not give is null, never made up. Extra platform details are in extra.

FieldTypeAlwaysNotes
object"location"
platformPlatformyes
idstring or null
namestringyes
regionstring or nullstate / province
countrystring or nullISO 3166-1 alpha-2 when known
latitudenumber or null
longitudenumber or null
extraobject or null

Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.

Questions

Which errors can it return?

invalid_params (do not retry), not_found (do not retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.

How do I get more than one page?

Send the same request with cursor set to the cursor you received, until has_more is false. Each page costs its own price. See pagination.

Is there an SDK call for it?

The preview Python client has client.facebook.marketplace_location_search(...) and the TypeScript client client.facebook.marketplaceLocationSearch(). Both return the same envelope as the HTTP API. The packages are not published yet; plain HTTP works today in any language.

Can an AI agent call it?

Yes. The MCP server reaches every built endpoint, with the same prices.

Build on social data early.

Developers and agent builders get the first keys.

Get early access