Skip to main content
GET
X community analytics API for activity & growth
Use the X community analytics API to see how active a community is. One call returns 5 activity counts for the latest period. Each has its change in percent from 1 day earlier.

What each call returns

  • likes counts likes on the community’s posts.
  • newMembers counts the accounts that joined.
  • posts counts the posts in the community.
  • replies counts the replies to those posts.
  • uniquePosters counts the distinct accounts that posted.
Each metric has a count and a changePercent. A negative changePercent means the count fell. periodEndsAt gives the end of the period in UTC.

Track community growth over time

Call the endpoint once a day for each community you follow. Store periodEndsAt with the 5 counts. A new periodEndsAt means a new period, so you can chart each metric over time. Compare communities with the same 5 metrics. uniquePosters against posts shows whether a few accounts write most posts.
Each successful call costs 1 credit. A refused ID, a missing community or a failed read costs nothing.

Path parameters

string
required
Numeric X Community ID, such as 1493446837214187523. Copy it from the community’s x.com/i/communities link. Any other value gets a free 400.

Query parameters

string
Fields to keep in each row, comma-separated, such as id,text,author.username. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns 400 unknown_field with the valid names, before any read. The price stays the same.
string
Fields to drop from each row, comma-separated, such as entities,media. It takes the same names as fields. With fields, it drops from the kept fields.

Headers

string
Your API key. Send this header or Authorization.
string
Bearer followed by your API key or OAuth token.

Response

200 OK

string
The community ID from your request.
string
ISO 8601 end of the latest period, in UTC.
object
The period’s activity. Each metric holds count & changePercent.
Each metric object has these fields.
integer
The total for the period. It is never negative.
number
The change in percent from the same figure 1 day earlier, unrounded. A fall is negative.

400 Invalid community ID

The ID is not a numeric Community ID. Send the number from the community’s link. The call costs nothing.

401 Unauthenticated

Missing or invalid API key.

402 Payment required

Account keys get account options. Guest keys get guest top-up only. Anonymous calls get a direct MPP WWW-Authenticate: Payment challenge. They also get a guest wallet creation action. No checkout starts automatically. Confirm any payment action.

404 Community not found

No community has this ID. Check the ID. The call costs nothing.

429 Rate limit exceeded

You exceeded your tier rate limit. Wait for the Retry-After header before retrying.

503 Read unavailable

The read failed. Retry shortly. The call costs nothing.
Next steps. Community Info for the community’s name & rules, or Community Tweets to read its posts.