https://graph.facebook.com/v21.0
- Method: OAuth2 access token
- Token types: User token, System User token, Page token
- OAuth URL:
https://www.facebook.com/v21.0/dialog/oauth - Token exchange URL:
https://graph.facebook.com/v21.0/oauth/access_token - Required scopes:
ads_management,ads_read - Token passed as:
access_tokenquery parameter orAuthorization: Bearer <token>header
- Standard Marketing API: 200 calls per user per hour per ad account
- Batch API: Up to 50 requests per batch call
- Rate limit headers:
x-business-use-case-usage,x-app-usage,x-ad-account-usage - HTTP 429 returned when rate limited with
retry-afterheader
- Pattern: Cursor-based pagination
- Response structure:
{ "data": [...], "paging": { "cursors": { "before": "...", "after": "..." }, "next": "https://graph.facebook.com/v21.0/...", "previous": "https://graph.facebook.com/v21.0/..." } } - Use
aftercursor or follownextURL to paginate forward limitparameter controls page size (default varies by endpoint)
All endpoints require explicit fields parameter to request specific data.
Example: ?fields=id,name,status
GET /me/adaccounts- List accessible ad accountsGET /act_{account_id}- Get account details- Fields: id, name, account_id, account_status, currency, timezone_name, amount_spent, balance
GET /act_{account_id}/campaigns- List campaignsGET /{campaign_id}- Get campaign detailsPOST /act_{account_id}/campaigns- Create campaignPOST /{campaign_id}- Update campaign- Fields: id, name, status, effective_status, objective, daily_budget, lifetime_budget, created_time, updated_time, start_time, stop_time
- Objectives (v21): OUTCOME_AWARENESS, OUTCOME_TRAFFIC, OUTCOME_ENGAGEMENT, OUTCOME_LEADS, OUTCOME_APP_PROMOTION, OUTCOME_SALES
- Statuses: ACTIVE, PAUSED, DELETED, ARCHIVED
GET /act_{account_id}/adsets- List ad setsGET /{adset_id}- Get ad set detailsPOST /act_{account_id}/adsets- Create ad setPOST /{adset_id}- Update ad set- Fields: id, name, status, effective_status, campaign_id, daily_budget, lifetime_budget, billing_event, optimization_goal, bid_amount, targeting, created_time, updated_time, start_time, end_time
- Billing events: IMPRESSIONS, LINK_CLICKS, APP_INSTALLS, PAGE_LIKES
- Optimization goals: REACH, IMPRESSIONS, LINK_CLICKS, LANDING_PAGE_VIEWS, LEAD_GENERATION, CONVERSIONS
GET /act_{account_id}/ads- List adsGET /{ad_id}- Get ad detailsPOST /{ad_id}- Update ad- Fields: id, name, status, effective_status, adset_id, campaign_id, creative{id}, created_time, updated_time
GET /act_{account_id}/insights- Account-level insightsGET /{campaign_id}/insights- Campaign-level insightsGET /{adset_id}/insights- Ad-set-level insightsGET /{ad_id}/insights- Ad-level insights- Fields: impressions, clicks, spend, cpc, cpm, ctr, reach, frequency, conversions, cost_per_conversion, date_start, date_stop
- Date presets: today, yesterday, this_month, last_month, last_7d, last_14d, last_28d, last_30d, last_90d, last_year
- Custom range:
time_range={"since":"YYYY-MM-DD","until":"YYYY-MM-DD"} - Breakdown levels: account, campaign, adset, ad
GET /act_{account_id}/customaudiences- List custom audiencesGET /{audience_id}- Get audience details- Fields: id, name, description, subtype, approximate_count_lower_bound, approximate_count_upper_bound, time_created, time_updated, delivery_status
- Subtypes: CUSTOM, WEBSITE, APP, OFFLINE_CONVERSION, LOOKALIKE