search abstract method

Future<TwitterResponse<List<SpaceData>, SpaceMeta>> search({
  1. required String query,
  2. SpaceState? state,
  3. List<SpaceExpansion>? expansions,
  4. List<UserField>? userFields,
  5. List<SpaceField>? spaceFields,
  6. List<TopicField>? topicFields,
})

Return live or scheduled Spaces matching your specified search terms.

This endpoint performs a keyword search, meaning that it will return Spaces that are an exact case-insensitive match of the specified search term.

The search term will match the original title of the Space.

Parameters

  • query: Your search term. This can be any text (including mentions and Hashtags) present in the title of the Space.

  • state: Determines the type of results to return. This endpoint returns all Spaces by default. Use live to only return live Spaces or scheduled to only return upcoming Spaces.

  • expansions: Expansions enable you to request additional data objects that relate to the originally returned Space. Submit a list of desired expansions in a comma-separated list. The ID that represents the expanded data object will be included directly in the Space data object, but the expanded object metadata will be returned within the includes response object, and will also include the ID so that you can match this data object to the original Space object.

  • userFields: This fields parameter enables you to select which specific user fields will deliver in each returned Space. While the user ID will be located in the original Space object, you will find this ID and all additional user fields in the includes data object.

  • spaceFields: This fields parameter enables you to select which specific Space fields will deliver in each returned Space.

  • topicFields: This fields parameter enables you to select which specific topic metadata in each returned Space topic object, if the creator of the Space set one or more topics.

Endpoint Url

Authentication Methods

  • OAuth 2.0 Authorization Code with PKCE
  • OAuth 2.0 App-only

Required Scopes

  • tweet.read
  • users.read
  • space.read

Rate Limits

  • User rate limit (OAuth 2.0 user Access Token): 300 requests per 15-minute window per each authenticated user

  • 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<SpaceData>, SpaceMeta>> search({
  required String query,
  SpaceState? state,
  List<SpaceExpansion>? expansions,
  List<UserField>? userFields,
  List<SpaceField>? spaceFields,
  List<TopicField>? topicFields,
});