Torn Intel API

Torn Intel exposes a small read-only public API alongside the faction dashboard. The endpoints below need no key, no header and no cookie — they answer an anonymous request. Everything else under /api is scoped to a signed-in player.

The machine-readable version of this page is an OpenAPI 3.1 document, generated from the same source, so the two cannot disagree.

Authentication

The public endpoints on this page take no credentials. Every other endpoint authenticates with the torn-intel-session cookie, a JWT issued by POST /api/auth/loginin exchange for a Torn API key, and returns the signed-in player's own faction data only. There is no public endpoint that reads an arbitrary faction and no parameter that makes one.

How Torn API keys are encrypted at rest, and which Torn permission level unlocks what, is documented on the Security page.

Torn Intel MCP server

A remote Model Context Protocol server runs at /api/mcp over the Streamable HTTP transport (spec revision 2025-06-18). It is read-only, needs no credentials, and exposes exactly the public surface below — an MCP server that could reach further than the public API would be a way around the session boundary, not a convenience.

claude mcp add --transport http torn-intel https://torn-intel.com/api/mcp

Tools:

Torn Intel CLI

An official command-line tool, zero dependencies, no API key. Output is JSON on stdout so it composes with jq.

npx torn-intel-cli stock --country mex
npx torn-intel-cli history --country mex --item 206 --hours 48
npx torn-intel-cli guide --slug cracking-guide
npx torn-intel-cli stats

Versioning & deprecation

Rate limits

120 requests per 60 seconds per client, across all public endpoints combined. The session-scoped API is not metered by this policy.

Errors

Every error under /api is JSON, never an HTML page, and carries a stable machine-readable code plus a resolution saying what to do about it. Branch on code, not on the prose fields.

{
  "error": "Not Found",
  "code": "not_found",
  "message": "No API endpoint exists at /api/nope.",
  "resolution": "Check the endpoint list at https://torn-intel.com/developers ...",
  "status": 404,
  "documentation_url": "https://torn-intel.com/developers"
}

Rules of use

Public endpoints

GET /api/v1/public/foreign-stock

Current foreign stock, grouped by country. Each item carries quantity, buy cost, Torn market value and the resulting profit per item. Restock predictions are not exposed here: they are available to signed-in users only.

Response
application/json
Cache
public, s-maxage=20, stale-while-revalidate=40
{
  "generatedAt": "2026-08-25T09:41:02.113Z",
  "source": "torntools",
  "countries": [
    {
      "country": "mex",
      "updatedAt": "2026-08-25T09:40:47.000Z",
      "items": [
        {
          "itemId": 206,
          "itemName": "Xanax",
          "category": "Drug",
          "quantity": 45,
          "cost": 250000,
          "marketValue": 820000,
          "profitPerItem": 570000
        }
      ]
    }
  ]
}

GET /api/v1/public/foreign-stock/history

Quantity and price as observed over a rolling window, oldest point first. Observations only — no forecast.

Response
application/json
Cache
public, s-maxage=30, stale-while-revalidate=60
  • itemId (integer, required) Torn item ID.
  • country (string, required) Destination code as returned by the stock endpoint.
  • hours (integer, optional) Window length in hours. Clamped to 1–48. Defaults to 24.
  • 400itemId or country missing, or itemId not a number.
{
  "country": "mex",
  "itemId": 206,
  "hours": 24,
  "points": [
    { "t": "2026-08-24T10:00:11.000Z", "quantity": 120, "cost": 250000, "marketValue": 818000 }
  ]
}

GET /api/v1/public/stats

How many Torn players are indexed, how many factions are watched, and how many have registered.

Response
application/json
Cache
revalidated every 300s
{ "playersIndexed": 3184220, "watchedFactions": 1462, "factionsRegistered": 318 }

GET /api/v1/public/forum-stats

Registered factions, Pro factions, watched factions and spied players, as four integers.

Response
application/json
Cache
public, max-age=3600, s-maxage=3600
{ "factions": 318, "proFactions": 74, "watchedFactions": 1462, "spiedPlayers": 88140 }

GET /api/v1/public/registered

Returns a single boolean keyed by Torn player ID. Exposes no personal data, which is why it is unauthenticated and open to cross-origin calls from the in-game script.

Response
application/json
Cache
not cached
CORS
Allowed from any origin
  • playerId (integer, required) Torn player ID (XID).
  • 400playerId missing or not a number.
{ "registered": true }

GET /api/v1/news/public

Newest first. Each article carries id, title, content, tag, optional image URL and publish date.

Response
application/json
Cache
not cached
{
  "articles": [
    {
      "id": 12,
      "title": "Departure planner rewrite",
      "content": "…",
      "tag": "feature",
      "image_url": null,
      "published_at": "2026-08-24T18:02:00.000Z"
    }
  ]
}

GET /api/v1/stats-badge

A 440×56 SVG showing registered factions, watched factions and spied players. Safe to hotlink.

Response
image/svg+xml
Cache
not cached

GET /api/v1/intel-badge

A 380×56 SVG showing how many factions and how many players the index covers.

Response
image/svg+xml
Cache
not cached

GET /api/v1/public/pro-badge

A single-line SVG reading "N Pro factions trust Torn Intel". Width adapts to the number.

Response
image/svg+xml
Cache
public, max-age=300, s-maxage=300, stale-while-revalidate=600

Reading pages as Markdown

Every public page on Torn Intel serves a Markdown representation from its own URL, so an agent can skip the layout markup. Ask for it with an Accept header, or append .md to the path:

curl -H "Accept: text/markdown" https://torn-intel.com/abroad-stock
curl https://torn-intel.com/abroad-stock.md

Responses carry Vary: Accept, so a cache in between will not hand you the wrong variant. A request whose Accept rules out both text/html and text/markdown gets a 406 listing the available types rather than a silent fallback.