Requests#

All request types grouped by the major tag.

Bookmarks#

All methods related to bookmarks.

class tweetkit.requests.bookmarks.Bookmarks(client)#

Bases: object

Endpoints related to retrieving, managing bookmarks of a user

get_users_id_bookmarks(id, max_results=None, pagination_token=None, tweet_fields=None, expansions=None, media_fields=None, poll_fields=None, user_fields=None, place_fields=None, data=None, **kwargs)#

Bookmarks by User.

Returns Tweet objects that have been bookmarked by the requesting User.

Parameters:
  • id (string) – The ID of the authenticated source User for whom to return results.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get the next ‘page’ of results.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

post_users_id_bookmarks(data, id, **kwargs)#

Add Tweet to Bookmarks.

Adds a Tweet (ID in the body) to the requesting User’s (in the path) bookmarks.

Parameters:
  • data (dict) – The request body.

  • id (string) – The ID of the authenticated source User for whom to add bookmarks.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_bookmarks_delete(id, tweet_id, data=None, **kwargs)#

Remove a bookmarked Tweet.

Removes a Tweet from the requesting User’s bookmarked Tweets.

Parameters:
  • id (string) – The ID of the authenticated source User whose bookmark is to be removed.

  • tweet_id (string) – The ID of the Tweet that the source User is removing from bookmarks.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

Compliance#

All methods related to compliance.

class tweetkit.requests.compliance.Compliance(client)#

Bases: object

Endpoints related to keeping Twitter data in your systems compliant

create_batch_compliance_job(data, **kwargs)#

Create compliance job.

Creates a compliance for the given job type.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

get_batch_compliance_job(id, compliance_job_fields=None, data=None, **kwargs)#

Get Compliance Job.

Returns a single Compliance Job by ID.

Parameters:
  • id (string) – The ID of the Compliance Job to retrieve.

  • compliance_job_fields (list[string], optional) – A comma separated list of ComplianceJob fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

get_tweets_compliance_stream(partition, backfill_minutes=None, start_time=None, end_time=None, data=None, **kwargs)#

Tweets Compliance stream.

Streams 100% of compliance data for Tweets.

Parameters:
  • partition (integer) – The partition number.

  • backfill_minutes (integer, optional) – The number of minutes of backfill requested.

  • start_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweet Compliance events will be provided.Example: 2021-02-01T18:40:40.000Z.

  • end_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweet Compliance events will be provided.Example: 2021-02-14T18:40:40.000Z.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

get_users_compliance_stream(partition, backfill_minutes=None, start_time=None, end_time=None, data=None, **kwargs)#

Users Compliance stream.

Streams 100% of compliance data for Users.

Parameters:
  • partition (integer) – The partition number.

  • backfill_minutes (integer, optional) – The number of minutes of backfill requested.

  • start_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the User Compliance events will be provided.Example: 2021-02-01T18:40:40.000Z.

  • end_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the User Compliance events will be provided.Example: 2021-02-01T18:40:40.000Z.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

list_batch_compliance_jobs(type, status=None, compliance_job_fields=None, data=None, **kwargs)#

List Compliance Jobs.

Returns recent Compliance Jobs for a given job type and optional job status.

Parameters:
  • type (string) – Type of Compliance Job to list.

  • status (string, optional) – Status of Compliance Job to list.

  • compliance_job_fields (list[string], optional) – A comma separated list of ComplianceJob fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

General#

All methods related to general.

class tweetkit.requests.general.General(client)#

Bases: object

Miscellaneous endpoints for general API functionality

get_open_api_spec(data=None, **kwargs)#

Returns the OpenAPI Specification document.

Full OpenAPI Specification in JSON format. (See OAI/OpenAPI-Specification).

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

Lists#

All methods related to lists.

class tweetkit.requests.lists.Lists(client)#

Bases: object

Endpoints related to retrieving, managing Lists

get_user_list_memberships(id, max_results=None, pagination_token=None, list_fields=None, expansions=None, user_fields=None, data=None, **kwargs)#

Get a User’s List Memberships.

Get a User’s List Memberships.

Parameters:
  • id (string) – The ID of the User to lookup.Example: 2244994945.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get a specified ‘page’ of results.

  • list_fields (list[string], optional) – A comma separated list of List fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

list_add_member(id, data=None, **kwargs)#

