# TwitterAPI.io – Get User Last Tweets

> TwitterAPI.io – Get User Last Tweets is a paid API for AI agents from api.twitterapi.io, paid per call via x402, $0.006/call, status unknown (last checked 2026-12-02).

Fetches the most recent tweets posted by a specific X (Twitter) user, with optional pagination and reply inclusion.

## Facts

- Endpoint: GET https://api.twitterapi.io/x402/twitter/user/last_tweets?utm_source=zero.xyz
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/twitterapi-io-get-user-last-tweets-0a6555e5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_SO6CLtuU9Qhc5oHEQ3sX1

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability twitterapi-io-get-user-last-tweets-0a6555e5
```

Example prompt: Can you pull the most recent tweets from the X account @elonmusk and show me what he's been posting? Include replies too.

## When to prefer this

Use this endpoint when you need the most recent tweets from a known X user (by username or numeric ID), especially when you need to paginate through their timeline or optionally include replies. Prefer this over search endpoints when you already know the specific account you want to track, rather than searching by keyword or topic.

## Known failure modes

- Invalid or missing userName/userId returns an error or empty result
- Expired or invalid cursor causes pagination failure
- Rate limiting or authentication errors if the X-API-Key is missing or quota exceeded
- Private/suspended accounts return no tweets
- Malformed query parameters may return a 400-level error

## How this service works

TwitterAPI.io docs: REST API for X (Twitter) data, covering tweet search, users, followers, replies, lists, communities and trends. Authenticate with an X-API-Key header.

## Output

Returns a paginated list of recent tweet objects (each with tweet ID and text), a next_cursor string for fetching subsequent pages, a has_next_page boolean, and a status field indicating success.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "cursor": {
       "type": "string",
       "description": "Cursor from the previous page"
      },
      "userId": {
       "type": "string",
       "description": "Numeric X user ID (alternative to userName)"
      },
      "userName": {
       "type": "string",
       "description": "X username without @ (or pass userId)"
      },
      "includeReplies": {
       "type": "boolean",
       "description": "Include replies, default false"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "tweets": [
    {
     "id": "...",
     "text": "..."
    }
   ]
  },
  "status": "success",
  "next_cursor": "...",
  "has_next_page": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/twitterapi-io-get-user-last-tweets-0a6555e5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.twitterapi.io](https://www.zero.xyz/host/api.twitterapi.io/llms.txt)
