100 free credits. No credit card required. Get a key

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 failure
import 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

NameTypeDescription
qquery · requiredstringPlace name or postcode. Example: austin.
Response fields

200 with a FacebookMarketplaceLocations, in Facebook’s own JSON.

FieldTypeDescription
locationsFacebookMarketplaceLocation[]
Status codes
StatusMeaning
200Matching places with coordinates.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404The ad, Page or advertiser is not in the Meta Ad Library.
429Too many requests. Wait for Retry-After seconds.
503Facebook 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.