Add a List member.

Causes a User to become a member of a List.

Parameters:
  • id (string) – The ID of the List for which to add a member.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

list_id_create(data=None, **kwargs)#

Create List.

Creates a new List.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

list_id_delete(id, data=None, **kwargs)#

Delete List.

Delete a List that you own.

Parameters:
  • id (string) – The ID of the List to delete.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

list_id_get(id, list_fields=None, expansions=None, user_fields=None, data=None, **kwargs)#

List lookup by List ID.

Returns a List.

Parameters:
  • id (string) – The ID of the List.

  • list_fields (list[string], optional) – A comma separated list of List fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

list_id_update(id, data=None, **kwargs)#

Update List.

Update a List that you own.

Parameters:
  • id (string) – The ID of the List to modify.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

list_remove_member(id, user_id, data=None, **kwargs)#

Remove a List member.

Causes a User to be removed from the members of a List.

Parameters:
  • id (string) – The ID of the List to remove a member.

  • user_id (string) – The ID of User that will be removed from the List.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

list_user_follow(id, data=None, **kwargs)#

Follow a List.

Causes a User to follow a List.

Parameters:
  • id (string) – The ID of the authenticated source User that will follow the List.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

list_user_owned_lists(id, max_results=None, pagination_token=None, list_fields=None, expansions=None, user_fields=None, data=None, **kwargs)#

Get a User’s Owned Lists.

Get a User’s Owned Lists.

Parameters:
  • id (string) – The ID of the User to lookup.Example: 2244994945.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get a specified ‘page’ of results.

  • list_fields (list[string], optional) – A comma separated list of List fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

list_user_pin(data, id, **kwargs)#

Pin a List.

Causes a User to pin a List.

Parameters:
  • data (dict) – The request body.

  • id (string) – The ID of the authenticated source User that will pin the List.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

list_user_pinned_lists(id, list_fields=None, expansions=None, user_fields=None, data=None, **kwargs)#

Get a User’s Pinned Lists.

Get a User’s Pinned Lists.

Parameters:
  • id (string) – The ID of the authenticated source User for whom to return results.

  • list_fields (list[string], optional) – A comma separated list of List fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

list_user_unfollow(id, list_id, data=None, **kwargs)#

Unfollow a List.

Causes a User to unfollow a List.

Parameters:
  • id (string) – The ID of the authenticated source User that will unfollow the List.

  • list_id (string) – The ID of the List to unfollow.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

list_user_unpin(id, list_id, data=None, **kwargs)#

Unpin a List.

Causes a User to remove a pinned List.

Parameters:
  • id (string) – The ID of the authenticated source User for whom to return results.

  • list_id (string) – The ID of the List to unpin.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

user_followed_lists(id, max_results=None, pagination_token=None, list_fields=None, expansions=None, user_fields=None, data=None, **kwargs)#

Get User’s Followed Lists.

Returns a User’s followed Lists.

Parameters:
  • id (string) – The ID of the User to lookup.Example: 2244994945.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get a specified ‘page’ of results.

  • list_fields (list[string], optional) – A comma separated list of List fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

Spaces#

All methods related to spaces.

class tweetkit.requests.spaces.Spaces(client)#

Bases: object

Endpoints related to retrieving, managing Spaces

find_space_by_id(id, space_fields=None, expansions=None, user_fields=None, topic_fields=None, data=None, **kwargs)#

Space lookup by Space ID.

Returns a variety of information about the Space specified by the requested ID.

Parameters:
  • id (string) – The ID of the Space to be retrieved.Example: 1YqKDqWqdPLsV.

  • space_fields (list[string], optional) – A comma separated list of Space fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • topic_fields (list[string], optional) – A comma separated list of Topic fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

find_spaces_by_creator_ids(user_ids, space_fields=None, expansions=None, user_fields=None, topic_fields=None, data=None, **kwargs)#

Space lookup by their creators.

Returns a variety of information about the Spaces created by the provided User IDs.

Parameters:
  • user_ids (list[string]) – The IDs of Users to search through.

  • space_fields (list[string], optional) – A comma separated list of Space fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • topic_fields (list[string], optional) – A comma separated list of Topic fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

find_spaces_by_ids(ids, space_fields=None, expansions=None, user_fields=None, topic_fields=None, data=None, **kwargs)#

