Prerequisites
Set up an X developer account and obtain the necessary keys. Follow the steps:(Click for step details)
Create an X Developer Account:
Create an X Developer Account:
- Go to the X Developer website: https://developer.x.com/
- Sign in with your X account or create a new one if you don’t have an account.
- Apply for a developer account by providing the required information about your intended use of the X API.
Create a Project and App:
Create a Project and App:
- Once your developer account is approved, log in to the X Developer portal.
- Navigate to the “Projects & Apps” section and create a new project.
- Within the project, create a new app. This app will be used to generate the necessary API keys and tokens.
- You’ll get a client id and client secret, but you can ignore them.
Generate API Keys, Tokens, and Client Credentials:
Generate API Keys, Tokens, and Client Credentials:
- After creating the app, navigate to the “Keys and tokens” tab.
- Generate the following keys, tokens, and client credentials:
- API Key (Consumer Key)
- API Secret Key (Consumer Secret)
- Bearer Token
- Access Token
- Access Token Secret
Set Environment Variables:
Set Environment Variables:
Export the generated keys, tokens, and client credentials as environment variables in your system or provide them as arguments to the
XTools constructor.X_CONSUMER_KEYX_CONSUMER_SECRETX_ACCESS_TOKENX_ACCESS_TOKEN_SECRETX_BEARER_TOKEN