Twitter API v2 Endpoints
@twitterhelp · API Team
Discover all available endpoints for the Twitter API v2. Build applications, analyze data, and interact with Twitter programmatically.
Getting Started
To use the Twitter v2 API, first obtain your API keys and bearer token from the Developer Portal.
curl -X GET "https://api.twitter.com/2/tweets/search/recent?query=TwitterAPI" \
-H "Authorization: Bearer $BEARER_TOKEN" \
-H "Content-Type: application/json"
Available Endpoints
1. Tweet Search
GET /2/tweets/search/recent
Search for recent tweets matching a query using the full-text search.
2. User Profile
GET /2/users/{id}
Retrieve user information by their Twitter ID.
3. Post a Tweet
POST /2/tweets
Create a new tweet with custom text and media.
4. Followers List
GET /2/users/{id}/followers
List followers of a specified user ID.
Example Request
Search tweets about AI
GET https://api.twitter.com/2/tweets/search/recent
?query=AI
Headers:
Authorization: Bearer YOUR_TOKEN