Space lookup up Space IDs.

Returns a variety of information about the Spaces specified by the requested IDs.

Parameters:
  • ids (list[string]) – The list of Space IDs to return.

  • space_fields (list[string], optional) – A comma separated list of Space fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • topic_fields (list[string], optional) – A comma separated list of Topic fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

search_spaces(query, state=None, max_results=None, space_fields=None, expansions=None, user_fields=None, topic_fields=None, data=None, **kwargs)#

Search for Spaces.

Returns Spaces that match the provided query.

Parameters:
  • query (string) – The search query.Example: crypto.

  • state (string, optional) – The state of Spaces to search for.

  • max_results (integer, optional) – The number of results to return.

  • space_fields (list[string], optional) – A comma separated list of Space fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • topic_fields (list[string], optional) – A comma separated list of Topic fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

space_buyers(id, pagination_token=None, max_results=None, user_fields=None, expansions=None, tweet_fields=None, data=None, **kwargs)#

Retrieve the list of Users who purchased a ticket to the given space.

Retrieves the list of Users who purchased a ticket to the given space.

Parameters:
  • id (string) – The ID of the Space to be retrieved.Example: 1YqKDqWqdPLsV.

  • pagination_token (string, optional) – This parameter is used to get a specified ‘page’ of results.

  • max_results (integer, optional) – The maximum number of results.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

space_tweets(id, max_results=None, tweet_fields=None, expansions=None, media_fields=None, poll_fields=None, user_fields=None, place_fields=None, data=None, **kwargs)#

Retrieve Tweets from a Space.

Retrieves Tweets shared in the specified Space.

Parameters:
  • id (string) – The ID of the Space to be retrieved.Example: 1YqKDqWqdPLsV.

  • max_results (integer, optional) – The number of Tweets to fetch from the provided space. If not provided, the value will default to the maximum of 100.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

Tweets#

All methods related to tweets.

class tweetkit.requests.tweets.Tweets(client)#

Bases: object

Endpoints related to retrieving, searching, and modifying Tweets

add_or_delete_rules(data, dry_run=None, **kwargs)#

Add/Delete rules.

Add or delete rules from a User’s active rule set. Users can provide unique, optionally tagged rules to add. Users can delete their entire rule set or a subset specified by rule ids or values.

Parameters:
  • data (dict) – The request body.

  • dry_run (boolean, optional) – Dry Run can be used with both the add and delete action, with the expected result given, but without actually taking any action in the system (meaning the end state will always be as it was when the request was submitted). This is particularly useful to validate rule changes.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

create_tweet(data, **kwargs)#

Creation of a Tweet.

Causes the User to create a Tweet under the authorized account.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

delete_tweet_by_id(id, data=None, **kwargs)#

Tweet delete by Tweet ID.

Delete specified Tweet (in the path) by ID.

Parameters:
  • id (string) – The ID of the Tweet to be deleted.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

find_tweet_by_id(id, tweet_fields=None, expansions=None, media_fields=None, poll_fields=None, user_fields=None, place_fields=None, data=None, **kwargs)#

Tweet lookup by Tweet ID.

Returns a variety of information about the Tweet specified by the requested ID.

Parameters:
  • id (string) – A single Tweet ID.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

find_tweets_by_id(ids, tweet_fields=None, expansions=None, media_fields=None, poll_fields=None, user_fields=None, place_fields=None, data=None, **kwargs)#

Tweet lookup by Tweet IDs.

Returns a variety of information about the Tweet specified by the requested ID.

Parameters:
  • ids (list[string]) – A comma separated list of Tweet IDs. Up to 100 are allowed in a single request.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

find_tweets_that_quote_a_tweet(id, max_results=None, pagination_token=None, exclude=None, tweet_fields=None, expansions=None, media_fields=None, poll_fields=None, user_fields=None, place_fields=None, data=None, **kwargs)#

Retrieve Tweets that quote a Tweet.

Returns a variety of information about each Tweet that quotes the Tweet specified by the requested ID.

Parameters:
  • id (string) – A single Tweet ID.

  • max_results (integer, optional) – The maximum number of results to be returned.

  • pagination_token (string, optional) – This parameter is used to get a specified ‘page’ of results.

  • exclude (list[string], optional) – The set of entities to exclude (e.g. ‘replies’ or ‘retweets’).

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

