countAll abstract method
- required String query,
- String? nextToken,
- DateTime? startTime,
- DateTime? endTime,
- String? sinceTweetId,
- String? untilTweetId,
- TweetCountGranularity? granularity,
- ForwardPaging<
List< ? paging,TweetCountData> , TweetCountMeta>
This endpoint is only available to those users who have been approved for Academic Research access.
The full-archive Tweet counts endpoint returns the count of Tweets that match your query from the complete history of public Tweets; since the first Tweet was created March 26, 2006.
The value returned when the paging
callback is specified is
the first object obtained that started the paging process. The value
obtained in the paging process is passed to the paging
callback
function as a PagingEvent
object.
Parameters
-
query
: One query for matching Tweets. You can learn how to build this query by reading a build a query guide. You can use all available operators and can make queries up to 1,024 characters long. -
nextToken
: This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, assuming that your request contains more than 31 days-worth of results, and should not be modified. You can learn more by visiting our page on pagination. -
startTime
: YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest UTC timestamp from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (for example, 12:00:01 includes the first second of the minute). By default, a request will return Tweets from up to 30 days ago if you do not include this parameter. -
endTime
: YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). Used withstartTime
. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (for example, 12:00:01 excludes the first second of the minute). If used withoutstartTime
, Tweets from 30 days beforeendTime
will be returned by default. If not specified,endTime
will default tonow - 30 seconds
. -
sinceTweetId
: Returns results with a Tweet ID greater than (that is, more recent than) the specified ID. The ID specified is exclusive and responses will not include it. If included with the same request as astartTime
parameter, onlysinceTweetId
will be used. -
untilTweetId
: Returns results with a Tweet ID less than (that is, older than) the specified ID. Used withsinceTweetId
. The ID specified is exclusive and responses will not include it. -
granularity
: This is the granularity that you want the time series count data to be grouped by. You can requestminute
,hour
, orday
granularity. The default granularity, if not specified ishour
. -
paging
: If this callback function is specified, paging is performed continuously until certain conditions are met. This paging function is uni-directional, only forward, and allows for safe paging. The response and other metadata obtained when paging is performed is passed to the callback function asPagingEvent
object. So you can get the result of paging fromPagingEvent
object. Also, the direction and continuity of paging can be controlled by returningPaginationControl
object in thepaging
callback function. Please usePaginationControl.next()
to continue paging and move forward. And be sure to returnPaginationControl.stop()
to terminate paging on arbitrary conditions, otherwise paging continues until the next page runs out.
Endpoint Url
Authentication Methods
- OAuth 2.0 App-only
Rate Limits
- App rate limit (OAuth 2.0 App Access Token): 300 requests per 15-minute window shared among all users of your app
Reference
Implementation
Future<TwitterResponse<List<TweetCountData>, TweetCountMeta>> countAll({
required String query,
String? nextToken,
DateTime? startTime,
DateTime? endTime,
String? sinceTweetId,
String? untilTweetId,
TweetCountGranularity? granularity,
ForwardPaging<List<TweetCountData>, TweetCountMeta>? paging,
});