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:

DescriptionEnterpriseX API v2
Host domainhttps://gnip-api.x.comhttps://api.x.com
Endpoint path/search/30day/accounts/:account_name/:label/counts.json/2/tweets/counts/recent
AuthenticationBasic authenticationOAuth 2.0 Bearer Token
Timestamp formatYYYYMMDDhhmmYYYY-MM-DDTHH:mm:ssZ
ISO 8601 / RFC 3339
Returns counts of Posts that are no older than31 days7 days
HTTP methods supportedGETGET
Default request rate limits20 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 arrayresultsdata
Time granularityDay, hour, or minuteDay, hour, or minute
TimezoneUTCUTC
Request parameters for selecting time periodfromDate
toDate
start_time
end_time
Request parameters for navigating by Post IDsince_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:

DescriptionEnterpriseX API v2
Host domainhttps://gnip-api.x.comhttps://api.x.com
Endpoint path/search/fullarchive/accounts/:account_name/:label/counts/2/tweets/counts/all
AuthenticationBasic authOAuth 2.0 Bearer Token
Timestamp formatYYYYMMDDHHMMYYYY-MM-DDTHH:mm:ssZ
ISO 8601 / RFC 3339
Returns Post counts that are no older thanThe full archive since March 2006The full archive since March 2006
HTTP methods supportedGET
POST
GET
Default request rate limitsThe 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
GranularityDay, hour, minuteDay, hour, minute
Supports filtering using annotations
Supports filtering using conversation_id
JSON key name for Post data arrayresultsdata
Request parameters for selecting time periodfromDate
toDate
start_time
end_time
Request parameters for navigating by Post IDsince_id
until_id
JSON key name for paginationnextmeta.next_token
Request parameter for paginationnext_tokennext_token or pagination_token
TimezoneUTCUTC
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):

Enterprisev2
keywordAvailableCore
emojiAvailableCore
“exact phrase”AvailableCore
#AvailableCore
$AvailableAdvanced
@AvailableCore
from:AvailableCore
to:AvailableCore
url:AvailableCore
retweets_of:AvailableCore
context:Core
entity:Core - Only available with recent search
conversation_id:Core
place:AvailableAdvanced
place_country:AvailableAdvanced
point_radius:AvailableAdvanced
bounding_box:AvailableAdvanced
is:retweetAvailableCore
is:replyAvailableCore
is:quoteAvailableCore
is:verifiedAvailableCore
-is:nullcastAvailableAdvanced
has:hashtagsAvailableCore
has:cashtagsAvailableAdvanced
has:linksAvailableCore
has:mentionsAvailableCore
has:mediaAvailableCore
has:imagesAvailableCore
has:videosAvailableCore
has:geoAvailableAdvanced
lang:AvailableCore
list:Advanced
has:profile_geoAvailable
profile_countryAvailable
profile_localityAvailable
profile_regionAvailable
proximityAvailable

Other migration resources

X API migration hub

Check out some sample code for these endpoints

Post counts: Enterprise to X API v2