Migrate

Comparing X API’s Post counts endpoints

The v2 Post counts endpoint will eventually replace the enterprise Search API’s counts endpoint. If you have code, apps, or tools that use an older version of a Post counts endpoint and are considering migrating to the newer X API v2 endpoints, then this guide is for you.

This page contains two comparison tables:

Recent Post counts comparison

The enterprise version of the Post counts endpoints allow you to pull counts for either 30 days or from the full-archive. Therefore, the v2 recent Post counts endpoint, which looks at a 7 day time period, is not a direct replacement for either of the aforementioned endpoints.

However, to help with comparisons, we will look at how the v2 recent Post counts endpoint compares to the enterprise 30-day endpoint.

The following table compares the various types of recent Post counts endpoints:

Description Enterprise X API v2
Host domain https://gnip-api.x.com https://api.x.com
Endpoint path /search/30day/accounts/:account_name/:label/counts.json /2/tweets/counts/recent
Authentication Basic authentication OAuth 2.0 Bearer Token
Timestamp format YYYYMMDDhhmm YYYY-MM-DDTHH:mm:ssZ
ISO 8601 / RFC 3339
Returns counts of Posts that are no older than 31 days 7 days
HTTP methods supported GET GET
Default request rate limits 20 requests per 1 sec, aggregated across search data and counts requests
The per minute rate limit will vary by partner as specified in your contract.
180 requests per 15 min per user
450 requests per 15 min per App
Supports filtering using annotations  
Supports filtering using conversation_id  
JSON key name for Post data array results data
Time granularity Day, hour, or minute Day, hour, or minute
Timezone UTC UTC
Request parameters for selecting time period fromDate
toDate
start_time
end_time
Request parameters for navigating by Post ID   since_id
until_id
Requires the use of credentials from a developer App associated with a project  




Full-archive Post counts comparison

The following table compares the various types of full-archive search endpoints:

Description Enterprise X API v2
Host domain https://gnip-api.x.com https://api.x.com
Endpoint path /search/fullarchive/accounts/:account_name/:label/counts /2/tweets/counts/all
Authentication Basic auth OAuth 2.0 Bearer Token
Timestamp format YYYYMMDDHHMM YYYY-MM-DDTHH:mm:ssZ
ISO 8601 / RFC 3339
Returns Post counts that are no older than The full archive since March 2006 The full archive since March 2006
HTTP methods supported GET
POST
GET
Default request rate limits The per minute rate limit will vary by partner as specified in your contract.
20 requests per sec
300 requests per 15 min per App
1 request per 1 sec per App
Granularity Day, hour, minute Day, hour, minute
Supports filtering using annotations  
Supports filtering using conversation_id  
JSON key name for Post data array results data
Request parameters for selecting time period fromDate
toDate
start_time
end_time
Request parameters for navigating by Post ID   since_id
until_id
JSON key name for pagination next meta.next_token
Request parameter for pagination next_token next_token or pagination_token
Timezone UTC UTC
Requires the use of credentials from a developer App associated with a Project that has Academic Research access  




Filtering operator comparison

The two different versions (enterprise, and v2) of Post counts differ in which operators are available, and also have varying levels of operator availability within each version, which are explained below.

Enterprise

  • There are no sub-tiers of enterprise operators. All enterprise operators are available to all enterprise users.

X API v2

  • Core: These operators are available to any v2 user.
  • Advanced: These operators are only available to users that have been approved for Academic Research access.

You can learn more about each of these sets of operators in their respective guides:

Now that we understand these different operator levels within X API v2, here is the table that maps out operator availability for Post counts (note that if the cell is left blank, the operator is not available):

  Enterprise v2
keyword Available Core
emoji Available Core
“exact phrase” Available Core
# Available Core
$ Available Advanced
@ Available Core
from: Available Core
to: Available Core
url: Available Core
retweets_of: Available Core
context:   Core
entity:   Core - Only available with recent search
conversation_id:   Core
place: Available Advanced
place_country: Available Advanced
point_radius: Available Advanced
bounding_box: Available Advanced
is:retweet Available Core
is:reply Available Core
is:quote Available Core
is:verified Available Core
-is:nullcast Available Advanced
has:hashtags Available Core
has:cashtags Available Advanced
has:links Available Core
has:mentions Available Core
has:media Available Core
has:images Available Core
has:videos Available Core
has:geo Available Advanced
lang: Available Core
list:   Advanced
has:profile_geo Available  
profile_country Available  
profile_locality Available  
profile_region Available  
proximity Available