# Facebook Events Search API

Search public Facebook events by query and location. Each record carries the event id, name, profile URL, profile picture, the day and time sentence, the place name, the online flag, RSVP counts and the cover image, and each id can be passed straight to the event endpoint. One request returns one page of results (measured 4 to 8 records). Facebook paginates this surface by cursor, but the next page requires a second upstream request, so no cursor input is accepted here. Each call is billed once and returns one page. A search that matches no events is a real answer: it returns an empty events array with events_count 0 and is billed once. The query is required, because a location on its own matches nothing on this surface: such a request is rejected as invalid rather than billed for a page of results Facebook never served.

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

## 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 | Yes | Free-text events search term. Required: a location on its own matches nothing on this surface. |
| `location` | string | No | Location filter: a city, region or country. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/facebook/events?query=conference&location=Berlin"
```

## Example response

```json
{
    "success": true,
    "events": [
        {
            "id": "3304701543049439",
            "name": "Event Name",
            "profile_url": "https://www.facebook.com/events/3304701543049439/",
            "profile_picture": {
                "uri": "https://...",
                "width": null,
                "height": null
            },
            "day_time_sentence": "Fri, Nov 6 at 1:00 PM",
            "place": "Venue Name",
            "is_online": false,
            "rsvp": {
                "interested": 1400,
                "going": 32
            },
            "cover_image": {
                "uri": "https://...",
                "width": null,
                "height": null
            }
        }
    ],
    "events_count": 1,
    "search_parameters": {
        "q": "conference",
        "place": "Berlin"
    },
    "meta": {
        "classification": "ok",
        "billable": true,
        "endpoint_family": "facebook_events",
        "duration_ms": 5900
    }
}
```

## 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)