get_rules(ids=None, max_results=None, pagination_token=None, data=None, **kwargs)#

Rules lookup.

Returns rules from a User’s active rule set. Users can fetch all of their rules or a subset, specified by the provided rule ids.

Parameters:
  • ids (list[string], optional) – A comma-separated list of Rule IDs.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This value is populated by passing the ‘next_token’ returned in a request to paginate through results.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

get_tweets_firehose_stream(partition, backfill_minutes=None, start_time=None, end_time=None, tweet_fields=None, expansions=None, media_fields=None, poll_fields=None, user_fields=None, place_fields=None, data=None, **kwargs)#

Firehose stream.

Streams 100% of public Tweets.

Parameters:
  • partition (integer) – The partition number.

  • backfill_minutes (integer, optional) – The number of minutes of backfill requested.

  • start_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Tweets will be provided.Example: 2021-02-14T18:40:40.000Z.

  • end_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided.Example: 2021-02-14T18:40:40.000Z.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

get_tweets_sample10_stream(partition, backfill_minutes=None, start_time=None, end_time=None, tweet_fields=None, expansions=None, media_fields=None, poll_fields=None, user_fields=None, place_fields=None, data=None, **kwargs)#

Sample 10% stream.

Streams a deterministic 10% of public Tweets.

Parameters:
  • partition (integer) – The partition number.

  • backfill_minutes (integer, optional) – The number of minutes of backfill requested.

  • start_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Tweets will be provided.Example: 2021-02-14T18:40:40.000Z.

  • end_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided.Example: 2021-02-14T18:40:40.000Z.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

hide_reply_by_id(tweet_id, data=None, **kwargs)#

Hide replies.

Hides or unhides a reply to an owned conversation.

Parameters:
  • tweet_id (string) – The ID of the reply that you want to hide or unhide.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

lists_id_tweets(id, max_results=None, pagination_token=None, tweet_fields=None, expansions=None, media_fields=None, poll_fields=None, user_fields=None, place_fields=None, data=None, **kwargs)#

List Tweets timeline by List ID.

Returns a list of Tweets associated with the provided List ID.

Parameters:
  • id (string) – The ID of the List.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get the next ‘page’ of results.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

sample_stream(backfill_minutes=None, tweet_fields=None, expansions=None, media_fields=None, poll_fields=None, user_fields=None, place_fields=None, data=None, **kwargs)#

Sample stream.

Streams a deterministic 1% of public Tweets.

Parameters:
  • backfill_minutes (integer, optional) – The number of minutes of backfill requested.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

search_stream(backfill_minutes=None, start_time=None, end_time=None, tweet_fields=None, expansions=None, media_fields=None, poll_fields=None, user_fields=None, place_fields=None, data=None, **kwargs)#

Filtered stream.

Streams Tweets matching the stream’s active rule set.

Parameters:
  • backfill_minutes (integer, optional) – The number of minutes of backfill requested.

  • start_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided.Example: 2021-02-01T18:40:40.000Z.

  • end_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided.Example: 2021-02-14T18:40:40.000Z.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

Full archive search counts.

Returns Tweet Counts that match a search query.

Parameters:
  • query (string) – One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length.

  • start_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).

  • end_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).

  • since_id (string, optional) – Returns results with a Tweet ID greater than (that is, more recent than) the specified ID.

  • until_id (string, optional) – Returns results with a Tweet ID less than (that is, older than) the specified ID.

  • next_token (string, optional) – 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.

  • pagination_token (string, optional) – 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.

  • granularity (string, optional) – The granularity for the search counts results.

  • search_count_fields (list[string], optional) – A comma separated list of SearchCount fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

Recent search counts.

Returns Tweet Counts from the last 7 days that match a search query.

Parameters:
  • query (string) – One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length.

  • start_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).

  • end_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).

  • since_id (string, optional) – Returns results with a Tweet ID greater than (that is, more recent than) the specified ID.

  • until_id (string, optional) – Returns results with a Tweet ID less than (that is, older than) the specified ID.

  • next_token (string, optional) – 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.

  • pagination_token (string, optional) – 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.

  • granularity (string, optional) – The granularity for the search counts results.

  • search_count_fields (list[string], optional) – A comma separated list of SearchCount fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

Full-archive search.

