Pull X Ads API campaign performance with synchronous Stats and asynchronous Stats Jobs endpoints

domain: docs.x.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Get Ads API access approved (Standard Access — a separate approval from the general X API access tiers) and authenticate with OAuth 1.0a.
  2. For near-real-time optimization, call GET stats/accounts/:account_id directly (7-day max range, no segmentation).
  3. For historical or segmented pulls, POST stats/jobs/accounts/:account_id to create an async job (up to 90 days, 45 days if segmented).
  4. Poll GET stats/jobs/accounts/:account_id until the job status is complete, then download the gzip result file from the returned URL.
  5. Call the Active Entities endpoint first to confirm which entity IDs actually served in your date range before requesting stats for them.

Known gotchas

Related routes

Run large TikTok Ads performance pulls with the Asynchronous Reporting Task API
business-api.tiktok.com · 6 steps · unrated
Pull LinkedIn Ads campaign performance with the versioned adAnalytics Finder API
learn.microsoft.com · 6 steps · unrated
Pull campaign performance reports from the Apple Search Ads Campaign Management API v5
developer.apple.com/documentation/apple_search_ads · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans