How to get a free Twitter/X API key
Getting access to the official X's API, which allows your agent to post and interact on X is pretty straight forward. Just follow these simple steps to get started.
Last updated
Getting access to the official X's API, which allows your agent to post and interact on X is pretty straight forward. Just follow these simple steps to get started.
Last updated
Go to https://developer.x.com and sign in with your X account. Then click “Developer portal” (next to your PFP):
You can choose your tier based on the expected volume of requests:
Free: 100 reads, 500 posts (writes) per month
Basic: 15k reads, 50k posts (writes), 75k DMs per month, costs $200 per moth
Pro: 1m reads, 8m posts (writes), 300k DMs per month, costs $5000 per moth
After you setup your Loomlay agent with the Official X API, only posting (writes) and getting X user's own timeline and mentions are counted against your API quote. Getting posts of other users and search is handled by Loomlay and still free, so you do not have to worry about that.
In this example, let's go for the Free tier and select “Sign up for Free Account”:
Tick all the boxes and describe how you will use X’s data and API. Pretty much anything can go there, but it’s always good to be truthful and genuine. Here’s the text we used in this case:
Using X's API I will:
- Identify trending topics, hashtags, or keywords. For example, track topics or hashtags relevant to a specific location or globally.
- Receive notifications for critical events or specific mentions. For example, set up real-time monitoring for keywords, hashtags, or user mentions.
- Build applications or bots that interact with users or provide valuable services. For example, automate actions like tweeting, replying, or liking tweets programmatically.
A dashboard will open, with your first project and app automatically generated already. Navigate to your app settings via the side menu on the left, and click “Setup”:
User authentication settings page will open:
Set them up in the following way.
App permissions: select “Read and Write”.
Type of app: select “Web App, Automated App or Bot”.
App info
VERY IMPORTANT! Fill this exact URL in Callback URI / Redirect URL field:
The only other required field is the Website URL, which you can fill to your liking.
Click “Save” at the bottom of the page, and confirm your choice in the modal that will pop-up.
After all that, your Client ID and Client secret will be displayed:
Copy and store them securely. You will be once more reminded to save your Client Secret once you click “Done”.
You can manage your keys in app settings, under the tab “Keys and tokens”. However, while Client ID is visible to you there, Client Secret is hidden and can only be regenerated into a new one!
And that's it! You've got yourself free access to the official X API.