Authentication
Endpoint requirements
| Endpoint | App-Only | User Context |
|---|---|---|
| User Posts timeline | ✓ | ✓ |
| User mentions timeline | ✓ | ✓ |
| Home timeline | — | ✓ (required) |
Private metrics
To access private metrics, you must authenticate on behalf of the Post author:Fields and expansions
By default, responses include onlyid, text, and edit_history_tweet_ids. Request additional data:
Example request
cURL
Key fields
| Field | Description |
|---|---|
created_at | Post creation timestamp |
public_metrics | Engagement counts |
conversation_id | Thread identifier |
context_annotations | Topic classifications |
entities | Hashtags, mentions, URLs |
Fields and expansions guide
Learn more about customizing responses
Pagination
Timelines return up to 100 Posts per request. Use pagination for larger result sets.How it works
- Make initial request with
max_results - Get
next_tokenfrom themetaobject - Include
pagination_tokenin next request - Repeat until no
next_tokenis returned
Example
cURL
Pagination guide
Learn more about pagination
Filtering results
Time-based filtering
| Parameter | Description |
|---|---|
start_time | Oldest Post timestamp (ISO 8601) |
end_time | Newest Post timestamp (ISO 8601) |
since_id | Return Posts after this ID |
until_id | Return Posts before this ID |
Exclude parameter
Remove specific Post types from results:cURL
| Value | Effect |
|---|---|
retweets | Exclude retweets |
replies | Exclude replies |
Volume limits
Each timeline has maximum retrieval limits:| Endpoint | Maximum Posts |
|---|---|
| User Posts timeline | 3,200 most recent |
| User Posts (exclude=replies) | 800 most recent |
| User mentions timeline | 800 most recent |
| Home timeline | 3,200 or 7 days |
Requesting Posts beyond these limits returns a successful response with no data.
Post edits
Posts can be edited up to 5 times within 30 minutes. Timeline endpoints always return the most recent version.Considerations
- Posts older than 30 minutes represent their final version
- Near-real-time use cases should account for potential edits
- Use Post lookup to verify final state if needed
Edit Posts fundamentals
Learn more about Post edits
Post metrics
Public metrics
Available for all Posts with App-Only or User Context authentication:Private metrics
Requires User Context authentication from the Post author:- Only available for Posts from the last 30 days
- Only returned for Posts authored by the authenticated user
- Returns error for other users’ Posts
Edge cases
Non-public metrics and pagination
Non-public metrics and pagination
When requesting non-public metrics for Posts older than 30 days, you may receive a
next_token with result_count: 0. To avoid this:- Keep requests within the last 30 days
- Use
max_resultsof at least 10
Promoted metrics for non-promoted Posts
Promoted metrics for non-promoted Posts
Requesting promoted metrics for Posts that weren’t promoted returns an empty response. This is a known issue.
Truncated Retweet text
Truncated Retweet text
For Retweets with text over 140 characters, the text field is truncated. Use the
referenced_tweets.id expansion to get the full text.