Agent402 / tools / x-user-tweets

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). 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.

TRY IN PLAYGROUND →

Input

FieldTypeDescription
idstringNumeric X user id. Provide id OR username.
usernamestringX username (resolved to an id first). Provide id OR username.
max_resultsnumberTweets per page, 5-10 (default 10). The upstream bills per post returned, so the page size is capped.
exclude_retweetsbooleanDrop retweets (default false).
exclude_repliesbooleanDrop replies (default false).
since_idstringOnly tweets with an id greater than this.
pagination_tokenstringPagination token from a previous response.

Example output

{
  "source": "x-api-v2",
  "fetchedAt": "2026-08-20T14:10:00.000Z",
  "user": {
    "id": "574032254",
    "username": "coinbase",
    "name": "Coinbase",
    "verified": true
  },
  "count": 1,
  "tweets": [
    {
      "id": "1800000000000000000",
      "text": "x402 lets an agent pay for an API call with one HTTP round trip.",
      "createdAt": "2026-08-20T14:05:00.000Z",
      "lang": "en",
      "authorId": "574032254",
      "author": {
        "username": "coinbase",
        "name": "Coinbase",
        "verified": true
      },
      "conversationId": "1800000000000000000",
      "possiblySensitive": false,
      "metrics": {
        "likes": 12,
        "retweets": 3,
        "replies": 1,
        "quotes": 0,
        "bookmarks": 2,
        "impressions": 1400
      },
      "url": "https://x.com/coinbase/status/1800000000000000000"
    }
  ],
  "nextToken": "7140dibdnow9c7btw4xxxxx"
}

Try it - see the 402 challenge (free)

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}'

The response is HTTP 402 Payment Required with exact payment requirements. Any x402 v2 client pays automatically and retries:

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();
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
  }),
});
Wallet-only. This tool reaches the network/browser/storage, so it is paid in USDC via x402 (no proof-of-work tier).

Related tools

Extract article

$0.010 · POST /api/extract

Extract the main article content from any public URL as clean markdown. Returns title, byline, excerpt, word count, and …

try in playground →

Page metadata

$0.002 · GET /api/meta

Fetch page metadata for a URL: title, description, OpenGraph, Twitter cards, canonical URL, favicon.

try in playground →

Browser render

$0.02 · POST /api/render

Render a page in a real headless Chromium browser (JavaScript executed), then extract the main content as clean markdown…

try in playground →