TwitterViewer AI
Reference for agent builders

API Docs

A full reference for calling this service from code, an assistant or a terminal.

Get an API key

Overview

Send this API an X link and get public material back, shaped as Markdown, an Obsidian note, bare text, JSON or PDF. TwitterViewer AI operates it on its own, with no tie to X Corp. Skip the X developer program entirely. Calls only look: nothing gets published or followed, and locked accounts stay locked.

Requests go to https://twitterviewer.ai, under the /api/v1 prefix. Bodies are UTF-8 JSON except where noted below. Billing is counted in credits, one per delivered entry.

EndpointMethodWhat it does
/api/v1/convertPOST, GETRenders any supported X link in the format you name, PDF included
/{handle}/status/{id}GETDomain swap form of convert: keep the post path and call this host
/api/v1/repliesGETAnswers left under one post
/api/v1/creditsGETCurrent balance, never billed
/mcpPOSTMCP over Streamable HTTP, hosted here

Authentication

Programmatic access belongs to Plus. Subscribers generate keys under API & credits. Each one appears in full a single time, since we keep just its hash; replace any you lose. A key is tv_live_ plus 32 alphanumeric characters, passed in this header:

Authorization: Bearer tv_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The owner of a key pays for its calls, so never ship one inside a browser app or public repository, and remove it at once if exposed. Bad or absent keys earn 401. Accounts lacking Plus earn 402 LIMIT_REACHED with PLUS_REQUIRED. Neither is billed. Plus accounts hold up to 2, free ones none.

Convert a link

POST · GET/api/v1/convert

One address in, one document out. A post address yields its writer's chain; an account address yields what it published lately. Put the fields in a JSON body with POST, or in the query string with GET for quick terminal tests.

NameTypeDescription
urlstring, requiredAddress of a post or account on either X domain. This host works in its place.
scopethread / post / conversationthread (default) joins the writer's chain. post keeps the linked entry alone. conversation appends one page of answers. Account links ignore this and list new entries.
formatjson / markdown / obsidian / text / pdfjson is the default. obsidian puts YAML frontmatter on top. pdf sends back a finished file.
statsall / root / offWhich entries show engagement numbers: all (default), only the opening one with root, or none with off.
maxinteger 1–200For account links, the number of recent entries wanted; 20 unless set.
repliesbooleanFor account links, also list what the owner wrote to others. Off unless set.
repostsbooleanFor account links, also list what the owner shared. Off unless set.
papera4 / letterSheet size used by format=pdf; a4 unless set.

Request

curl -X POST https://twitterviewer.ai/api/v1/convert \
  -H "Authorization: Bearer $TWITTERVIEWER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://x.com/username/status/1234567890123456789", "scope": "thread", "format": "markdown", "stats": "root" }'

Response

Want the file alone? Choose markdown, obsidian or text as format and send Accept: text/markdown or Accept: text/plain; the entry count moves to x-posts-returned. Any other combination answers with this JSON shape:

{
  "kind": "thread",
  "title": "How we shipped the new release:",
  "sourceUrl": "https://x.com/username/status/1234567890123456789",
  "author": { "handle": "username", "name": "Example", "followers": 1204 },
  "markdown": "# How we shipped the new release…",
  "text": "How we shipped the new release…",
  "posts": [ { "id": "1234567890123456789", "text": "…" } ],
  "replies": [],
  "postsReturned": 31,
  "wordCount": 2214,
  "credits": { "charged": 31, "remaining": 2969 }
}
NameTypeDescription
kindstringOne of post, thread, conversation, profile.
titlestringOpening words of the first entry, at most 60 characters. Account results are titled "Posts by Name (@handle)".
sourceUrlstringWhere the material lives on X.
authorobjectWriter details that X makes visible, such as name, handle, bio, audience size, badge and signup date.
markdownstringFinished document, styled as Markdown or Obsidian.
textstringUnstyled version of that document.
postsarrayStructured entries with id, wording, timestamp, attachments, counters and any quotation.
repliesarrayFilled only when scope is conversation.
postsReturnedintegerNumber of entries delivered, which equals the price in credits.
wordCountintegerLength of the finished document in words.
creditsobjectAmount taken (charged) and amount left (remaining).

Writing a bare document to disk:

