Please note: We have released a new version of search Posts and Post counts in X API v2. We encourage you to review what’s new with X API v2. These endpoints have been updated to include Post edit metadata. Learn more about these metadata on the “Edit Posts” fundamentals page.
Overview
Enterprise
The enterprise APIs are available within our managed access levels only. To use these APIs, you must first set up an account with our enterprise sales team. To learn more see HERE.
You can view all of the X API search Post offerings HERE.
There are two enterprise search APIs:
- 30-Day Search API provides data from the previous 30 days.
- Full-Archive Search API provides complete and instant access to the full corpus of X data dating all the way back to the first Post in March 2006.
Request types
The enterprise search APIs support two types of requests:Search requests (data)
Search requests to the enterprise search APIs allow you to retrieve up to 500 results per response for a given timeframe, with the ability to paginate for additional data. Using the maxResults parameter, you can specify smaller page sizes for display use cases (allowing your user to request more results as needed) or larger page sizes (up to 500) for larger data pulls. The data is delivered in reverse chronological order and compliant at the time of delivery.Counts requests (Post count)
Counts requests provide the ability to retrieve historical activity counts, which reflect the number of activities that occurred which match a given query during the requested timeframe. The response will essentially provide you with a histogram of counts, bucketed by day, hour, or minute (the default bucket is hour). It’s important to note that counts results do not always reflect compliance events (e.g., Posts deletes) that happen well after (7+ days) a Post is published; therefore, it is expected that the counts metric may not always match that of a data request for the same query. Billing note: each request – including pagination requests – made against the data and counts endpoints are counted as a billed request. Therefore, if there are multiple pages of results for a single query, paging through the X pages of results would equate to X requests for billing.Available operators
Enterprise search APIs support rules with up to 2,048 characters. The enterprise search APIs support the operators listed below. For detailed descriptions see HERE.Data availability / important date
When using the Full-Archive search API, keep in mind that the X platform has continued to evolve since 2006. As new features were added, the underlying JSON objects have had new metadata added to it. For that reason it is important to understand when Post attributes were added that search operators match on. Below are some of the more fundamental ‘born on’ dates of important groups of metadata. To learn more about when Post attributes were first introduced, see this guide.- First Post: 3/21/2006
- First Native Retweets: 11/6/2009
- First Geo-tagged Post: 11/19/2009
- URLs first indexed for filtering: 8/27/2011
- Enhanced URL expansion metadata (website titles and descriptions): 12/1/2014
- Profile Geo enrichment metadata and filtering: 2/17/2015
Data Updates and Mutability
With the enterprise search APIs, some of the data within a Post is mutable, i.e. can be updated or changed after initial archival. This mutable data falls into two categories:- User object metadata:
- User’s @handle (numeric ID does not ever change)
- Bio description
- Counts: statuses, followers, friends, favorites, lists
- Profile location
- Other details such as time zone and language
- Post statistics - i.e. anything that can be changed on the platform by user actions (examples below):
- Favorites count
- Retweet count
Single vs. Multi-threaded Requests
Each customer has a defined rate limit for their search endpoint. The default per-minute rate limit for Full-Archive search is 120 requests per minute, for an average of 2 queries per second (QPS). This average QPS means that, in theory, 2 requests can be made of the API every second. Given the pagination feature of the product, if a one-year query has one million Posts associated with it, spread evenly over the year, over 2,000 requests would be required (assuming a ‘maxResults’ of 500) to receive all the data. Assuming it takes two seconds per response, that is 4,000 seconds (or just over an hour) to pull all of that data serially/sequentially through a single thread (1 request per second using the prior response’s “next” token). Not bad! Now consider the situation where twelve parallel threads are used to receive data. Assuming an even distribution of the one million Posts over the one-year period, you could split the requests into twelve parallel threads (multi-threaded) and utilize more of the per-second rate limit for the single “job”. In other words, you could run one thread per-month you are interested in and by doing so, data could be retrieved 12x as fast (or ~6 minutes). This multi-threaded example applies equally well to the counts endpoint. For example, if you wanted to receive Post counts for a two-year period, you could make a single-threaded request and page back through the counts 31 days at a time. Assuming it takes 2 seconds per response, it would take approximately 48 seconds to make the 24 API requests and retrieve the entire set of counts. However, you also have the option to make multiple one-month requests at a time. When making 12 requests per second, the entire set of counts could be retrieved in approximately 2 seconds.Retry Logic
If you experience a 503 error with the enterprise search APIs, it is likely a transient error and can be resolved by re-trying the request a short time later. If the request fails 4 times in a row, and you have waited at least 10 minutes between failures, use the following steps to troubleshoot:- Retry the request after reducing the amount of time it covers. Repeat this down to a 6-hour time window if unsuccessful.
- If you are ORing a large number of terms together, split them into separate rules and retry each individually.
- If you are using a large number of exclusions in your rule, reduce the number of negated terms in the rule and retry.
Quick start
Getting started with enterprise Search Posts: 30-Day API
The enterprise Search Posts: 30-Day API provides you with Posts posted within the last 30 days. Posts are matched and sent back to you based on the query you specify in your request. A query is a rule in which you define what the Post you get back should contain. In this tutorial, we will search for Posts originating from the X account @XDevelopers in English. The Posts you get back in your payload can be in a data format, which provides you with the full Post payload, or it can be in a counts format which gives you numerical count data of matched Posts. We will be using cURL to make requests to the data and counts endpoints. You will need the following:- [An enterprise account]https://developer.x.com/en/products/x-api/enterprise
- Your username, password, and account name
- Label associated with your search endpoint, as displayed at console.gnip.com
Accessing the data endpoint
The data endpoint will provide us with the full Post payload of matched Posts. We will use thefrom: and lang: operators to find Posts originating from @XDevelopers in English. For more operators click here.
- cURL
- cURL example
-
Username
<USERNAME>e.g.email@domain.com -
Account name
<ACCOUNT-NAME>e.g.john-doe -
Label
<LABEL>e.g.prod -
fromDate and toDate e.g.
"fromDate":"201811010000", "toDate":"201811122359"
Data endpoint response payload
The payload you get back from your API request will appear in JSON format, as shown below.Accessing the counts endpoint
With the counts endpoint, we’ll retrieve the number of Posts originating from the @XDevelopers account in English grouped byday.
- cURL
- cURL example
-
Username
<USERNAME>e.g.email@domain.com -
Account name
<ACCOUNT-NAME>e.g.john-doe -
Label
<LABEL>e.g.prod -
fromDate and toDate e.g.
"fromDate":"201811010000", "toDate":"201811122359"
Counts endpoint response payload
The payload you get back from your API request will appear in JSON format, as shown below.Referenced articles
Getting started with enterprise Search Posts: Full-Archive API
The enterprise Search Posts: Full-Archive API provides you with Posts since the first one posted in 2006. Posts are matched and sent back to you based on the query you specify in your request. A query is a rule in which you define what the Post you get back should contain. In this tutorial, we will search for Posts originating from the X account @XDevelopers in English. The Posts you get back in your payload can be in a data format, which provides you with the full Post payload, or it can be in a counts format which gives you numerical count data of matched Posts. We will be using cURL to make requests to the data and counts endpoints. You will need the following:- [An enterprise account]https://developer.x.com/en/products/x-api/enterprise
- Your username, password, and account name
- Label associated with your search endpoint, as displayed at console.gnip.com
Accessing the data endpoint
The data endpoint will provide us with the full Post payload of matched Posts. We will use thefrom: and lang: operators to find Posts originating from @XDevelopers in English. For more operators click here.
- cURL
- cURL example
-
Username
<USERNAME>e.g.email@domain.com -
Account name
<ACCOUNT-NAME>e.g.john-doe -
Label
<LABEL>e.g.prod -
fromDate and toDate e.g.
"fromDate":"201802010000", "toDate":"201802282359"
Data endpoint response payload
The payload you get back from your API request will appear in JSON format, as shown below.Accessing the counts endpoint
With the counts endpoint, we’ll retrieve the number of Posts originating from the @XDevelopers account in English grouped byday.
- cURL
- cURL example
-
Username
<USERNAME>e.g.email@domain.com -
Account name
<ACCOUNT-NAME>e.g.john-doe -
Label
<LABEL>e.g.prod -
fromDate and toDate e.g.
"fromDate":"201802010000", "toDate":"201802282359"
Counts endpoint response payload
The payload you get back from your API request will appear in JSON format, as shown below.Referenced articles
Guides
Building search queries
Enterprise operators
Below is a list of all operators supported in X’s enterprise search APIs:- Enterprise 30-day search API
- Enterprise Full-archive search API
Product overview
The enterprise-tier Full-archive Search was launched in August 2015, and the premium-tier version was launched in February 2018. These search products enable customers to immediately access any publicly available Post. With Full-archive Search you submit a single query and receive a response in classic RESTful fashion. Full-archive Search implements (up to) 500-Posts-per-response pagination, and supports up to a 60-requests-per-minute (rpm) rate-limit for premium, 120 rpm for enterprise. Given these details, Full-archive Search can be used to rapidly retrieve Posts, and at large scale using concurrent requests. Unlike Historical PowerTrack, whose archive is based on a set of Post flat-files on disk, the Full-archive Search Post archive is much like an on-line database. As with all databases, it supports making queries on its contents. It also makes use of an index to enable high-performance data retrieval. With Full-archive search endpoints, the querying language is made up of PowerTrack Operators, and these Operators each correspond to a Post JSON attribute that is indexed. Also, like Historical PowerTrack, there are Post attributes that are current to the time a query is made. For example, if you are using Search API to access a Post posted in 2010 today, the user’s profile description, account ‘home’ location, display name, and Post metrics for Favorites and Retweet counts will be updated to today’s values and not what they were in 2010.Metadata timelines
Below is a timeline of when Full-archive search endpoint Operators begin matching. In some cases Operator matching began well after a ‘communication convention’ became commonplace on X. For example, @Replies emerged as a user convention in 2006, but did not become a first-class object or event with ‘supporting’ JSON until early 2007. Accordingly, matching on @Replies in 2006 requires an examination of the Post body, rather than relying on theto: and in_reply_to_status_id: PowerTrack Operators.
The details provided here were generated using Full-Archive Search (a product of hundreds of searches). This timeline is not 100% complete or precise. If you identify another filtering/metadata “born on date” fundamental to your use-case, please let us know.
Note that the underlying Search index is subject to being rebuilt. Accordingly, these timeline details are subject to change.
2006
- March 26 -
lang:. An example of Post metadata being backfilled while generating the Search index. - July 13 -
has:mentionsbegins matching. - October 6 -
has:symbols. slang). - October 26 -
has:linksbegins matching. - November 23 -
has:hashtagsbegins matching.
2007
- January 30 - First first-class @reply (in_reply_to_user_id),
reply_to_status_id:begins matching. - August 23 - Hashtags emerge as a common convention for organizing topics and conversations. First real use a week later.
2009
- May 15 -
is:retweet. Note that this Operator starts matching with the ‘beta’ release of official Retweets and its “Via @’ pattern. During this beta period, the Post verb is ‘post’ and the original Post is not included in the payload. - August 13 - Final version of official Retweets is released with “RT @” pattern, a verb set to ‘share’, and the ‘retweet_status’ attribute containing the original Post (thus approximately doubling the JSON payload size).
2010
- March 6 -
has:geo,bounding_box:andpoint_radius:geo Operators begin matching. - August 28 -
has:videos(Until February 2015, this Operator matches on Posts with links to select video hosting sites such as youtube.com, vimeo.com, and vivo.com).
2011
- July 20 -
has:mediaandhas:imagesbegin matching. Native photos officially announced August 9, 2010.
2014
- December 3 - (Approximately) Some Enhanced URL metadata with HTML title and description begins in payloads. Enhanced metadata more fully emerged in May 2016.
2015
- February 10 -
has:videosmatches on ‘native’ X videos. - February 17 -
has:profile_geo,profile_country:,profile_region:,profile_locality:Profile Geo Operators begin matching. - February 17 -
place_country:andplace:Post geo Operators begin matching.
2016
- May 1 - Enhanced URL metadata more fully available, and was officially announced as part of the Gnip 2.0 launch in August 2016. No associated Operators for these metadata with Search APIs.
2017
- February 22 - Poll metadata become available in enriched native format. No associated Operators for these metadata.
2022
- September 27 - All Post objects created since this date have Edited Post metadata available. All Enterprise endpoints that provide Post objects were updated to provide this metadata starting on this date. The edit metadata provided includes edit_history and edit_controls objects. These metadata will not be returned for Posts that were created before September 27, 2022. Currently, there are no Enterprise Operators available that match these metadata. To learn more about Edit Post metadata, check out the Edit Posts fundamentals page.
2022
- September 29 - All Post objects created since this date have Edited Post metadata available. All Enterprise endpoints that provide Post objects were updated to provide this metadata starting on this date. The edit metadata provided includes edit_history and edit_controls objects. These metadata will not be returned for Posts that were created before September 27, 2022. Currently, there are no Enterprise Operators available matching these metadata. To learn more about Edit Post metadata, check out the Edit Posts fundamentals page.
Filtering tips
Given all the above timeline information, it is clear that there are a lot of details to consider when writing Search APIs filters. There are two key things to consider:- Some metadata have ‘born-on’ dates so filters can result in false negatives. Such searches include Operators reliant on metadata that did not exist for all of part of the search period. For example, if you are searching for Posts with the
has:imagesOperator, you will not have any matches for periods before July 2011. That is because that Operator matches on native photos (attached to a Post using the X user-interface). For a more complete data set of photo-sharing Posts, filters for before July 2011 would need to contain rule clauses that match on common URLs for photo hosting. - Some metadata has been backfilled with metadata from a time after the X was posted.
- X Profiles
- Original or shared Posts
- Post language classification
- Geo-referencing Posts
- Shared links media
X Profiles
The Search APIs serves historical Posts with the user profile data set as it is at the time of retrieval. If you request a Post from 2014, the user’s profile metadata will reflect how it exists at query-time.Original Posts and Retweets
The PowerTrack_is:retweet_ Operator enables users to either include or exclude Retweets. Users of this Operator need to have two strategies for Retweet matching (or not matching) for data before August 2009. Before August 2009, the Post message itself needs to be checked, using exact phrase matching, for matches on the “@RT ” pattern (Actually, if you are filtering on Retweets from between May-August 2009, the “Via @” pattern should be included). For periods after August 2009, the is:retweet Operator is available.
Post language classifications
For filtering on a Post’s language classification, X’s historical products are quite different. When the Search archive was built, all Posts were backfilled with the X language classification. Therefore the lang: Operator is available for the entire Post archive.Geo-referencing Posts
There are three primary ways to geo-reference Posts:- Geographical references in Post message. Matching on geographic references in the Post message, while often the most challenging method since it depends on local knowledge, is an option for the entire Post archive. Here is an example geo-referenced match from 2006 for the San Francisco area based on a ‘golden gate’ filter.
-
Posts geo-tagged by the user. With the search APIs the ability to start matching on Posts with some Geo Operators started in March 2010, and with others in February 2015:
- March 6, 2010:
has:geo,bounding_box:andpoint_radius: - February 17, 2015:
place_country:andplace:
- March 6, 2010:
-
Account profile ‘home’ location set by the user. Profile Geo Operators are available in both Historical PowerTrack and the Search APIs. With the Search APIs, these Profile Geo metadata is available starting in February 2015. For Posts posted before Profile Geo metadata became available, the
bio_location:Operator is available which can be used to match on non-normalized user input.
Shared links and media
In March 2012, the expanded URL enrichment was introduced. Before this time, the Post payloads included only the URL as provided by the user. So, if the user included a shortened URL it can be challenging to match on (expanded) URLs of interest. With the Search APIs, these metadata are available starting in March 2012. In July 2016, the enhanced URL enrichment was introduced. This enhanced version provides a web site’s HTML title and description in the Post payload, along with Operators for matching on those. These metadata begin emerging in December 2014. In September 2016 X introduced ‘native attachments’ where a trailing shared link is not counted against the 140 Post character limit. Both URL enrichments still apply to these shared links. Here are when related Search Operators begin matching:- 2006 October 26 -
has:links - 2011 July 20 -
has:imagesandhas:media - 2011 August -
url:with the Expanded URLs enrichment As early as September 2006(url:"spotify.com" OR url:gnip OR url:microsoft OR url:google OR url:youtube)matches http://x.com/Adam/statuses/16602, even though there is no urls[] metadata in twitter_entities and gnip objects. “youtube.com” is an example of message content that, without any urls[] metadata, matches url:youtube. - 2015 February 10 -
has:videosfor native videos. Between 2010/08/28 and 2015/02/10, this Operator matches on Posts with links to select video hosting sites such as youtube.com, vimeo.com, and vivo.com. - 2016 May 1 -
url_title:andurl_description:, based on the Enhanced URLs enrichment, generally available. First Enhanced URL metadata began appearing in December 2014.
Frequently asked questions(FAQ)
General Search Post API questions
The number of Posts I receive with the data endpoint doesn't match the number of Posts identified by the counts endpoint. Why is this the case?
The number of Posts I receive with the data endpoint doesn't match the number of Posts identified by the counts endpoint. Why is this the case?
I didn't receive a Post that should match my query. Why?
I didn't receive a Post that should match my query. Why?
- the Post you expected to see is from a protected account
- because the data endpoint accounts for all compliance events (meaning that deleted Posts, scrubbed geos, etc. will not be included in the response).
My query matched a Post but includes a keyword that I negated. Why is this happening?
My query matched a Post but includes a keyword that I negated. Why is this happening?
Are there any libraries that I can use to get started using the Search Post APIs?
Are there any libraries that I can use to get started using the Search Post APIs?
- Tweepy - good for using the standard search/Posts product (Python)
- X API - good for using the standard Search Post APIs (Python)
- Search Posts Python and Search Posts Ruby - two good tools that can be used for enterprise (and v2!) Search Post APIs
Will I ever receive less volume of Posts than the value I set as the `maxResults` in my request to the data endpoint?
Will I ever receive less volume of Posts than the value I set as the `maxResults` in my request to the data endpoint?
maxResults or after 30 days.For example, if you have 800 Posts in a given 30 day period, you will have to make two requests to pull the complete results; because the maximum number of Posts that can be returned per request is 500 (maxResults). And if you just have 400 Posts in month one, and then 100 Posts in month two, you will also have to use two requests to pull the full results; because pagination takes place after a period of 30 days even if the first request returns less than the specified maxResults Posts.In what order are the matching Posts returned?
In what order are the matching Posts returned?
fromDate initially requested.How do Edit Posts impact my usage and billing?
How do Edit Posts impact my usage and billing?
EnterpriseI'm interested in learning more about the pricing of the enterprise Search Post API and in applying for this offering. How can I do this?
I'm interested in learning more about the pricing of the enterprise Search Post API and in applying for this offering. How can I do this?
How do I build a rule set that matches my use case?
How do I build a rule set that matches my use case?
- Please refer to our enterprise Search Post APIs documentation here
- Useful information on rules and filering can be found here
- Useful information for using the data endpoint can be found here
- Useful information for using the counts endpoint can be found here
- A list of available operators can be found here
I have exceeded my request caps/limits for the month, but I need to access more data - what can I do?
I have exceeded my request caps/limits for the month, but I need to access more data - what can I do?
Error troubleshooting guide
Code 404 - Not Found- Please ensure you are using the right parameters for each endpoint (e.g. the
bucketsfield can only be used with the counts endpoint, not the data endpoint) - Please double check the
:product:account_nameand:labelfields are correct. You can find your:labelfield in the GNIP Console (enterprise customers only).
API Reference
Enterprise search APIs
There are two enterprise search APIs:- 30-Day Search API - provides Tweets posted with the last 30 days.
- Full-Archive Search API - provides Tweets from as early as 2006, starting with the first Tweet posted in March 2006.
- Methods for requesting Tweet data and counts
- Authentication
- Pagination
- API request parameters and example requests
- API response JSON payloads and example responses
- HTTP response codes
Methods
The base URI for enterprise search ishttps://gnip-api.x.com/search/.
:productindicates the search endpoint you are making requests to, either30dayorfullarchive.:account_nameis the (case-sensitive) name associated with your account, as displayed at console.gnip.com:labelis the (case-sensitive) label associated with your search endpoint, as displayed at console.gnip.com
- Data endpoint: https://gnip-api.x.com/search/30day/accounts/TwitterDev/prod.json
- Counts endpoint: https://gnip-api.x.com/search/30day/accounts/TwitterDev/prod/counts.json
:product, :account_name, and :label. To use these examples, be sure to update the URLs with your details.
Authentication
All requests to the enterprise search APIs must use HTTP Basic Authentication, constructed from a valid email address and password combination used to log into your account at https://console.gnip.com. Credentials must be passed as the Authorization header for each request.Request/response behavior
Using thefromDate and toDate parameters, you can request any time period that the API supports. The 30-Day search API provides Tweets from the most recent 31 days (even though referred to as the ‘30-Day’ API, it makes 31 days available to enable users to make complete-month requests). The Full-Archive search API provides Tweets back to the very first tweet (March 21, 2006). However, a single response will be limited to the lesser of your specified ‘maxResults’ or 31 days. If matching data or your time range exceeds your specified maxResults or 31 days, you will receive a ‘next’ token which you should use to paginate through the remainder of your specified time range.
For example, say you are using Full-Archive search and want all Tweets matching your query from January 1, 2017 to June 30, 2017. You will specify that full six-month time period in your request using the fromDate and toDate parameters. The search API will respond with the first ‘page’ of Tweets, with the number of Tweets matching your maxResults parameter (which defaults to 100). Assuming there are more Tweets (and there most likely will be more), the API will also provide a ‘next’ token that enables you to make a request for the next ‘page’ of data. This process is repeated until the API does not return a ‘next’ token. See the next section for more details.
Pagination
When making both data and count requests it is likely that there is more data than can be returned in a single response. When that is the case the response will include a ‘next’ token. The ‘next’ token is provided as a root-level JSON attribute. Whenever a ‘next’ token is provided, there is additional data to retrieve so you will need to keep making API requests. Note: The ‘next’ token behavior differs slightly for data and counts requests, and both are described below with example responses provided in the API Reference section.Data pagination
Requests for data will likely generate more data than can be returned in a single response. Each data request includes a parameter that sets the maximum number of Tweets to return per request. ThismaxResults parameter defaults to 100 and can be set to a range of 10-500. If your query matches more Tweets than the ‘maxResults’ parameter used in the request, the response will include a ‘next’ token (as a root-level JSON attribute). This ‘next’ token is used in the subsequent request to retrieve the next portion of the matching Tweets for that query (i.e. the next ‘page”). Next tokens will continue to be provided until you have reached the last ‘page’ of results for that query when no ‘next’ token is provided.
To request the next ‘page’ of data, you must make the exact same query as the original, including query, toDate, and fromDate parameters, if used, and also include a ‘next’ request parameter set to the value from the previous response. This can be utilized with either a GET or POST request. However, the ‘next’ parameter must be URL encoded in the case of a GET request.
You can continue to pass in the ‘next’ element from your previous query until you have received all Tweets from the time period covered by your query. When you receive a response that does not include a ‘next’ element, it means that you have reached the last page and no additional data is available for the specified query and time range.
Counts pagination
The ‘counts’ endpoint provides Tweet volumes associated with a query on either a daily, hourly, or per-minute basis. The ‘counts’ API endpoint will return a timestamped array of counts for a maximum of a 31-day payload of counts. If you request more than 31 days of counts you will be provided a ‘next’ token. As with the data ‘next’ tokens, you must make the exact same query as the original and also include a ‘next’ request parameter set to the value from the previous response. Beyond requesting more than 31 days of counts, there is another scenario when a ‘next’ token is provided. For higher volume queries, there is the potential that the generation of counts will take long enough to trigger a response timeout. When this occurs you will receive less than 31 days of counts but will be provided a ‘next’ token in order to continue making requests for the entire payload of counts. Important: Timeouts will only issue full “buckets” - so 2.5 days would result in 2 full day “buckets”.Additional notes
- When using a fromDate or toDate in a search request, you will only get results from within your time range. When you reach the last group of results within your time range, you will not receive a ‘next’ token.
- The ‘next’ element can be used with any maxResults value between 10-500 (with a default value of 100). The maxResults determines how many Tweets are returned in each response, but does not prevent you from eventually getting all results.
- The ‘next’ element does not expire. Multiple requests using the same ‘next’ query will receive the same results, regardless of when the request is made.
- When paging through results using the ‘next’ parameter, you may encounter duplicates at the edges of the query. Your application should be tolerant of these.
Data endpoint
POST /search/:product/:label
Endpoint pattern:
This endpoint returns data for the specified query and time period. If a time period is not specified the time parameters will default to the last 30 days. Note: This functionality can also be accomplished using a GET request, instead of a POST, by encoding the parameters described below into the URL.Data request parameters
Additional details
Example data requests and responses
Example POST request
- Request parameters in a POST request are sent via a JSON-formatted body, as shown below.
- All portions of the PowerTrack rule being queried for (e.g. keywords, other operators like bounding_box:) should be placed in the ‘query’ parameter.
- Do not split portions of the rule out as separate parameters in the query URL.
Example GET request
- Request parameters in a GET request are encoded into the URL, using standard URL encoding.
- All portions of the PowerTrack rule being queried for (e.g. keywords, other operators like bounding_box:) should be placed in the ‘query’ parameter.
- Do not split portions of the rule out as separate parameters in the query URL.
Example data responses
Note that for Tweets created starting September 29, 2022, Tweet objects will include Tweet edit metadata that describes its edit history. See the “Edit Tweets” fundamentals page for more details. Below is an example response to a data query. This example assumes that there were more than ‘maxResults’ Tweets available so a ‘next’ token is provided for subsequent requests. If ‘maxResults’ or fewer Tweets are associated with your query, no ‘next’ token would be included in the response. The value of the ‘next’ element will change with each query and should be treated as an opaque string. The ‘next’ element will look like the following in the response body:Counts endpoint
/search/:stream/counts
Endpoint pattern:
/search/fullarchive/accounts/:account_name/:label/counts.json
This endpoint returns counts (data volumes) data for the specified query. If a time period is not specified the time parameters will default to the last 30 days. Data volumes are returned as a timestamped array on either daily, hourly (default), or by the minute.
Note: This functionality can also be accomplished using a GET request, instead of a POST, by encoding the parameters described below into the URL.
Counts request parameters
Additional details
Example counts requests and responses
Example POST request
- Request parameters in a POST request are sent via a JSON-formatted body, as shown below.
- All portions of the PowerTrack rule being queried for (e.g. keywords, other operators like bounding_box:) should be placed in the ‘query’ parameter.
- Do not split portions of the rule out as separate parameters in the query URL.
Example GET request
- Request parameters in a GET request are encoded into the URL, using standard URL encoding
- All portions of the PowerTrack rule being queried for (e.g. keywords, other operators like bounding_box:) should be placed in the ‘query’ parameter
- Do not split portions of the rule out as separate parameters in the query URL