Users
Home Timeline
Fetch your Twitter home timeline feed via API. $0.001 per call, ~20 tweets per call. GetXAPI home timeline endpoint documentation.
POST
/twitter/user/home_timelineThis endpoint costs $0.001 per API call and returns ~20 tweets per page.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
auth_token | string | Yes | User's auth token |
following | boolean | No | Which home feed to return. false (default) → For You (algorithmic; mixes in recommended posts from accounts the user doesn't follow). true → Following (reverse-chronological; only accounts the user follows). |
ct0 | string | No | Optional current CSRF token cookie. When provided with twid, skips server-side credential resolution. |
twid | string | No | Optional current user ID cookie, for example u=1234567890. Must be provided with ct0. |
cursor | string | No | Pagination cursor |
proxy | string | No | Proxy URL (http://, https://, socks5://, or socks4://) |
Notes
- If you already have current
ct0andtwid, send both to skip the extra server-side credential bootstrap fromauth_token. If either one is omitted, the server resolves them fromauth_tokenas before. Stale or invalid supplied values are not validated upfront and may fail on the actual Twitter action instead of returning an early401. - Returns your home timeline feed. The default (
followingomitted orfalse) returns the For You feed, which mixes in recommended posts from accounts you don't follow. Setfollowing: trueto get the Following feed — only posts from accounts you follow, in reverse-chronological order. - Pagination uses
next_cursoruntilhas_moreis false.
Response (200)
{
"userId": "1858475867762270208",
"tweet_count": 20,
"has_more": true,
"next_cursor": "DAABCgABHAY...",
"tweets": [
{
"type": "tweet",
"id": "2010705621524292007",
"text": "Hello from GetXAPI.",
"author": {
"userName": "example_user"
}
}
]
}Error Responses
400 - Missing auth_token
{
"error": "Missing required field: auth_token"
}401 - Invalid auth_token
{
"error": "Invalid auth_token - could not extract userId"
}Example
curl -X POST "https://api.getxapi.com/twitter/user/home_timeline" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{
"auth_token": "your_auth_token"
}'
# With pagination
curl -X POST "https://api.getxapi.com/twitter/user/home_timeline" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{
"auth_token": "your_auth_token",
"cursor": "DAABCgABHAY..."
}'
# Following feed only (posts from accounts you follow, reverse-chronological)
curl -X POST "https://api.getxapi.com/twitter/user/home_timeline" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{
"auth_token": "your_auth_token",
"following": true
}'