API v1

Build with public ad data.

A JSON API for bounded Meta Ad Library collection. Every task is tenant-isolated, quota-aware, observable, and safe to retry.

Quickstart

curl -X POST https://your-domain.example/v1/tasks \
  -H 'Authorization: Bearer fb_live_your_key' \
  -H 'Idempotency-Key: my-first-run' \
  -d '{"q":"running shoes","country":"US","count":100}'

Authentication

Generate a key in the dashboard and send it as Authorization: Bearer <api-key>. The full secret is shown once.

Idempotency

Retry task creation with the same Idempotency-Key to receive the original task without double-reserving quota.

Endpoints

POST
/v1/tasks
Create a collection task
POST
/v1/tasks/from_url
Create from a Meta URL
GET
/v1/tasks/{uuid}/status
Poll task state
GET
/v1/tasks/{uuid}/results
Read paginated ads
GET
/v1/archive/ads
Search observed ads
POST
/v1/webhooks
Create a signed webhook
POST
/v1/schedules
Create a recurring run

Limits & errors

Quota exhaustion returns 402. Rate limiting returns 429 with Retry-After. Collection coverage is observational, not exhaustive.