# Facebook Marketplace Search API

Search public Facebook Marketplace listings by keyword and location. Each listing carries the listing id, title, price in both raw and display form, currency, strikethrough price, creation time, sold, live, hidden and pending flags, category id, primary photo and reverse-geocoded location, and delivery types. The response also returns Facebook's own filter keys with their enumerated values and its category taxonomy with ids, names and seo_urls, plus a count for each list. One request returns one page. A query with no hits is a real answer and is billed as one: it returns an empty listings array with listings_count 0 and no_results true.

- **Documentation:** [https://scrappa.co/docs/facebook-api/facebook_marketplace_search](https://scrappa.co/docs/facebook-api/facebook_marketplace_search)
- **API group:** Facebook API
- **Endpoint:** `GET https://scrappa.co/api/facebook/marketplace/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | No | Free-text Marketplace search term (e.g. bike). |
| `location` | string | No | Location filter: a city name or id. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/facebook/marketplace/search?query=bike&location=San+Francisco"
```

## Example response

```json
{
    "success": true,
    "listings": [
        {
            "id": "1901234567890123",
            "title": "Blue road bike",
            "price": {
                "amount": 12000,
                "currency": "USD",
                "formatted": "$120",
                "strikethrough": null
            },
            "creation_time": 1790872565,
            "is_sold": false,
            "is_live": true,
            "is_hidden": false,
            "is_pending": false,
            "category_id": "1431854160195282",
            "image": {
                "uri": "https://...",
                "width": 1200,
                "height": 1200
            },
            "location": {
                "city": "San Francisco",
                "state": "California"
            },
            "delivery_types": [
                "LOCAL_PICK_UP"
            ]
        }
    ],
    "listings_count": 1,
    "filters": [
        {
            "key": "itemCondition",
            "choices": [
                "NEW",
                "USED"
            ]
        }
    ],
    "filters_count": 1,
    "categories": [
        {
            "id": "677457442746983",
            "name": "Apparel",
            "seo_url": "apparel",
            "seo_id": "2626320500744915"
        }
    ],
    "categories_count": 1,
    "no_results": false,
    "search_parameters": {
        "query": "bike",
        "city": "San Francisco"
    },
    "meta": {
        "classification": "ok",
        "billable": true,
        "endpoint_family": "facebook_marketplace_search",
        "duration_ms": 8100
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter is missing or malformed, for example a handle with characters Facebook does not allow or a non-numeric id. |
| 404 | Not Found | The page, profile, group, event, photo, reel, post or listing does not exist, is not public, or was served by Facebook without the requested record. This is the truthful answer, not a temporary fault: it is never billed and retrying the same permalink will not change it. |
| 503 | Records Not Read | Facebook returned records for this request that the parser could not read. The origin status is 502 and it is reported here as 503 because Cloudflare replaces 502 and 504 bodies with its own page. This request is never billed: the customer received no data. |
| 503 | Temporarily Unavailable | The upstream service is temporarily unavailable. Please retry shortly. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