Returns Tweets that match a search query.

Parameters:
  • query (string) – One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length.

  • start_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).

  • end_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).

  • since_id (string, optional) – Returns results with a Tweet ID greater than (that is, more recent than) the specified ID.

  • until_id (string, optional) – Returns results with a Tweet ID less than (that is, older than) the specified ID.

  • max_results (integer, optional) – The maximum number of search results to be returned by a request.

  • next_token (string, optional) – 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.

  • pagination_token (string, optional) – 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.

  • sort_order (string, optional) – This order in which to return results.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

Recent search.

Returns Tweets from the last 7 days that match a search query.

Parameters:
  • query (string) – One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length.

  • start_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).

  • end_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).

  • since_id (string, optional) – Returns results with a Tweet ID greater than (that is, more recent than) the specified ID.

  • until_id (string, optional) – Returns results with a Tweet ID less than (that is, older than) the specified ID.

  • max_results (integer, optional) – The maximum number of search results to be returned by a request.

  • next_token (string, optional) – 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.

  • pagination_token (string, optional) – 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.

  • sort_order (string, optional) – This order in which to return results.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_like(id, data=None, **kwargs)#

Causes the User (in the path) to like the specified Tweet.

Causes the User (in the path) to like the specified Tweet. The User in the path must match the User context authorizing the request.

Parameters:
  • id (string) – The ID of the authenticated source User that is requesting to like the Tweet.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_liked_tweets(id, max_results=None, pagination_token=None, tweet_fields=None, expansions=None, media_fields=None, poll_fields=None, user_fields=None, place_fields=None, data=None, **kwargs)#

Returns Tweet objects liked by the provided User ID.

Returns a list of Tweets liked by the provided User ID.

Parameters:
  • id (string) – The ID of the User to lookup.Example: 2244994945.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get the next ‘page’ of results.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_mentions(id, since_id=None, until_id=None, max_results=None, pagination_token=None, start_time=None, end_time=None, tweet_fields=None, expansions=None, media_fields=None, poll_fields=None, user_fields=None, place_fields=None, data=None, **kwargs)#

User mention timeline by User ID.

Returns Tweet objects that mention username associated to the provided User ID.

Parameters:
  • id (string) – The ID of the User to lookup.Example: 2244994945.

  • since_id (string, optional) – The minimum Tweet ID to be included in the result set. This parameter takes precedence over start_time if both are specified.

  • until_id (string, optional) – The maximum Tweet ID to be included in the result set. This parameter takes precedence over end_time if both are specified.Example: 1346889436626259968.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get the next ‘page’ of results.

  • start_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified.Example: 2021-02-01T18:40:40.000Z.

  • end_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified.Example: 2021-02-14T18:40:40.000Z.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_retweets(id, data=None, **kwargs)#

Causes the User (in the path) to retweet the specified Tweet.

Causes the User (in the path) to retweet the specified Tweet. The User in the path must match the User context authorizing the request.

Parameters:
  • id (string) – The ID of the authenticated source User that is requesting to retweet the Tweet.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_timeline(id, since_id=None, until_id=None, max_results=None, pagination_token=None, exclude=None, start_time=None, end_time=None, tweet_fields=None, expansions=None, media_fields=None, poll_fields=None, user_fields=None, place_fields=None, data=None, **kwargs)#

User home timeline by User ID.

Returns Tweet objects that appears in the provided User ID’s home timeline.

Parameters:
  • id (string) – The ID of the authenticated source User to list Reverse Chronological Timeline Tweets of.

  • since_id (string, optional) – The minimum Tweet ID to be included in the result set. This parameter takes precedence over start_time if both are specified.Example: 791775337160081409.

  • until_id (string, optional) – The maximum Tweet ID to be included in the result set. This parameter takes precedence over end_time if both are specified.Example: 1346889436626259968.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get the next ‘page’ of results.

  • exclude (list[string], optional) – The set of entities to exclude (e.g. ‘replies’ or ‘retweets’).

  • start_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified.Example: 2021-02-01T18:40:40.000Z.

  • end_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified.Example: 2021-02-14T18:40:40.000Z.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_tweets(id, since_id=None, until_id=None, max_results=None, pagination_token=None, exclude=None, start_time=None, end_time=None, tweet_fields=None, expansions=None, media_fields=None, poll_fields=None, user_fields=None, place_fields=None, data=None, **kwargs)#