curl "https://twitterviewer.ai/api/v1/convert?url=https://x.com/username/status/1234567890123456789&format=obsidian" \
  -H "Authorization: Bearer $TWITTERVIEWER_API_KEY" \
  -H "Accept: text/markdown" -o thread.md

PDF

Setting format=pdf yields an application/pdf file on A4 or Letter sheets, keeping entry order, pictures and source addresses. A render that breaks costs you nothing.

Repeat calls

Ask twice within 10 minutes for an identical conversion and the second answer is the stored one, unbilled. Link, scope, max, replies and reposts decide what counts as identical; PDF has its own record, and reply calls behave alike. How credits are counted covers trimmed results.

Swap the domain

GET/{handle}/status/{id}

Take any post or account address and change x.com to twitterviewer.ai. A signed request whose Accept header avoids HTML receives Markdown, exactly what convert would produce. Browsers asking for HTML see the ordinary page, while unsigned programs get 401 plus setup advice before X is touched.

Append scope, format, stats or max to the query as needed. Writing ?thread=off has the effect of scope=post.

# x.com/username/status/1234567890123456789 becomes:
curl -H "Authorization: Bearer $TWITTERVIEWER_API_KEY" \
  https://twitterviewer.ai/username/status/1234567890123456789

# only the first post, as Obsidian Markdown
curl -H "Authorization: Bearer $TWITTERVIEWER_API_KEY" \
  "https://twitterviewer.ai/username/status/1234567890123456789?scope=post&format=obsidian"

Read replies

GET/api/v1/replies

Collects answers to one post, paging onward until your max is met or the supply runs out. Only a TwitterViewer AI key is involved, and the price is a credit per answer delivered.

NameTypeDescription
urlstring, requiredAddress of the post whose answers you want.
maxinteger 1–100Upper limit on answers; 20 unless set.
curl "https://twitterviewer.ai/api/v1/replies?url=https://x.com/username/status/1234567890123456789&max=30" \
  -H "Authorization: Bearer $TWITTERVIEWER_API_KEY"

{
  "sourceUrl": "https://x.com/username/status/1234567890123456789",
  "replies": [ { "id": "…", "text": "…" } ],
  "postsReturned": 30,
  "credits": { "charged": 30, "remaining": 2919 }
}

Check your credits

GET/api/v1/credits

Shows what remains and where it came from. Nothing is billed, though the call counts toward your minute quota.

curl https://twitterviewer.ai/api/v1/credits -H "Authorization: Bearer $TWITTERVIEWER_API_KEY"

{
  "total": 3050,
  "plan": { "remaining": 3000, "granted": 3000, "expiresAt": "2026-11-22T00:00:00.000Z" },
  "purchased": { "remaining": 50 }
}

Under plan sits this cycle's allowance, refreshed at expiresAt. Under purchased sit lasting credits, for instance the 50 granted at registration.

How credits are counted

  • Price: each delivered entry takes 1 credit, and a quotation inside it takes another. Writer details come free.
  • Answers are priced the same way, whether listed alone or attached to a conversation.
  • Nothing is taken for an error, an empty result or a PDF that failed to render.
  • An empty balance gets 402 on billable calls. Repeating a recent call within 10 minutes still hands back its earlier result.
  • Short of credits on a reply call? The list is trimmed to what you can pay for.
  • Other conversions are all or nothing: one that outprices your balance returns 402 and takes nothing. Account exports ask for at most as many entries as you can afford, yet quotations may still push them over.
  • Credits expiring soonest go first, so plan allowances are used before the ones that last.
  • Registration grants 50 lasting credits. Free accounts spend them on this website; Plus accounts may also spend leftovers through the API. Plus refills 3,000 monthly, and credit packs are not sold.
  • Same account, same call, inside 10 minutes: the stored result returns at no cost. For conversions, link, scope, max, replies and reposts must match, and PDF is counted apart. For replies, post and max must match. A trimmed or preview result is fetched anew, and billed, once credits allow.
  • Sending a twin while the original still runs makes it wait. Past a minute, expect 503 carrying retryAfterSec.
  • Visitors to the website get 1 export a day at no charge. Programmatic access requires Plus and is always billed.

Rate limits and plans

