API Docs
A full reference for calling this service from code, an assistant or a terminal.
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.
| Endpoint | Method | What it does |
|---|---|---|
| /api/v1/convert | POST, GET | Renders any supported X link in the format you name, PDF included |
| /{handle}/status/{id} | GET | Domain swap form of convert: keep the post path and call this host |
| /api/v1/replies | GET | Answers left under one post |
| /api/v1/credits | GET | Current balance, never billed |
| /mcp | POST | MCP 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_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxThe 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
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.
| Name | Type | Description |
|---|---|---|
url | string, required | Address of a post or account on either X domain. This host works in its place. |
scope | thread / post / conversation | thread (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. |
format | json / markdown / obsidian / text / pdf | json is the default. obsidian puts YAML frontmatter on top. pdf sends back a finished file. |
stats | all / root / off | Which entries show engagement numbers: all (default), only the opening one with root, or none with off. |
max | integer 1–200 | For account links, the number of recent entries wanted; 20 unless set. |
replies | boolean | For account links, also list what the owner wrote to others. Off unless set. |
reposts | boolean | For account links, also list what the owner shared. Off unless set. |
paper | a4 / letter | Sheet 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 }
}| Name | Type | Description |
|---|---|---|
kind | string | One of post, thread, conversation, profile. |
title | string | Opening words of the first entry, at most 60 characters. Account results are titled "Posts by Name (@handle)". |
sourceUrl | string | Where the material lives on X. |
author | object | Writer details that X makes visible, such as name, handle, bio, audience size, badge and signup date. |
markdown | string | Finished document, styled as Markdown or Obsidian. |
text | string | Unstyled version of that document. |
posts | array | Structured entries with id, wording, timestamp, attachments, counters and any quotation. |
replies | array | Filled only when scope is conversation. |
postsReturned | integer | Number of entries delivered, which equals the price in credits. |
wordCount | integer | Length of the finished document in words. |
credits | object | Amount 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.mdSetting 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
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
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.
| Name | Type | Description |
|---|---|---|
url | string, required | Address of the post whose answers you want. |
max | integer 1–100 | Upper 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
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
402on 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
402and 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
503carryingretryAfterSec. - 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.
| Plan | Monthly credits | Programmatic access |
|---|---|---|
| Free | None monthly; 50 once, for the website | API, MCP and CLI closed |
| Plus | 3,000 | 30 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 }
}
}| Code | Status | Cause |
|---|---|---|
INVALID_INPUT | 400 | Something in the request cannot be used: a bad value, a gap, or an address that is neither post nor account. |
UNAUTHORIZED | 401 | Key absent, mistyped or removed. X is never contacted and your balance stays as it was. |
LIMIT_REACHED | 402 | Check details.reason. PLUS_REQUIRED means no Plus plan on the account. INSUFFICIENT_CREDITS comes with details.required and details.balance. |
PROTECTED | 403 | The owner locked the account, so its entries cannot be read. |
NOT_FOUND | 404 | Nothing exists at that address, perhaps because it was removed. |
SUSPENDED | 410 | X has suspended this account. |
RATE_LIMITED | 429 | The per-minute quota is spent. Pause for retryAfterSec seconds, a value repeated in Retry-After. |
UPSTREAM | 502 | Fetching from X broke down. The attempt is not billed, so try again shortly. |
SERVICE_UNAVAILABLE | 503 | PDF 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.
| Tool | Arguments | What it does |
|---|---|---|
convert_x_url | url, scope, format, stats, max | Accepts a link and answers in Markdown, Obsidian, text or JSON. |
get_x_replies | url, max | Fetches answers to a single post. |
get_credits | none | Reports what is left to spend. |
Client configuration
Claude Code
claude mcp add --transport http twitterviewer https://twitterviewer.ai/mcpCursor
{
"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| Name | Type | Description |
|---|---|---|
<link> or @handle | string | What to read: a link, or a handle for that account's newest entries. |
--scope | thread / post / conversation | Mirrors the REST value; thread unless set. |
--format | md / obsidian / json / text / pdf | File style, md unless set. Pair pdf with -o. |
--stats | all / root / off | Controls engagement numbers; all unless set. |
--max | integer 1–200 | Account links: size of the list, 20 unless set. |
--replies, --reposts | flags | Account links: widen the list to answers or shares. |
--paper | a4 / letter | Sheet size for PDF output, a4 unless set. |
-o, --output | path | Saves 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.