User Tweets timeline by User ID.

Returns a list of Tweets authored by the provided User ID.

Parameters:
  • id (string) – The ID of the User to lookup.Example: 2244994945.

  • since_id (string, optional) – The minimum Tweet ID to be included in the result set. This parameter takes precedence over start_time if both are specified.Example: 791775337160081409.

  • until_id (string, optional) – The maximum Tweet ID to be included in the result set. This parameter takes precedence over end_time if both are specified.Example: 1346889436626259968.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get the next ‘page’ of results.

  • exclude (list[string], optional) – The set of entities to exclude (e.g. ‘replies’ or ‘retweets’).

  • start_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified.Example: 2021-02-01T18:40:40.000Z.

  • end_time (string, optional) – YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified.Example: 2021-02-14T18:40:40.000Z.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • media_fields (list[string], optional) – A comma separated list of Media fields to display.

  • poll_fields (list[string], optional) – A comma separated list of Poll fields to display.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • place_fields (list[string], optional) – A comma separated list of Place fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_unlike(id, tweet_id, data=None, **kwargs)#

Causes the User (in the path) to unlike the specified Tweet.

Causes the User (in the path) to unlike the specified Tweet. The User must match the User context authorizing the request.

Parameters:
  • id (string) – The ID of the authenticated source User that is requesting to unlike the Tweet.

  • tweet_id (string) – The ID of the Tweet that the User is requesting to unlike.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_unretweets(id, source_tweet_id, data=None, **kwargs)#

Causes the User (in the path) to unretweet the specified Tweet.

Causes the User (in the path) to unretweet the specified Tweet. The User must match the User context authorizing the request.

Parameters:
  • id (string) – The ID of the authenticated source User that is requesting to retweet the Tweet.

  • source_tweet_id (string) – The ID of the Tweet that the User is requesting to unretweet.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

Users#

All methods related to users.

class tweetkit.requests.users.Users(client)#

Bases: object

Endpoints related to retrieving, managing relationships of Users

find_my_user(user_fields=None, expansions=None, tweet_fields=None, data=None, **kwargs)#

User lookup me.

This endpoint returns information about the requesting User.

Parameters:
  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

find_user_by_id(id, user_fields=None, expansions=None, tweet_fields=None, data=None, **kwargs)#

User lookup by ID.

This endpoint returns information about a User. Specify User by ID.

Parameters:
  • id (string) – The ID of the User to lookup.Example: 2244994945.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

find_user_by_username(username, user_fields=None, expansions=None, tweet_fields=None, data=None, **kwargs)#

User lookup by username.

This endpoint returns information about a User. Specify User by username.

Parameters:
  • username (string) – A username.Example: TwitterDev.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

find_users_by_id(ids, user_fields=None, expansions=None, tweet_fields=None, data=None, **kwargs)#

User lookup by IDs.

This endpoint returns information about Users. Specify Users by their ID.

Parameters:
  • ids (list[string]) – A list of User IDs, comma-separated. You can specify up to 100 IDs.Example: 2244994945,6253282,12.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

find_users_by_username(usernames, user_fields=None, expansions=None, tweet_fields=None, data=None, **kwargs)#

User lookup by usernames.

This endpoint returns information about Users. Specify Users by their username.

Parameters:
  • usernames (list[string]) – A list of usernames, comma-separated.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

list_get_followers(id, max_results=None, pagination_token=None, user_fields=None, expansions=None, tweet_fields=None, data=None, **kwargs)#

Returns User objects that follow a List by the provided List ID.

Returns a list of Users that follow a List by the provided List ID.

Parameters:
  • id (string) – The ID of the List.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get a specified ‘page’ of results.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

list_get_members(id, max_results=None, pagination_token=None, user_fields=None, expansions=None, tweet_fields=None, data=None, **kwargs)#

Returns User objects that are members of a List by the provided List ID.

Returns a list of Users that are members of a List by the provided List ID.

Parameters:
  • id (string) – The ID of the List.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get a specified ‘page’ of results.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

tweets_id_liking_users(id, max_results=None, pagination_token=None, user_fields=None, expansions=None, tweet_fields=None, data=None, **kwargs)#

Returns User objects that have liked the provided Tweet ID.