Each account has a quota per minute, and x-ratelimit-remaining reports what is left of it. Billed answers add x-credits-charged and x-credits-remaining. Exceed the quota and you receive 429 RATE_LIMITED naming a retryAfterSec delay.

PlanMonthly creditsProgrammatic access
FreeNone monthly; 50 once, for the websiteAPI, MCP and CLI closed
Plus3,00030 a minute · 2 keys

See what Plus costs. Browsing this site stays unlimited each day, whereas code needs both Plus and a key.

Errors

Every failure returns { "error": { "code", "message", "retryAfterSec?", "details?" } } under the matching status listed here.

HTTP/1.1 402 Payment Required

{
  "error": {
    "code": "LIMIT_REACHED",
    "message": "Not enough credits",
    "details": { "reason": "INSUFFICIENT_CREDITS", "required": 31, "balance": 12 }
  }
}
CodeStatusCause
INVALID_INPUT400Something in the request cannot be used: a bad value, a gap, or an address that is neither post nor account.
UNAUTHORIZED401Key absent, mistyped or removed. X is never contacted and your balance stays as it was.
LIMIT_REACHED402Check details.reason. PLUS_REQUIRED means no Plus plan on the account. INSUFFICIENT_CREDITS comes with details.required and details.balance.
PROTECTED403The owner locked the account, so its entries cannot be read.
NOT_FOUND404Nothing exists at that address, perhaps because it was removed.
SUSPENDED410X has suspended this account.
RATE_LIMITED429The per-minute quota is spent. Pause for retryAfterSec seconds, a value repeated in Retry-After.
UPSTREAM502Fetching from X broke down. The attempt is not billed, so try again shortly.
SERVICE_UNAVAILABLE503PDF rendering or another component is offline. With details.reason IN_PROGRESS, an identical call has not finished: wait retryAfterSec. No credits move.

MCP server

Point a client at https://twitterviewer.ai/mcp, which talks Streamable HTTP. Plus subscribers approve the link in a browser window, or supply a key through Authorization: Bearer. None of the tools can write, and they draw on one shared balance with REST. Setup help lives in the server guide.

ToolArgumentsWhat it does
convert_x_urlurl, scope, format, stats, maxAccepts a link and answers in Markdown, Obsidian, text or JSON.
get_x_repliesurl, maxFetches answers to a single post.
get_creditsnoneReports what is left to spend.

Client configuration

Claude Code

claude mcp add --transport http twitterviewer https://twitterviewer.ai/mcp

Cursor

{
  "mcpServers": {
    "twitterviewer": { "url": "https://twitterviewer.ai/mcp" }
  }
}

Codex

[mcp_servers.twitterviewer]
url = "https://twitterviewer.ai/mcp"

With no balance left, a tool replies in plain words and points to plan details, so the model can explain the situation.

Command-line tool

Install nothing permanent: the npm package twitterviewer runs through npx for Plus subscribers. It looks for TWITTERVIEWER_API_KEY before falling back to the file saved by twitterviewer login.

npx twitterviewer https://x.com/username/status/1234567890123456789 --scope thread --format obsidian -o thread.md

npx twitterviewer login      # opens your browser, approve the device code
npx twitterviewer credits    # prints your balance
npx twitterviewer logout     # removes the saved key
NameTypeDescription
<link> or @handlestringWhat to read: a link, or a handle for that account's newest entries.
--scopethread / post / conversationMirrors the REST value; thread unless set.
--formatmd / obsidian / json / text / pdfFile style, md unless set. Pair pdf with -o.
--statsall / root / offControls engagement numbers; all unless set.
--maxinteger 1–200Account links: size of the list, 20 unless set.
--replies, --repostsflagsAccount links: widen the list to answers or shares.
--papera4 / letterSheet size for PDF output, a4 unless set.
-o, --outputpathSaves to disk instead of printing.

Exit status: 0 success, 1 failure, 2 wrong arguments, 3 login, plan or balance problem.

Agent Skill

This short instruction file tells an assistant how to handle X links by domain swap, terminal command or MCP tool. Find it at https://twitterviewer.ai/.well-known/agent-skills/twitterviewer/SKILL.md, then hand your assistant that address or drop a copy among its skills.

Machines can also start from /llms.txt. Adding .md to a page address returns its Markdown edition.