Skip to main content

Enterprise compared to X API v2

Similarities
  • Granularity
  • Pagination
  • Timezone
Differences
  • Endpoint URLs
  • App and Project requirement
  • Available time periods
  • Response data format
  • HTTP methods
  • Request time formats
  • Request parameters
  • Filtering operators

Similarities

Granularity While the parameter for selecting granularity of the returned data is different (bucket for the enterprise version, granularity for the v2 version), the values that you can pass with that parameter are the same, as well as the default behavior:
  • day
  • hour (default)
  • minute
Pagination While v2 has additional pagination features (new pagination parameters that allow you to navigate using Post IDs with since_id and until_id), both enterprise and v2 allow you to paginate using time (fromDate and toDate with enterprise, and start_time and end_time for v2). If you are using the enterprise version, you will use the next parameter to paginate, the next token field will be called next, and it will be located at the root in the response. If you are using v2, you can use either the next_token or pagination_token parameter to paginate, and your next token will be located at meta.next_token in the response.   Timezone As noted in the pagination section, you can navigate different pages of data using time for both enterprise and v2. In both cases, you will be using UTC as the timezone when using these parameters.

Differences

Endpoint URLs
  • Enterprise endpoints:
    • 30 day - http://gnip-api.x.com/search/30day/accounts/:account_name/:label/counts.json
    • Full-archive - http://gnip-api.x.com/search/fullarchive/accounts/:account_name/:label/counts.json
  • X API v2 endpoints
    • Recent (7 day) - https://api.x.com/2/tweets/counts/recent
    • Full-archive - https://api.x.com/2/tweets/counts/all
App and Project requirement The X API v2 endpoints require that you use credentials from a developer App that is associated with a Project when authenticating your requests. All X API v1.1 endpoints can use credentials from standalone Apps or Apps associated with a Project.   Available time periods Both the enterprise API and X API v2 offer endpoints that allow you to retrieve Post volume data for the full-archive of Posts. However, the X API v2 does not offer a 30 day time period endpoint like the enterprise API does. Instead it offers the aforementioned full-archive, or a 7 day time period, which align with the v2 Search Posts endpoints.   Response data format There are some slight differences in the data format that you will receive via enterprise and X API v2:
  • Enterprise’s counts data is located within a results object, while the v2 counts data is located within a data object.
  • Enterprise’s counts fields are called timePeriod (start time) and count, while v2 breaks out the time period into a start and end field (which use a different date/time format from enterprise explained in request time formats), and renamed the count field to tweet_count.
  • The enterprise metadata includes totalCount, next, and the requestParameters object at the root level. Instead,v2 doesn’t include the requestParameters object, and moves/renames the following into a meta object that lives at the root level: total_tweet_count & next_token.  
HTTP methods The enterprise version of the API allows you to pass the request as either a POST HTTP method with a JSON body, or a GET HTTP method with a query string. V2 only allows you to use the GET HTTP method with a query string.   Request time formats The enterprise version of this endpoint uses the following date/time format in both the pagination parameters and the timePeriod response field: YYYYMMDDHHmm The v2 endpoint uses ISO 8601/RFC 3339 date/time format in both the pagination parameters and the start and end response fields: YYYY-MM-DDTHH:mm:ssZ Request parameters The following is a table of the request parameters for enterprise and X API v2:
EnterpriseSearch Posts v2
queryquery
bucketgranularity
fromDate (YYMMDDHHmm)start_time (YYYY-MM-DDTHH:mm:ssZ)
toDate (YYMMDDHHmm)end_time (YYYY-MM-DDTHH:mm:ssZ)
since_id
until_id
nextnext_token and pagination_token
Filtering operators While the operators between enterprise and X API v2 are mostly the same, there are some differences in operator availability and some new operators that were introduced to just the X API v2 version. To see a full table of the operators that are available for X API v2, enterprise, and even premium, please visit the Post counts migration landing page.

API reference index

For a complete API reference, please select an endpoint from below.

Recent Post counts

Receive a count of Posts that match a query in the last 7 days[GET /2/tweets/counts/recent](/x-api/posts/tweet-counts#api-reference-index/get-tweets-counts-recent)

Full-archive Post counts

Only available to those with Pro and Enterprise access
Receive a count of Posts that match a query[GET /2/tweets/counts/all](/x-api/posts/tweet-counts#api-reference-index/get-tweets-counts-all)