REST API
indice serve exposes a small HTTP API alongside the human-facing pages. The base URL is wherever you serve (default http://127.0.0.1:8080).
The read-only records
Section titled “The read-only records”Four routes describe what an instance holds: the instance itself, its collections, one collection, and one crawl. Each record holds what the matching page shows a visitor, no more and no less, so a script reading the JSON learns what a person reading the pages would. A fifth, GET /api/resolve, finds one URL’s captures among them. All five follow these conventions:
- Paths are unversioned.
GET /api/reportsapi_version, now1. Adding a field doesn’t change it; removing or renaming one does. - A field with no value is left out, never
null. - Timestamps are ISO 8601 (
2021-04-17T15:55:39Z). Capture times are converted from the archive’s 14-digit form. Dates a WACZ records about itself (crawled,wacz_modified) are given as it records them, which is normally ISO 8601 too. Sizes are in bytes and hashes are given in full. - Every URL is absolute: the site’s URL (
--site-url) on a server,http://localhost:and its port on a workstation. - Who added a crawl or created a collection is their display name from
users.yaml. For someone with no name there, it is the part of their login before the@, never the whole address. - A crawl stored in this archive is named by its file name, never its path on the server.
- A crawl note and a collection’s narrative are Markdown, as the curator wrote them. A page escapes any raw HTML in them and drops images and links that are not
http,httpsormailto, so a client that renders them should do the same. - Errors are JSON:
{"error": "crawl not found"}with a404for an unknown id,{"error": "no such route"}with a404for any other path under/api/, a400for an id that can’t be decoded or a query/api/resolvecan’t read, and{"error": "internal error", "reference": "…"}with a500. The reference is the request id the server logged the cause under. Messages are in English, so a client can match on them. - On a server, every answer carries
Access-Control-Allow-Origin: *, so a page on another site can read it. A workstation sends no such header, so its archive stays private to the machine.
/api/search predates these conventions: it sends null for an absent field and 14-digit timestamps (20250802185600).
GET /api/
Section titled “GET /api/”The instance: its name, its version, how much it holds, and where the other routes are. GET /api answers the same.
curl 'https://archive.example.org/api/'{ "name": "indice", "indice_version": "0.6.5", "api_version": 1, "collection_count": 1, "crawl_count": 2, "capabilities": ["search", "resolve"], "base_url": "https://archive.example.org", "endpoints": { "collections": "https://archive.example.org/api/collections", "search": "https://archive.example.org/api/search", "resolve": "https://archive.example.org/api/resolve" }}name: the site’s name (site.nameinconfig.yaml), elseindice.capabilities: what the instance serves beyond these records.base_url: the URL every other URL in the API starts with.
GET /api/collections
Section titled “GET /api/collections”Every collection, as the homepage’s cards show them.
curl 'https://archive.example.org/api/collections'{ "collections": [ { "id": "example-collection", "name": "Example Collection", "crawl_count": 2, "capture_start": "2021-04-17T15:55:39Z", "capture_end": "2026-06-09T21:34:16Z", "has_local": true, "has_remote": false, "url": "https://archive.example.org/collection/example-collection", "api_url": "https://archive.example.org/api/collections/example-collection", "replay_url": "https://archive.example.org/collection/example-collection/20260609213406/https://arcg.is/1zLCSC4", "thumbnail_url": "https://archive.example.org/thumb/7ab2f65e" } ]}id: the collection’s slug;description: its short abstract, when it has one.capture_start,capture_end: the earliest and latest captures across its crawls.has_local,has_remote: whether any crawl is stored in this archive, and whether any is fetched from a remote host. Both aretruefor a mixed collection.url: its page;api_url: its record;replay_url: where replay of the whole collection opens;thumbnail_url: its representative image.
The POST to this path, which creates a collection, is part of the management write API.
GET /api/collections/{id}
Section titled “GET /api/collections/{id}”One collection, as its page shows it, with its crawls newest first.
curl 'https://archive.example.org/api/collections/example-collection'Response (abbreviated to one crawl):
{ "id": "example-collection", "name": "Example Collection", "finding_aid": { "dates": "2026" }, "crawl_count": 2, "total_size_bytes": 5954906, "software": [ "Browsertrix-Crawler 1.13.0 (with warcio.js 2.4.9)", "Webrecorder ArchiveWeb.page 0.6.1 (via warcio.js 1.4.3)" ], "capture_start": "2021-04-17T15:55:39Z", "capture_end": "2026-06-09T21:34:16Z", "status_counts": { "200": 460, "301": 1 }, "created": "2026-12-01T20:27:11Z", "annotation_count": 0, "crawls": [ { "id": "dec0c0d4", "name": "GitHub Bitcoin Mining", "capture_start": "2021-04-17T15:55:39Z", "present": true, "remote": false, "page_count": 15, "software": ["Webrecorder ArchiveWeb.page 0.6.1 (via warcio.js 1.4.3)"], "url": "https://archive.example.org/crawl/dec0c0d4", "api_url": "https://archive.example.org/api/crawls/dec0c0d4", "thumbnail_url": "https://archive.example.org/thumb/dec0c0d4" } ], "url": "https://archive.example.org/collection/example-collection", "api_url": "https://archive.example.org/api/collections/example-collection", "replay_url": "https://archive.example.org/collection/example-collection/20260609213406/https://arcg.is/1zLCSC4", "thumbnail_url": "https://archive.example.org/thumb/7ab2f65e"}finding_aid: the curator’s description, with any ofnarrative(Markdown),curator,creator,dates,rightsandsubjects.software: every tool that produced one of its crawls, without repeats.status_counts: how many captures got each HTTP status, summed across its crawls.created: when the collection was created;created_by: who created it, by display name.drafted: present when a language model drafted part of the finding aid, with themodel, theservice, thefieldsit drafted, andreviewed_by, the display name of whoever last saved the finding aid.annotation_count: how many notes the collection holds.crawls[]: each crawl’sid,name,capture_start(its first capture),present(whether its WACZ can be read now),remote,page_count,software, and the URLs of its page, its record and its thumbnail.
GET /api/crawls/{id}
Section titled “GET /api/crawls/{id}”One crawl, as its page shows it.
curl 'https://archive.example.org/api/crawls/dec0c0d4'Response (abbreviated to one seed page):
{ "id": "dec0c0d4", "name": "GitHub Bitcoin Mining", "collection": { "id": "example-collection", "name": "Example Collection", "url": "https://archive.example.org/collection/example-collection", "api_url": "https://archive.example.org/api/collections/example-collection" }, "seed_pages": [ { "url": "https://github.com/DocNow/hydrator/pull/78/files", "title": "Demo title Add files via upload by AmazoneyBobuxey · Pull Request #78 · DocNow/hydrator · GitHub", "timestamp": "2021-04-17T15:56:42.809Z", "replay_url": "https://archive.example.org/crawl/dec0c0d4/20210417155642/https://github.com/DocNow/hydrator/pull/78/files" } ], "provenance": { "software": ["Webrecorder ArchiveWeb.page 0.6.1 (via warcio.js 1.4.3)"], "is_part_of": "GitHub Bitcoin Mining", "page_count": 15 }, "status_counts": { "200": 235 }, "source": { "kind": "file", "file": "github-bitcoin-mining.wacz" }, "size_bytes": 1221010, "sha256": "39f27fff55765580f9ae935b2fa43e5ada724dc56aec1a7e719736d1663d7168", "crawled": "2021-04-17T16:05:57Z", "indexed": "2026-12-01T20:27:11Z", "capture_start": "2021-04-17T15:55:39Z", "capture_end": "2021-04-17T16:05:57Z", "present": true, "remote": false, "url": "https://archive.example.org/crawl/dec0c0d4", "api_url": "https://archive.example.org/api/crawls/dec0c0d4", "replay_url": "https://archive.example.org/crawl/dec0c0d4/20210417155642/https://github.com/DocNow/hydrator/pull/78/files", "thumbnail_url": "https://archive.example.org/thumb/dec0c0d4"}name: the crawl’s name as stored. A crawl named only by its tool’s identifier is shown on its page by when it ran, with this name beside it.description,note: the crawl’s description, and the curator’s note on it in Markdown.collection: the collection it belongs to. Absent if that collection no longer exists.seed_pages[]: the pages the crawl started from, each with itsurl,title,timestamp, andreplay_url. A seed page whose URL can’t be replayed has noreplay_url.provenance: how the crawl was produced, with any ofsoftware,operator,user_agent,robots,hostname,is_part_of,conforms_to,keywords,licenses,page_count,nested_waczs(for a WACZ bundling others, how many),wacz_modified, and for an imported crawlbrowsertrix(host,item_id,review_ratingfrom 1 to 5) orarchive_it(host,collection_title,crawl_id,warc_count).status_counts: how many captures got each HTTP status.source: where the WACZ lives.kindisfile(stored in this archive, with itsfilename),url(fetched fromurl, shown without anyuser:pass@or query string, so a password or presigned signature in it stays out), orbrowsertrixorbrowsertrix-public(streamed from a Browsertrixhost, given without its scheme, with the resource’sfilename).size_bytes,sha256: the WACZ’s size and hash.crawled: when the crawl ran;indexed: when this archive indexed it.capture_start,capture_end: its earliest and latest captures.present: whether its WACZ can be read now;remote: whether it is fetched from a remote host at replay time.added_by: who added it to the archive, by display name.replay_url: where replay opens, on its first seed page that can be replayed.
GET /api/resolve
Section titled “GET /api/resolve”The captures of one URL, across all of the instance’s crawls: one from each crawl file that holds it. A WACZ that captured the URL more than once is listed once, at its latest capture of the page.
curl 'https://archive.example.org/api/resolve?url=https://arcg.is/1zLCSC4&limit=1'{ "url": "https://arcg.is/1zLCSC4", "total": 2, "captures": [ { "url": "https://arcg.is/1zLCSC4", "timestamp": "2026-06-09T21:34:16Z", "title": "2Tone: The Sound of Britain", "crawl": { "id": "5b865f64", "name": "a-may", "url": "https://archive.example.org/crawl/5b865f64", "api_url": "https://archive.example.org/api/crawls/5b865f64" }, "collection": { "id": "second-collection", "name": "Second Collection", "url": "https://archive.example.org/collection/second-collection", "api_url": "https://archive.example.org/api/collections/second-collection" }, "replay_url": "https://archive.example.org/crawl/5b865f64/20260609213416/https://arcg.is/1zLCSC4" } ]}url(required): the URL to look up, percent-encoded as a query value. The query is form-decoded, so an unencoded+reads as a space and%20as a space too: send+as%2B,%as%25, and&,#and spaces encoded as well. It matches only the exact URL a crawl recorded:http://andhttps://, a trailing slash,www.and letter case all make a different URL. A client holding one form and finding nothing can try another.datetime: sort the captures nearest this time first, the earlier of two as near as each other first. It takes an ISO 8601 time (2025-04-01T12:00:00Z), a date (2025-04-01), or Wayback-style digits in whole fields, from a year (2025) to the second (20250401120000), each meaning the start of that period. Without it, the oldest capture comes first. It changes the order, never which captures are included.limit: how many captures to list, 100 if not given and at most 1000.totalcounts all of them.- Captures made at the same second are ordered by crawl id, so the same question gets the same answer.
- Each capture has its
url,timestamp,status(the HTTP status the crawl recorded, left out when it recorded none),title, thecrawlandcollectionit belongs to with their pages (url) and records (api_url), and thereplay_urlthat opens it in the reading room, left out for a URL replay can’t open (one that isn’thttporhttps). - A URL with no captures is a
200withtotal0and an emptycaptureslist. A missingurl, or adatetimeorlimitthat can’t be read, is a400.
It looks among the pages indice indexed for search: HTML and PDF responses with a body, and the text Browsertrix records of each page it loaded, under the address it was asked to load. So a Browsertrix seed that redirected is found under the address it was given, as above, with no status. A redirect, image, script or stylesheet with nothing else stored under its URL is not found.
GET /api/search
Section titled “GET /api/search”Full-text search as JSON, using the same engine behind the search page.
Query parameters
| Param | Required | Description |
|---|---|---|
q |
yes | The query. Supports the full search syntax, including field filters like site:example.com, year:2021, type:pdf, lang:en, and collection:<slug>, so facets are expressed inside q. Capped at 2048 bytes; a longer one gets 400 naming the limit. |
limit |
no | Max results to return. Default 20, capped at 200. |
curl 'http://127.0.0.1:8080/api/search?q=climate+site:example.com&limit=5'Response (illustrative, abbreviated):
{ "total": 264, "capped": false, "results": [ { "doc_type": "html", "url": "https://example.com/report", "domain": "example.com", "timestamp": "20250802185600", "title": "Climate report: annual summary", "crawl_id": "4eefdff3", "crawl_name": "example crawl", "collection": "example-collection", "snippet": "…an annual <mark>climate</mark> report…", "capture_count": 3, "status": 200 } ], "facets": [ { "field": "collection", "label": "Collection", "buckets": [ { "value": "example-collection", "count": 220 } ] }, { "field": "year", "label": "Year", "buckets": [ { "value": "2025", "count": 129 } ] } ]}Fields
total: number of matching documents;cappedistruewhen that count is approximate (very large result sets).results[]: up tolimithits, each with:doc_type(media bucket, e.g.html,pdf, orannotationfor a note),url,domain,timestamp(the capture time),title,author(set for annotation hits),crawl_id(8-char id) andcrawl_name,collection(slug),snippet(a hit-highlighted excerpt, with<mark>around matches),capture_count(how many times this URL was captured, grouped into one result), andstatus(the archived HTTP status).facets[]: facet groups, each{ field, label, buckets: [{ value, count }] }, matching the sidebar on the search page.
GET /api/annotations
Section titled “GET /api/annotations”The public read side of annotations: the notes on one capture, or every note in a collection.
Query parameters
| Param | Required | Description |
|---|---|---|
collection |
yes | The collection slug. |
url |
no | A capture URL. Provide with ts to get the notes on that one capture; omit both for every note in the collection. |
ts |
no | The 14-digit capture timestamp. Must be given together with url. |
curl 'http://127.0.0.1:8080/api/annotations?collection=example-collection'Response (abbreviated): { "can_annotate": false, "annotations": [ … ] }, where each note carries its id, author (a display name, never the login identity, since this endpoint is public), created/modified, the target url + timestamp, the selector (the quoted passage, for a passage note), and the note body as both note_md (Markdown) and note_html (sanitized). can_annotate reflects whether the current request is allowed to write.
Each note also carries href, the path of its own page.
Creating, editing, and deleting notes are management-gated write endpoints (POST /api/annotations, POST /api/annotations/{id}, POST /api/annotations/{id}/delete). See the management write API below.
GET /collection/{id}/annotations/{key}
Section titled “GET /collection/{id}/annotations/{key}”One note, at the URL that identifies it. key is the hex after urn:indice:annotation: in its id. Public, like the notes themselves.
With an Accept header that ranks application/ld+json or application/json above HTML, it answers with the note as a W3C Web Annotation, as application/ld+json; profile="http://www.w3.org/ns/anno.jsonld". A browser gets a page showing the note, with the same JSON-LD in a <script type="application/ld+json">.
The JSON-LD is also at /collection/{id}/annotations/{key}.jsonld, whatever the request asks for, so it works as a plain link. The note’s page links to it with rel="alternate", in the page and in a Link header. Its id is still the URL without .jsonld.
curl -H 'Accept: application/ld+json' \ 'http://127.0.0.1:8080/collection/example-collection/annotations/3f9c0d2e8b7a41c6a5d0e9f8b7c6a5d4'Response (abbreviated):
{ "@context": "http://www.w3.org/ns/anno.jsonld", "id": "http://127.0.0.1:8080/collection/example-collection/annotations/3f9c0d2e8b7a41c6a5d0e9f8b7c6a5d4", "type": "Annotation", "created": "2026-11-05T15:04:05Z", "creator": { "type": "Person", "name": "alice" }, "body": { "type": "TextualBody", "format": "text/markdown", "value": "Worth reading." }, "target": { "source": "https://example.org/", "selector": { "type": "TextQuoteSelector", "exact": "Example Domain" }, "state": { "type": "TimeState", "sourceDate": "2026-01-01T00:00:00Z", "cached": "http://127.0.0.1:8080/collection/example-collection/20260101000000/https://example.org/" } }}id is built from the site’s URL (--site-url), or on a workstation from http://localhost: and its port. On a server the JSON-LD is sent with Access-Control-Allow-Origin: *, so annotation tools on other sites can read it; a workstation sends no such header, so its notes stay private to the machine. creator is the author’s display name only, never the login identity. A whole-page note has no selector. state says when the page was captured and where the archived copy replays. An unknown note, or a key that isn’t one, is a 404. A note whose id indice didn’t create (in a hand-edited annotations.jsonl, say) has no page of its own, and /api/annotations gives it no href.
GET /health
Section titled “GET /health”A liveness check: returns 200 OK with the body ok. Useful for container/orchestrator health probes.
Timeouts
Section titled “Timeouts”Routes that should answer quickly carry a 30-second budget and return 503 if they exceed it. The budget is a backstop: these routes answer in milliseconds, so a 503 here means something is wrong on the server.
Four kinds of request have no budget, because they have no sensible time bound: GET /files/{id} streams whole archives, the SSE progress stream follows a job that may run for hours, uploads are as slow as the link, and the Browsertrix and Archive-It browse endpoints wait on someone else’s service.
Rate limits
Section titled “Rate limits”A server limits each client. A workstation doesn’t.
- Most routes allow a burst of 100 requests per client, then 20 a second. Past that the answer is
429withRetry-After. Across all clients, at most 256 of these requests are in flight at once, and beyond that the answer is an immediate503withRetry-After. GET /files/{id}isn’t rate-limited, because one replay makes hundreds of ranged reads. Instead a client may hold 64 streams open at once, and 512 may be open in total. A stream stays open until its body has been read or dropped./healthis never limited.
A client is its IP address, and for IPv6 its /64. Behind a reverse proxy on the same machine or network, indice uses the rightmost X-Forwarded-For entry that isn’t itself internal. The shipped Caddy stack sets that header. Curators and admins are exempt from the per-client limits, so a script that reads hard needs a roster entry.
The operator sees a refusal in the server log twice: once when it starts, naming the address and the limit, and once a minute later with how many requests were refused. indice does not log each refused request, so a flood of requests does not become a flood of log lines.
Machine-readable replay endpoints
Section titled “Machine-readable replay endpoints”These serve ReplayWeb.page’s in-browser player, and tooling can use them too. They answer on both the site and the replay origin; the player reads them from the replay origin:
GET /files/{id}: the raw WACZ for a crawl, honoring HTTPRangerequests (partial fetches). This is how replay reads archived resources without downloading the whole file. On a server it is sent withAccess-Control-Allow-Origin: *, so another site’s ReplayWeb.page can replay a public archive; a workstation sends no such header.GET /collection/{id}/replay.json: a multi-WACZ replay manifest for a collection (every member crawl), handed to wabac.js so cross-crawl links resolve.GET /collection/{id}/pages: the collection’s page list and URL→capture resolution, scoped to the collection.GET /crawl/{id}/replay.jsonandGET /crawl/{id}/pages: the same for one crawl that Browsertrix wrote into several WACZs, listing every file of the crawl, so a page replays with the stylesheets and scripts stored in the crawl’s other files.
See How indice works for how these fit together.
Management write API
Section titled “Management write API”indice also carries write endpoints under /api/ (add archives, create or edit collections, delete crawls, Browsertrix and Archive-It import), plus SSE progress streams. The workroom UI calls them. They are always mounted; who may call them is decided by Access, which is loopback trust on a workstation and a forward-auth proxy plus users.yaml on a server. An anonymous caller gets a 403. Treat them as an implementation detail of that UI rather than a stable public API.