X user timeline

$0.08 per call · USDC via x402 · POST /api/x-user-tweets

Fetch an X (Twitter) account's most recent tweets by user id or username (username is resolved first). Send POST /api/x-user-tweets with no required fields (7 optional) and pay $0.08 per call over x402 or MPP (there is no free tier). It returns a JSON object with source, fetchedAt, user, count, tweets and 1 more.

Options to exclude retweets and replies, page with pagination_token, or fetch only tweets newer than since_id. Each tweet carries text, created time, language and engagement metrics.

Category: Web & documents · Tags: x twitter social x-api tweets timeline user-tweets

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
idstringnoNumeric X user id. Provide id OR username.
usernamestringnoX username (resolved to an id first). Provide id OR username.
max_resultsnumbernoTweets per page, 5-10 (default 10).
exclude_retweetsbooleannoDrop retweets (default false).
exclude_repliesbooleannoDrop replies (default false).
since_idstringnoOnly tweets with an id greater than this.
pagination_tokenstringnoPagination token from a previous response.

Example request

curl -i -X POST https://agent402.tools/api/x-user-tweets \
  -H "Content-Type: application/json" \
  -d '{"username":"coinbase","max_results":10,"exclude_retweets":true,"exclude_replies":true}'

Without payment this returns HTTP 402 Payment Required with the exact price for x-user-tweets; any x402 v2 or MPP client pays it and retries.

Example response

{
  "source": "x-api-v2",
  "fetchedAt": "2026-08-20T14:10:00.000Z",
  "user": {
    "id": "574032254",
    "username": "coinbase",
    "name": "Coinbase",
    "verified": true
  },
  "count": 1,
  "tweets": [
    {
      "id": "20",
      "text": "just setting up my twttr",
      "createdAt": "2006-03-21T20:50:14.000Z",
      "lang": "en",
      "authorId": "574032254",
      "author": {
        "username": "coinbase",
        "name": "Coinbase",
        "verified": true
      },
      "conversationId": "20",
      "possiblySensitive": false,
      "metrics": {
        "likes": 180000,
        "retweets": 120000,
        "replies": 10000,
        "quotes": 30000,
        "bookmarks": 5000,
        "impressions": 0
      },
      "url": "https://x.com/coinbase/status/1800000000000000000"
    }
  ],
  "nextToken": "7140dibdnow9c7btw4xxxxx"
}
FieldTypeAlways presentIn the example
sourcestringyesx-api-v2
fetchedAtstringyes2026-08-20T14:10:00.000Z
userobjectyes4 fields: id, username, name, verified
countnumberyes1
tweetsarray of objectsyes1 item in the example
nextTokenstringyes7140dibdnow9c7btw4xxxxx

From an MCP client

catalog.call {
  "slug": "x-user-tweets",
  "params": {
    "username": "coinbase",
    "max_results": 10,
    "exclude_retweets": true,
    "exclude_replies": true
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for x-user-tweets; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/x-user-tweets", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "username": "coinbase",
    "max_results": 10,
    "exclude_retweets": true,
    "exclude_replies": true
  }),
});

Related tools

X recent tweet search

$0.08 · POST /api/x-search-recent

Search public tweets from the last 7 days on X (Twitter) by query, using X API v2 search operators (keywords, from:, #ha…

X tweet lookup

$0.008 · POST /api/x-tweet

Fetch one public tweet on X (Twitter) by id: text, created time, language, conversation id, engagement metrics (likes, r…

X user profile

$0.015 · POST /api/x-user

Look up one X (Twitter) account by username: id, display name, bio, account creation date, verification status and type,…

X bulk user lookup

$0.15 · POST /api/x-users-lookup

Look up up to 10 X (Twitter) accounts by username in one call. Returns each found profile with public metrics (followers…

Farcaster channel feed

$0.004 · POST /api/fc-channel-feed

Latest casts in one or more Farcaster channels (e.g. base, farcaster, ethereum), newest first, with optional replies. Co…

Farcaster user casts

$0.004 · POST /api/fc-user-casts

A Farcaster user's recent casts by fid or username, newest first, optionally including replies or limited to one channel…