-
Notifications
You must be signed in to change notification settings - Fork 26
searchAllTweets(query_fields_expansions_endTime_startTime_maxResults_nextToken_sinceId_untilId_)
daneden edited this page Jan 22, 2022
·
1 revision
This endpoint is only available to those users who have been approved for Academic Research access.
public func searchAllTweets(query: String,
fields: Set<Tweet.Field> = [],
expansions: [Tweet.Expansions] = [],
endTime: Date? = nil,
startTime: Date? = nil,
maxResults: Int = 10,
nextToken: String? = nil,
sinceId: Tweet.ID? = nil,
untilId: Tweet.ID? = nil
)
Equivalent to GET /2/tweets/search/all
The full-archive search endpoint returns the complete history of public Tweets matching a search query; since the first Tweet was created March 26, 2006.
- query: One query for matching Tweets. You can learn how to build this query by reading Twitter's build a query guide. If you have Essential or Elevated access, you can use the Basic operators when building your query and can make queries up to 512 characters long. If you have been approved for Academic Research access, you can use all available operators and can make queries up to 1,024 characters long.
- fields: Any additional fields to include on returned objects
- expansions: Objects and their corresponding fields that should be expanded in the
includes
property - endTime: Used with
startTime
. 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 before end_time will be returned by default. If not specified, end_time will default to [now - 30 seconds]. - startTime: 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.
- maxResults: The maximum number of search results to be returned by a request. A number between 10 and 100. By default, a request response will return 10 results.
- 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, and should not be modified.
- sinceId: 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 a
startTime
parameter, onlysinceId
will be used. - untilId: Returns results with a Tweet ID less than (that is, older than) the specified ID. The ID specified is exclusive and responses will not include it.
A response object containing an array of Tweets matching the search query, any requested expansions, and a meta object with information for further pagination
Generated at 2022-11-07T15:07:20+0000 using swift-doc 1.0.0-rc.1.
Types
- BlockResponse
- BookmarkResponse
- CreatedListResponse
- DeleteResponse
- ErrorDetail
- FilteredStreamRule
- FilteredStreamRuleMeta
- FilteredStreamRuleMeta.Summary
- FollowResponse
- Geo
- Geo.Coordinates
- GeoJSON
- GeoJSONType
- HiddenResponse
- LikeResponse
- List
- List.Expansions
- List.Includes
- ListMembershipResponse
- Media
- Media.Metrics
- Media.PublicMetrics
- Media.Variant
- MediaCategory
- MediaType
- MediaUploadResponse
- MediaUploadResponse.MediaProcessingInfo
- MediaUploadResponse.MediaProcessingInfo.ProcessingError
- MediaUploadResponse.MediaProcessingInfo.State
- MentionEntity
- Meta
- MutableFilteredStreamRule
- MutableMedia
- MutablePoll
- MutableTweet
- MutableTweet.Reply
- MuteResponse
- OAuth2Scope
- OAuth2User
- OAuthCredentials
- PinnedResponse
- Place
- Poll
- Poll.Option
- Poll.VotingStatus
- PostTweetResponse
- RetweetResponse
- SearchSpacesState
- Space
- Space.Expansions
- Space.Includes
- TagEntity
- Topic
- Topic.Field
- Tweet
- Tweet.AnnotationEntity
- Tweet.Attachments
- Tweet.Entities
- Tweet.Expansions
- Tweet.Includes
- Tweet.NonPublicMetrics
- Tweet.OrganicMetrics
- Tweet.PromotedMetrics
- Tweet.PublicMetrics
- Tweet.ReferencedTweet
- Tweet.ReferencedTweet.ReferenceType
- Tweet.ReplyAudience
- Tweet.URLEntity
- TweetExclusion
- Twift.Authentication
- Twift.AuthenticationType
- Twift.AuthenticationTypeRepresentation
- TwiftError
- TwitterAPIData
- TwitterAPIDataAndIncludes
- TwitterAPIDataAndMeta
- TwitterAPIDataIncludesAndMeta
- TwitterAPIError
- UpdatedListResponse
- User
- User.DescriptionEntity
- User.Entities
- User.Expansions
- User.Includes
- User.URLEntity
- User.URLEntityDetails
- User.UserProfileMetrics
- WithheldInformation
- WithheldInformation.Scope
Global Variables
Global Functions
- addAltText(to:text:)
- addBookmark(_:userId:)
- addListMember(_:to:)
- authenticateUser(clientId:redirectUri:scope:presentationContextProvider:)
- blockUser(sourceUserId:targetUserId:)
- checkMediaUploadSuccessful(_:)
- createList(name:description:isPrivate:)
- deleteBookmark(_:userId:)
- deleteList(_:)
- deleteListMember(_:from:)
- deleteTweet(_:)
- filteredStream(fields:expansions:backfillMinutes:)
- followList(_:userId:)
- followUser(sourceUserId:targetUserId:)
- getBlockedUsers(for:fields:expansions:paginationToken:maxResults:)
- getBookmarks(for:fields:expansions:paginationToken:maxResults:)
- getFilteredStreamRules(ids:)
- getFollowedLists(_:fields:expansions:paginationToken:maxResults:)
- getFollowers(_:fields:expansions:paginationToken:maxResults:)
- getFollowing(_:fields:expansions:paginationToken:maxResults:)
- getLikedTweets(for:fields:expansions:paginationToken:maxResults:)
- getLikingUsers(for:fields:expansions:paginationToken:maxResults:)
- getList(_:fields:expansions:)
- getListFollowers(_:fields:expansions:paginationToken:maxResults:)
- getListMembers(for:fields:expansions:paginationToken:maxResults:)
- getListMemberships(for:fields:expansions:paginationToken:maxResults:)
- getListTweets(_:fields:expansions:paginationToken:maxResults:)
- getMe(fields:expansions:)
- getMutedUsers(for:fields:expansions:paginationToken:maxResults:)
- getPinnedLists(_:fields:expansions:)
- getSpace(_:fields:expansions:)
- getSpaceBuyers(_:fields:expansions:)
- getSpaceTweets(_:fields:expansions:)
- getSpaces(_:fields:expansions:)
- getSpacesByCreatorIds(_:fields:expansions:)
- getTweet(_:fields:expansions:)
- getTweets(_:fields:expansions:)
- getUser(_:fields:expansions:)
- getUserBy(username:fields:expansions:)
- getUserOwnedLists(_:fields:expansions:paginationToken:maxResults:)
- getUsers(_:fields:expansions:)
- getUsersBy(usernames:fields:expansions:)
- hideReply(_:)
- likeTweet(_:userId:)
- modifyFilteredStreamRules(add:delete:dryRun:)
- muteUser(sourceUserId:targetUserId:)
- pinList(_:userId:)
- postTweet(_:)
- quoteTweets(for:fields:expansions:paginationToken:maxResults:)
- refreshOAuth2AccessToken(onlyIfExpired:)
- retweet(_:userId:)
- retweets(for:fields:expansions:paginationToken:maxResults:)
- reverseChronologicalTimeline(_:fields:expansions:startTime:endTime:exclude:sinceId:untilId:paginationToken:maxResults:)
- searchAllTweets(query:fields:expansions:endTime:startTime:maxResults:nextToken:sinceId:untilId:)
- searchRecentTweets(query:fields:expansions:endTime:startTime:maxResults:nextToken:sinceId:untilId:)
- searchSpaces(query:fields:expansions:state:)
- unblockUser(sourceUserId:targetUserId:)
- unfollowList(_:userId:)
- unfollowUser(sourceUserId:targetUserId:)
- unhideReply(_:)
- unlikeTweet(_:userId:)
- unmuteUser(sourceUserId:targetUserId:)
- unpinList(_:userId:)
- unretweet(_:userId:)
- updateList(id:name:description:isPrivate:)
- upload(mediaData:mimeType:category:progress:)
- userMentions(_:fields:expansions:startTime:endTime:exclude:sinceId:untilId:paginationToken:maxResults:)
- userTimeline(_:startTime:endTime:exclude:sinceId:untilId:fields:expansions:paginationToken:maxResults:)
- volumeStream(fields:expansions:backfillMinutes:)