Facebook Marketplace location search API
The places Facebook Marketplace suggests for a name or postcode (cities, neighbourhoods, postcodes), with latitude and longitude.
GET /v1/facebook/marketplace/locationsBeta1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/facebook/marketplace/locations?q=austin",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "locations": [ { "single_line_address": "Austin", "subtitle": "Austin, IL · 26,406 people checked in here", "location": { "latitude": 41.894086, "longitude": -87.763202, "reverse_geocode_detailed": { "city": "Chicago", "postal_code": "60644-1112" } }, "multi_line_address": [], "page": { "id": "108120015875983" } }, { "single_line_address": "Austin", "subtitle": "Austin, GA · 264 people checked in here", "location": { "latitude": 33.955058, "longitude": -84.529634, "reverse_geocode_detailed": { "city": "Marietta", "postal_code": "30060-1862" } }, "multi_line_address": [], "page": { "id": "312180006098697" } }, "… 2 more" ]}Parameters
| Name | Type | Description |
|---|---|---|
qquery · required | string | Place name or postcode. Example: austin. |
Response fields
200 with a FacebookMarketplaceLocations, in Facebook’s own JSON.
| Field | Type | Description |
|---|---|---|
locations | FacebookMarketplaceLocation[] |
Status codes
| Status | Meaning |
|---|---|
200 | Matching places with coordinates. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The ad, Page or advertiser is not in the Meta Ad Library. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Facebook is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Facebook is a trademark of Meta Platforms, Inc. We are not affiliated with or endorsed by Meta.