Developer API

Every wiki has an API at its own address, under /api/v1. Reading needs no account.

curl https://taking-london.wikiwright.com/api/v1/pages/Archer

For tools and AI agents

GET /api/v1/openapi.json describes everything a token can do, as OpenAPI 3.1. Point Swagger UI, Postman, a code generator or an AI agent at it. Each operation has x-token set to none (anyone), read (any token) or write (a write token).

Reading

RequestWhat you get
GET /api/v1/siteThis wiki's name, tagline, theme and nav links
GET /api/v1/pagesEvery page's name and summary
GET /api/v1/pages/{name}One page: its Markdown, version, rendered blocks and facts
GET /api/v1/pages/{name}/historyIts versions. ?before={version} for older ones
GET /api/v1/pages/{name}/revisions/{version}One old version
GET /api/v1/pages/{name}/diff?from={a}&to={b}What changed between two versions
GET /api/v1/pages/{name}/talkA page's discussions
GET /api/v1/talk/{id}One discussion and its posts
GET /api/v1/categories/{name}Pages in a category
GET /api/v1/recent-changesThe latest edits. Add ?hideBots=1 to leave out bots
GET /api/v1/search?q={words}Search this wiki. scope can be images, talk or all
GET /api/v1/filesUploaded images
GET /api/v1/files/{name}One image, and the pages that use it
GET /api/v1/patchesListed game updates
GET /api/v1/users/{handle}Someone's contributions here

From any address, GET /api/v1/search-all?q={words} searches every wiki.

With a token, GET /api/v1/me says what your account can do here, including whether your edits are reviewed (trusted). /watchlist and /notifications are yours too.

Tokens

Make a token under your profile settings, then send it in a header: Authorization: Bearer ww_your_token. Each account can have two. A token is shown once, so keep it safe, and never put one in a web page.

  • Read-only tokens can only read.
  • Write tokens can also do the four things below.

Writing

All of these need a write token. Errors come back as {"error": "what went wrong"}.

Save a page: PUT /api/v1/pages/{name}

curl -X PUT https://taking-london.wikiwright.com/api/v1/pages/Archer \\
  -H "Authorization: Bearer ww_your_token" \\
  -H "Content-Type: application/json" \\
  -d '{"markdown": "The new text", "version": 3, "summary": "Fixed a number"}'
Field
markdownThe whole page, in wiki Markdown. Required
versionThe version you started from, from GET /pages/{name}. 0 creates a new page. Required
summaryWhat you changed, up to 500 characters
minortrue for a small fix
  • 200: saved and live, with the new version.
  • 202: {"pending": true}. Your account's edits are still reviewed, so it waits for a moderator.
  • 409: someone saved since your version. The answer has the current one: fetch the page again and redo your change. Nobody's work gets overwritten.
  • 422: the page didn't pass the checks, such as a broken infobox.

Start a discussion: POST /api/v1/pages/{name}/talk

Send {"title": "Subject", "body": "First post, in Markdown"}. You get 201 and the discussion's id. Titles can be up to 120 characters and posts up to 20,000.

Reply: POST /api/v1/talk/{id}/posts

Send {"body": "Your reply"}. You get 201.

Upload an image: POST /api/v1/files

A multipart form with file (PNG, JPEG, GIF or WebP, up to 5 MB), description (what it shows, for people who can't see it) and source (where it came from, and why it's okay to use).

curl -X POST https://taking-london.wikiwright.com/api/v1/files \\
  -H "Authorization: Bearer ww_your_token" \\
  -F file=@archer.png -F "description=An archer" -F "source=My own screenshot"

You get 201 with the image's name and address. Use it in a page as ![An archer](/files/archer.png). Images go live without review, so uploading needs a few accepted edits on this wiki first. The same image twice gets a 409 naming the first copy.

What tokens can't do

No token can delete anything, moderate, change wiki settings, staff or your account, import, or use admin tools, even when your account can in the browser. Those stay in the site, signed in, so a leaked token can't do lasting damage. Unwatching pages, thanks and votes are site-only too.

Same rules as a person

A token acts as its account, with the same checks as the site: new accounts' edits wait for review, blocked or banned accounts can't write, and an unverified email can't write. Staff and owners skip review, but not the limits below. For bulk loading a whole wiki, importing is faster than the API.

Bots

If an account makes automated edits, mark it as a bot in your profile settings. Its edits are labelled and hidden from recent changes by default. Please use a separate account, and tell the wiki's staff before running one.

Limits

These apply to everyone, staff and wiki owners included. The platform's owner gets 60 times these, so content can be loaded quickly:

Per hour
Requests, per token1,000
Page saves60, or 20 while your edits are reviewed
Talk posts30
Image uploads20

Past a limit you'll get a 429. Each wiki also has 2 GB for images.