GET /v1/facebook/events_search

Facebook events search API: find public events by keyword

Returns Facebook's public event search for one keyword as Page[FacebookEvent]: id, name and URL of each event. Send the keyword as query. A first page with no events carries meta.possibly_shadow_empty: true, because Facebook answers some queries with an empty page that looks normal.

Price
$0.0005 per 8 results
Billing
$0.0005/8
Batch
Yes, through /v1/batch
Failed calls
Not charged

Example request

curl
curl 'https://api.virev.ai/v1/facebook/events_search?query=NASA&max_pages=1' \
  -H "Authorization: Bearer $VIREV_API_KEY"
python
import os
import requests

response = requests.request(
    "GET",
    "https://api.virev.ai/v1/facebook/events_search",
    params={
        "query": "NASA",
        "max_pages": "1",
    },
    headers={"Authorization": f"Bearer {os.environ['VIREV_API_KEY']}"},
    timeout=60,
)
response.raise_for_status()
print(response.json())

Parameters

NameInTypeDescription
query requiredquerystringThe search text, 1 to 500 characters. Example NASA.
since querystringNot accepted on this operation: its items carry no timestamp, so since returns 400 before billing.
max_pages queryintegerMaximum pages to fetch. -1 walks until exhaustion or since with no page cap, and must be written. Omitted, since alone bounds the walk; with neither, the job stops after 10 pages. Any positive integer is accepted. 1 returns one page synchronously with HTTP 200; any other value creates a durable job with HTTP 202. Example 1.
cursor querystringOpaque next_cursor from an earlier answer of this operation, also with get_raw=true. A native Facebook cursor from a raw page answers 400. Result download cursors belong to the results route.
cached queryauto | cache_only | liveauto (default) serves a read saved within the last 24 hours for these exact arguments, otherwise fetches. cache_only never contacts Facebook (404 not_cached when nothing is saved, whatever its age). live always fetches. Anything else is a 400. cache_only reads one saved page per request: omit max_pages or pass 1, and continue with next_cursor. Default auto.
get_raw querybooleantrue returns the upstream JSON exactly as Facebook answered it instead of the normalized Page[FacebookEvent]. Default false.
Idempotency-Key headerstringReuse this key with the same inputs to recover a lost job submission. A different input with the same key returns 409.

Example response

The example response of the API reference, with lists cut to their first 3 items and long text shortened.

json
{
  "data": {
    "items": [
      {
        "id": "1777966839979615",
        "name": "\"AN ONLINE EVENING WITH MIRABAI BUSH\"",
        "description": null,
        "url": "https://www.facebook.com/events/1777966839979615/",
        "starts_at": null,
        "ends_at": null,
        "timezone": null,
        "location_name": null,
        "address": null,
        "lat": null,
        "lng": null,
        "host": null,
        "going": null,
        "interested": null,
        "is_online": null
      },
      {
        "id": "1474625497812411",
        "name": "MAX POWER",
        "description": null,
        "url": "https://www.facebook.com/events/1474625497812411/",
        "starts_at": null,
        "ends_at": null,
        "timezone": null,
        "location_name": null,
        "address": null,
        "lat": null,
        "lng": null,
        "host": null,
        "going": null,
        "interested": null,
        "is_online": null
      }
    ],
    "pages": [
      {
        "cursor": null,
        "fetched_at": "2026-10-27T20:35:51.228706+00:00",
        "count": 2
      }
    ],
    "next_cursor": "eyJhZnRlciI6IntcInBhZ2VfbnVtYmVyXCI6MCxcImZsb3dfY3Vyc29yc19zZXJpYWxpemVkXCI6e1wiSU5URVJOQUxfREVCVUdfTU9EVUxFXCI6XCJ7fVwiLFwiU0VBUkNIX0NPTlRST0xTX0lOVEVSQ0VQVFwiOlwie31cIixcIklOVEVHUklUWVwiOlwie1xcXCJoYXNfbW9yZV9yZXN1bHRzXFxcIjpmYWxzZSxcXFwi…",
    "has_more": true,
    "stop_reason": "pages",
    "coverage": {
      "since": null,
      "oldest_at": null,
      "since_reached": false
    }
  },
  "meta": {
    "source": "live",
    "fetched_at": "2026-10-27T20:35:51.228706+00:00",
    "cost": "$0.0005",
    "balance": "$9.9995",
    "request_id": "req_738a7813573f78f37dbfa3672e99f99e"
  }
}

How it works

Facebook's public event search for a query. While the residential proxy pool is out, the search answers one page of about 8 events: a search with more results answers next_cursor: null and stop_reason: "cursor_stalled", and a call that sends a cursor answers 400. Facebook answers some queries with a normal-looking empty page, so a first page with no events carries meta.possibly_shadow_empty: true and may be false. With max_pages=1, returns Page[FacebookEvent] under data; with get_raw=true returns the upstream JSON.

The default request creates a durable job (202). Use max_pages=1 for one synchronous Page response (200). Poll status_url, then read results_url with its opaque cursor. Acquisition stops at the first of since, max_pages, or exhaustion. Jobs continue after disconnects. Result responses are bounded to 3 MiB; this does not limit the crawl. Supply Idempotency-Key to recover a lost submission response; reuse it with the same inputs. Facebook sets every page’s size, so there is no page_size.

A field Facebook does not carry is null, a list it does not carry is [], and Facebook-only facts sit under extra. Unknown, unsupported, and repeated query parameters return 400 before acquisition or billing.

Billing: $0.0005 per 8 unique returned items (one native page), rounded up to a minimum of one billing unit; a get_raw=true page bills one unit. Jobs settle once after successful completion. Submission, polling and repeat downloads are free.

Errors

StatusWhen
400The request parameters are invalid.
401Missing, malformed, or revoked API key.
402Balance is too low for this request.
404cached=cache_only found nothing saved for these arguments (not_cached; call again with cached=auto to fetch it), or the Facebook account or item does not exist (not_found). You are not charged.
429Over the per-minute limit. The limit belongs to your organization and all its API keys share it: 100 requests per minute unless an increase was granted. Wait for the Retry-After seconds, then retry. On a live read, code rate_limited means the platform itself rate-limited this read; retry after the Retry-After seconds. You are not charged.
502The upstream fetch failed. You are not charged.
503Billing could not be confirmed, so no upstream data was returned.
504The upstream request timed out. You are not charged.