Facebook Marketplace API: Authentication — FetchLayer Docs

Authentication

All requests use your FetchLayer API key as a Bearer token. There is no Facebook account to set up: everything returned is what a listing shows publicly.

Sending requests

bash
curl -X POST https://api.fetchlayer.dev/facebook-marketplace/search-listings \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"query":"road bike","city":"london"}'

Keep your key secret

Only use API keys in server-side code and rotate a key immediately if it is exposed.

POST for data, GET for photos

Every data route takes a JSON body over POST. GET /facebook-marketplace/media streams a photo and takes its link as a query parameter, with the same Bearer header. Unrecognised body fields are rejected with a 400 naming the field.

Authentication errors

A missing or invalid key returns HTTP 401. A key scoped to other platforms returns HTTP 403.

json
{
  "error": "Invalid API key"
}
Product overview Facebook Marketplace API: what it returns, pricing and use cases