en un clic
meta-ads
Meta Ads API for Facebook/Instagram advertising. Use when user mentions "Meta Ads", "Facebook Ads", "Instagram Ads", or ad campaigns.
Menu
Meta Ads API for Facebook/Instagram advertising. Use when user mentions "Meta Ads", "Facebook Ads", "Instagram Ads", or ad campaigns.
Basé sur la classification professionnelle SOC
Google Maps Platform API for geocoding, places, routes, and distance matrices. Use when user mentions "Google Maps", "geocode", "directions", "places API", route matrix, or asks to look up an address, route, or place metadata.
A high-fashion editorial video style - cold desaturated grade, dramatic high-contrast light, monumental clean architecture or backdrop, deliberate model pose, strong silhouette, and luxury material texture. Applies to fashion, beauty, luxury, and personal-brand subjects. Trigger on /fashion-editorial, "Fashion Editorial", "luxury fashion campaign", "high fashion video", or "editorial model film".
A hand-drawn fantasy animation video style - painterly 2D backgrounds, expressive simple characters, lush nature, soft diffused light, warm storybook color, and gentle magical wonder. Applies to any fantasy, character, nature, or adventure subject. Trigger on /hand-drawn-fantasy-anime, "hand-drawn fantasy animation", "painterly 2D fantasy", "storybook anime", or "warm forest animation".
A dark luxury product macro video style - premium materials in extreme close-up, black studio, pinpoint specular highlights, ultra-shallow focus, engraved or mechanical detail, and refined reveal pacing. Applies to watches, jewelry, pens, cameras, fragrance caps, and other high-end objects. Trigger on /luxury-product, "Luxury Product", "premium product macro", "dark luxury product video", or "metal detail reveal".
A sports performance advertising video style - athlete effort, gear and body close-ups, impact rhythm, motion blur, Dutch or low angles, high-contrast desaturated grade, and dramatic rim light. Applies to any sport, athlete, training action, or performance product. Trigger on /sports-performance-ad, "sports performance ad", "athletic commercial", "training commercial", or "sports brand film".
Playful-editorial presentation look — saturated colour fields, scalloped sunburst badges and pill chips, oversized stacked headlines. Carnival palette · Archivo + Manrope · pill radius. The design system (visual language).
| name | meta-ads |
| description | Meta Ads API for Facebook/Instagram advertising. Use when user mentions "Meta Ads", "Facebook Ads", "Instagram Ads", or ad campaigns. |
META_ADS_TOKEN.act_<account-id> format when calling ad account endpoints.Normal connector requests require this header:
Authorization: Bearer $META_ADS_TOKEN
Do not pass META_ADS_TOKEN as an access_token query parameter or in the request body. Zero connector tokens are placeholders that are resolved at the network boundary when sent as the Authorization header to https://graph.facebook.com. Putting the placeholder in access_token= can send it literally and cause Meta to return a malformed access token error.
Exception: Page access tokens returned by Graph API are real secondary tokens, not Zero placeholders. For Page-token-only endpoints such as /{page-id}/ads_posts, get the Page access token with the connector token first, then use Authorization: Bearer $page_token for that Page-token request.
If requests fail, run zero doctor check-connector --env-name META_ADS_TOKEN or zero doctor check-connector --url https://graph.facebook.com/v22.0/me/adaccounts --method GET
If /{page-id}/ads_posts returns (#200) Not enough permission to call this endpoint while /me/permissions shows pages_manage_ads is granted, verify that the request is using a real Page access token. Calling /me?fields=id,name,category with Authorization: Bearer $page_token should return the Page ID, not the user ID.
curl -sS --get "https://graph.facebook.com/v22.0/me/accounts" \
--data-urlencode "fields=id,name,tasks" \
--header "Authorization: Bearer $META_ADS_TOKEN" | jq '.data[] | {id, name, tasks}'
pages_manage_ads)Use a real Page access token for Page Ads Posts. Do not use META_ADS_TOKEN for this endpoint.
PAGE_ID="{page-id}"
page_token=$(curl -sS --get "https://graph.facebook.com/v22.0/$PAGE_ID" \
--data-urlencode "fields=id,name,access_token" \
--header "Authorization: Bearer $META_ADS_TOKEN" | jq -r '.access_token')
curl -sS --get "https://graph.facebook.com/v22.0/$PAGE_ID/ads_posts" \
--data-urlencode "fields=id,created_time" \
--data-urlencode "limit=1" \
--header "Authorization: Bearer $page_token" | jq .
An empty response such as {"data":[]} is a successful call when the Page has no ad posts.
curl -s "https://graph.facebook.com/v22.0/me/adaccounts?fields=id,name,account_status,currency,timezone_name,amount_spent" \
--header "Authorization: Bearer $META_ADS_TOKEN" | jq '.data[] | {id, name, account_status, currency}'
curl -s "https://graph.facebook.com/v22.0/{ad-account-id}?fields=id,name,account_status,currency,timezone_name,balance,amount_spent,spend_cap" \
--header "Authorization: Bearer $META_ADS_TOKEN"
curl -s "https://graph.facebook.com/v22.0/{ad-account-id}/campaigns?fields=id,name,status,objective,daily_budget,lifetime_budget,start_time,stop_time" \
--header "Authorization: Bearer $META_ADS_TOKEN" | jq '.data[] | {id, name, status, objective}'
curl -s "https://graph.facebook.com/v22.0/{campaign-id}?fields=id,name,status,objective,daily_budget,lifetime_budget,start_time,stop_time,created_time,updated_time" \
--header "Authorization: Bearer $META_ADS_TOKEN"
Write the request body to a temp file, then send it:
cat > /tmp/campaign.json << 'EOF'
{
"name": "My Campaign",
"objective": "OUTCOME_AWARENESS",
"status": "PAUSED",
"is_adset_budget_sharing_enabled": false,
"special_ad_categories": []
}
EOF
curl -s -X POST "https://graph.facebook.com/v22.0/{ad-account-id}/campaigns" \
--header "Authorization: Bearer $META_ADS_TOKEN" \
--header "Content-Type: application/json" \
-d @/tmp/campaign.json
cat > /tmp/campaign-update.json << 'EOF'
{
"name": "Updated Campaign Name",
"status": "PAUSED"
}
EOF
curl -s -X POST "https://graph.facebook.com/v22.0/{campaign-id}" \
--header "Authorization: Bearer $META_ADS_TOKEN" \
--header "Content-Type: application/json" \
-d @/tmp/campaign-update.json
curl -s -X DELETE "https://graph.facebook.com/v22.0/{campaign-id}" \
--header "Authorization: Bearer $META_ADS_TOKEN"
curl -s "https://graph.facebook.com/v22.0/{ad-account-id}/adsets?fields=id,name,status,campaign_id,daily_budget,lifetime_budget,start_time,end_time,targeting" \
--header "Authorization: Bearer $META_ADS_TOKEN" | jq '.data[] | {id, name, status, campaign_id, daily_budget}'
curl -s "https://graph.facebook.com/v22.0/{adset-id}?fields=id,name,status,campaign_id,daily_budget,lifetime_budget,bid_amount,billing_event,optimization_goal,start_time,end_time,targeting" \
--header "Authorization: Bearer $META_ADS_TOKEN"
cat > /tmp/adset.json << 'EOF'
{
"name": "My Ad Set",
"campaign_id": "{campaign-id}",
"daily_budget": "1000",
"billing_event": "IMPRESSIONS",
"optimization_goal": "REACH",
"bid_amount": "500",
"targeting": {
"geo_locations": {
"countries": ["US"]
},
"age_min": 18,
"age_max": 65
},
"start_time": "2026-04-01T00:00:00-0700",
"status": "PAUSED"
}
EOF
curl -s -X POST "https://graph.facebook.com/v22.0/{ad-account-id}/adsets" \
--header "Authorization: Bearer $META_ADS_TOKEN" \
--header "Content-Type: application/json" \
-d @/tmp/adset.json
curl -s "https://graph.facebook.com/v22.0/{ad-account-id}/ads?fields=id,name,status,adset_id,campaign_id,created_time" \
--header "Authorization: Bearer $META_ADS_TOKEN" | jq '.data[] | {id, name, status, adset_id}'
curl -s "https://graph.facebook.com/v22.0/{ad-id}?fields=id,name,status,adset_id,campaign_id,creative,created_time,updated_time" \
--header "Authorization: Bearer $META_ADS_TOKEN"
Get overall account performance for the last 7 days:
curl -s "https://graph.facebook.com/v22.0/{ad-account-id}/insights?fields=impressions,clicks,spend,ctr,cpc,cpm,reach,frequency&date_preset=last_7d" \
--header "Authorization: Bearer $META_ADS_TOKEN" | jq '.data[0]'
curl -s "https://graph.facebook.com/v22.0/{ad-account-id}/insights?fields=campaign_name,campaign_id,impressions,clicks,spend,ctr,cpc,actions&level=campaign&date_preset=last_30d" \
--header "Authorization: Bearer $META_ADS_TOKEN" | jq '.data[] | {campaign_name, impressions, clicks, spend, ctr}'
curl -s "https://graph.facebook.com/v22.0/{ad-account-id}/insights?fields=impressions,clicks,spend,ctr,cpc,reach,actions&time_range={\"since\":\"2026-01-01\",\"until\":\"2026-01-31\"}" \
--header "Authorization: Bearer $META_ADS_TOKEN" | jq '.data[0]'
curl -s "https://graph.facebook.com/v22.0/{ad-account-id}/insights?fields=impressions,clicks,spend,ctr&date_preset=last_7d&time_increment=1" \
--header "Authorization: Bearer $META_ADS_TOKEN" | jq '.data[] | {date_start, impressions, clicks, spend}'
curl -s "https://graph.facebook.com/v22.0/{ad-account-id}/insights?fields=impressions,clicks,spend&date_preset=last_30d&breakdowns=age,gender" \
--header "Authorization: Bearer $META_ADS_TOKEN" | jq '.data[] | {age, gender, impressions, clicks, spend}'
curl -s "https://graph.facebook.com/v22.0/{ad-account-id}/customaudiences?fields=id,name,approximate_count_lower_bound,approximate_count_upper_bound" \
--header "Authorization: Bearer $META_ADS_TOKEN" | jq '.data[] | {id, name, approximate_count_lower_bound}'
daily_budget of 1000 = $10.00 USD."status": "PAUSED" first, then activate after review.OUTCOME_AWARENESS, OUTCOME_ENGAGEMENT, OUTCOME_LEADS, OUTCOME_SALES, OUTCOME_TRAFFIC, OUTCOME_APP_PROMOTION.date_preset values: today, yesterday, last_7d, last_30d, this_month, last_month, maximum.paging.next URL, fetch it to get more results.