Overview
The X API (formerly Twitter API) allows you to read and post content on X, search tweets, manage followers, and access user timelines using OAuth 2.0. Note that as of 2023, free tier access is very limited — most useful features require a paid Basic or Pro subscription. It is widely used for social media analytics, bots, and content monitoring tools.
Beginner Tip
The free tier only allows posting up to 1,500 tweets per month with very limited reading; for reading recent tweets or building a search tool, you will likely need the Basic plan ($100/month) or higher.
Available Data
Example Response
{
"status": "success",
"data": {
"result": "Data from Twitter",
"description": "Read and write Twitter data",
"timestamp": "2025-01-15T10:00:00Z"
}
} Field Reference
data Array of tweet objects matching the request. data[].id Unique identifier for the tweet. data[].text The full text content of the tweet. data[].author_id The user ID of the tweet's author; expand with expansions=author_id to get user details. data[].created_at ISO 8601 timestamp of when the tweet was posted. meta.result_count Number of results returned in this response. Implementation Example
// Search recent tweets (requires Bearer Token)
const url = "https://api.x.com/2/tweets/search/recent?query=from:twitterdev&max_results=10";
const response = await fetch(url, {
headers: {
"Authorization": "Bearer YOUR_BEARER_TOKEN"
}
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(`Found ${data.meta.result_count} tweets`);
data.data.forEach(tweet => {
console.log(`${tweet.id}: ${tweet.text}`);
}); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Matrix Score Breakdown
Partially tested on Apr 5, 2026
Technical Specifications
Similar APIs
View All →Reddit API provides access to posts, comments, subreddits, and user data from one of the world's largest discussion platforms.
Tumblr
The Tumblr API gives you access to Tumblr's creative blogging platform, letting you read posts, follow blogs, and publish content using OAuth authentication.