X (Twitter)

Description: Enable agents to interact with X (formerly Twitter).

Author: Arcade

Code: GitHub

Auth: User authorization via the X auth provider

PyPI VersionLicensePython VersionsWheel StatusDownloads

The Arcade X (Twitter) toolkit provides a pre-built set of tools for interacting with X (formerly Twitter). These tools make it easy to build agents and AI apps that can:

  • Post tweets
  • Delete tweets
  • Search for tweets by username
  • Search for tweets by keywords
  • Look up a user by username

Install

pip install arcade_x

Available Tools

Tool NameDescription
PostTweetPost a tweet to X (Twitter).
DeleteTweetByIdDelete a tweet on X (Twitter).
SearchRecentTweetsByUsernameSearch recent tweets by username.
SearchRecentTweetsByKeywordsSearch recent tweets by keywords or phrases.
LookupSingleUserByUsernameLook up a user on X (Twitter) by username.

If you need to perform an action that’s not listed here, you can get in touch with us to request a new tool, or create your own tools with the X auth provider.

PostTweet


Post a tweet to X (Twitter).

Parameters

  • tweet_text (string, required) The text content of the tweet you want to post.

DeleteTweetById


Delete a tweet on X (Twitter).

Parameters

  • tweet_id (string, required) The ID of the tweet you want to delete.

SearchRecentTweetsByUsername


Search for recent tweets (last 7 days) on X (Twitter) by username. Includes replies and reposts.

Parameters

  • username (string, required) The username of the X (Twitter) user to look up.
  • max_results (integer, optional, Defaults to 10) The maximum number of results to return. Cannot be less than 10.
  • next_token (string, optional) The pagination token starting from which to return results.

SearchRecentTweetsByKeywords


Search for recent tweets (last 7 days) on X (Twitter) by required keywords and phrases. Includes replies and reposts.

At least one of the following parameters must be provided: keywords, phrases.

Parameters

  • keywords (array of strings, optional) List of keywords that must be present in the tweet.
  • phrases (array of strings, optional) List of phrases that must be present in the tweet.
  • max_results (integer, optional, Defaults to 10) The maximum number of results to return. Cannot be less than 10.

LookupTweetById


Look up a tweet on X (Twitter) by its ID.

Parameters

  • tweet_id (string, required) The ID of the tweet to look up.

LookupSingleUserByUsername


Look up a user on X (Twitter) by their username.

Parameters

  • username (string, required) The username of the X (Twitter) user to look up.

Auth

The Arcade X (Twitter) toolkit uses the X auth provider to connect to users’ X (formerly Twitter) accounts.

With the hosted Arcade Engine, there’s nothing to configure. Your users will see Arcade (demo) as the name of the application that’s requesting permission.

The hosted Arcade Engine is intended for demo and testing purposes only, not for production use. To use Arcade and X (formerly Twitter) in production, you must use a self-hosted instance of the Arcade Engine.

With a self-hosted installation of Arcade, you need to configure the X auth provider with your own X (formerly Twitter) app credentials.