Returns a list of Users that have liked the provided Tweet ID.

Parameters:
  • id (string) – A single Tweet ID.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get the next ‘page’ of results.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

tweets_id_retweeting_users(id, max_results=None, pagination_token=None, user_fields=None, expansions=None, tweet_fields=None, data=None, **kwargs)#

Returns User objects that have retweeted the provided Tweet ID.

Returns a list of Users that have retweeted the provided Tweet ID.

Parameters:
  • id (string) – A single Tweet ID.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get the next ‘page’ of results.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_block(data, id, **kwargs)#

Block User by User ID.

Causes the User (in the path) to block the target User. The User (in the path) must match the User context authorizing the request.

Parameters:
  • data (dict) – The request body.

  • id (string) – The ID of the authenticated source User that is requesting to block the target User.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_blocking(id, max_results=None, pagination_token=None, user_fields=None, expansions=None, tweet_fields=None, data=None, **kwargs)#

Returns User objects that are blocked by provided User ID.

Returns a list of Users that are blocked by the provided User ID.

Parameters:
  • id (string) – The ID of the authenticated source User for whom to return results.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get a specified ‘page’ of results.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_follow(id, data=None, **kwargs)#

Follow User.

Causes the User(in the path) to follow, or “request to follow” for protected Users, the target User. The User(in the path) must match the User context authorizing the request.

Parameters:
  • id (string) – The ID of the authenticated source User that is requesting to follow the target User.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_followers(id, max_results=None, pagination_token=None, user_fields=None, expansions=None, tweet_fields=None, data=None, **kwargs)#

Followers by User ID.

Returns a list of Users who are followers of the specified User ID.

Parameters:
  • id (string) – The ID of the User to lookup.Example: 2244994945.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get a specified ‘page’ of results.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_following(id, max_results=None, pagination_token=None, user_fields=None, expansions=None, tweet_fields=None, data=None, **kwargs)#

Following by User ID.

Returns a list of Users that are being followed by the provided User ID.

Parameters:
  • id (string) – The ID of the User to lookup.Example: 2244994945.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get a specified ‘page’ of results.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_mute(id, data=None, **kwargs)#

Mute User by User ID.

Causes the User (in the path) to mute the target User. The User (in the path) must match the User context authorizing the request.

Parameters:
  • id (string) – The ID of the authenticated source User that is requesting to mute the target User.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_muting(id, max_results=None, pagination_token=None, user_fields=None, expansions=None, tweet_fields=None, data=None, **kwargs)#

Returns User objects that are muted by the provided User ID.

Returns a list of Users that are muted by the provided User ID.

Parameters:
  • id (string) – The ID of the authenticated source User for whom to return results.

  • max_results (integer, optional) – The maximum number of results.

  • pagination_token (string, optional) – This parameter is used to get the next ‘page’ of results.

  • user_fields (list[string], optional) – A comma separated list of User fields to display.

  • expansions (list[string], optional) – A comma separated list of fields to expand.

  • tweet_fields (list[string], optional) – A comma separated list of Tweet fields to display.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_unblock(source_user_id, target_user_id, data=None, **kwargs)#

Unblock User by User ID.

Causes the source User to unblock the target User. The source User must match the User context authorizing the request.

Parameters:
  • source_user_id (string) – The ID of the authenticated source User that is requesting to unblock the target User.

  • target_user_id (string) – The ID of the User that the source User is requesting to unblock.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_unfollow(source_user_id, target_user_id, data=None, **kwargs)#

Unfollow User.

Causes the source User to unfollow the target User. The source User must match the User context authorizing the request.

Parameters:
  • source_user_id (string) – The ID of the authenticated source User that is requesting to unfollow the target User.

  • target_user_id (string) – The ID of the User that the source User is requesting to unfollow.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator

users_id_unmute(source_user_id, target_user_id, data=None, **kwargs)#

Unmute User by User ID.

Causes the source User to unmute the target User. The source User must match the User context authorizing the request.

Parameters:
  • source_user_id (string) – The ID of the authenticated source User that is requesting to unmute the target User.

  • target_user_id (string) – The ID of the User that the source User is requesting to unmute.

  • data (dict) – The request body.

Notes

For more information, see: here.

Returns:

session – A object with the response data.

Return type:

TwitterStreamResponse or TwitterResponse or Paginator