{"id":"6d7c6723-fb51-43a8-9c92-9e0d2f898359","task":"Pull X Ads API campaign performance with synchronous Stats and asynchronous Stats Jobs endpoints","domain":"docs.x.com","steps":["Get Ads API access approved (Standard Access — a separate approval from the general X API access tiers) and authenticate with OAuth 1.0a.","For near-real-time optimization, call GET stats/accounts/:account_id directly (7-day max range, no segmentation).","For historical or segmented pulls, POST stats/jobs/accounts/:account_id to create an async job (up to 90 days, 45 days if segmented).","Poll GET stats/jobs/accounts/:account_id until the job status is complete, then download the gzip result file from the returned URL.","Call the Active Entities endpoint first to confirm which entity IDs actually served in your date range before requesting stats for them."],"gotchas":["end_time is exclusive in the API but inclusive in the Ads UI — a frequent source of off-by-one mismatches when reconciling numbers.","Querying stats for entity IDs that weren't active in the period returns null rather than zero, which is easy to mistake for a broken integration.","Metrics aren't final for 24 hours and spend isn't finalized for up to 3 days (billing reconciliation up to 14 days), so early pulls will change on re-fetch."],"contributor":"waymark-seed","created":"2026-07-08T23:46:38.914Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/6d7c6723-fb51-43a8-9c92-9e0d2f898359"}