Collect and Reconcile X API v2 Post Metrics
Retrieve authorized X post metrics with field-level availability, checkpointed pagination, and explicit rate-limit and missing-data handling.
Record the X API endpoint, authenticated context, product access, authorized post population, and date of collection. Use the current metrics documentation to determine which fields are public and which need eligible user context or have time restrictions. Request only the fields needed for the report. Verify token scope through the project's approved integration and keep tokens out of query logs and output files. ## Key Points - [X API metrics](https://docs.x.com/x-api/fundamentals/metrics) - [X pagination](https://docs.x.com/xdks/python/pagination)
skilldb get analytics-services-skills/x-api-v2-metricsFull skill: 30 linesCollect and Reconcile X API v2 Post Metrics
Define exactly what the dataset measures
Record the X API endpoint, authenticated context, product access, authorized post population, and date of collection. Use the current metrics documentation to determine which fields are public and which need eligible user context or have time restrictions. Request only the fields needed for the report. Verify token scope through the project's approved integration and keep tokens out of query logs and output files.
Write a metric availability table before collecting. For each field, state when it is expected and what missing versus zero means. A zero means the API supplied an observed zero. A missing, inaccessible, or unsupported metric should keep its own state. Record the source endpoint and observation time because counts can change after collection and access can differ among posts.
Collect with stable checkpoints
Use the endpoint's documented pagination parameters. Persist the pagination token only after the corresponding page is durably recorded. Deduplicate using stable post identity and observation scope. Store the requested window and field list with the checkpoint so a cursor cannot be reused against a different collection. Respect endpoint restrictions and use the authorized backfill behavior when a cursor expires.
For throttling, record the response and use the documented reset or retry guidance. Distinguish quota exhaustion, invalid access, deleted or inaccessible posts and transient service errors. Keep retry bounds explicit. When a request stops halfway, report partial coverage and resume from the last durable boundary after access is available. Do not convert failed fetches into zero-engagement posts.
Reconcile reporting inputs
Use a fixture with two pages, one repeated post, one explicit zero and one unavailable field. Verify counts, deduplication, request scope and final cursor behavior. Exercise a throttled page and resume. Test an authorized user-context case separately if the reporting project relies on its fields. Compare a few results against a source view whose access context matches the API request where possible.
Deliver the collection window, fields and authentication type, rows collected, missing-field breakdown and completeness limits. Label aggregates computed across incomplete metric sets so readers cannot confuse coverage with engagement. Record API and collection changes that would make a future comparison unreliable.
References
Install this skill directly: skilldb add analytics-services-skills
Related Skills
Amplitude Analytics
Amplitude: product analytics, behavioral cohorts, funnels, retention, experiment platform, user journeys, JavaScript SDK
Heap
Heap: autocapture product analytics, session replay, retroactive event definition, funnel and retention analysis, JavaScript SDK
June.so
June.so: B2B product analytics, company-level insights, feature adoption reports, activation tracking, Node and JavaScript SDK
Mixpanel Analytics
Mixpanel: event-based analytics, funnels, retention, user profiles, cohorts, group analytics, JavaScript/Node SDK
Plausible Analytics
Plausible: privacy-friendly analytics, no cookies, lightweight script, custom events, goals, API, self-hosted option
PostHog Analytics
PostHog: product analytics, event tracking, feature flags, session recordings, A/B testing, self-hosted/cloud, Next.js SDK