API overview
Authentication, conventions, limits and errors of the hub's read-only REST API (v1).
A read-only JSON API over the OSRS account data your guild's RuneLite plugins send to the hub. It is
pull-only: poll /snapshot and follow the /events cursor feed. There are no webhooks.
This reference follows the newest hub. An older hub ignores parameters it doesn't know and answers
404 not_found on endpoints it doesn't have; its own /openapi.json says what it serves.
- Base URL:
https://<your hub>/api/v1 - OpenAPI 3.1 document:
https://<your hub>/api/v1/openapi.json(public), or the copy on this site - On your hub: an interactive reference at
https://<your hub>/docs/api
The pages in this section are generated from the hub's OpenAPI document. Each one lists parameters and response schemas, and has a playground.
Using the playground
Set the hub server variable to your hub's origin (such as https://hub.example.com) and paste an
API key. Your browser then calls your hub directly: the key goes only from your browser to your hub, not
to this site. The hub allows this because every API response carries Access-Control-Allow-Origin: *.
Authentication
Send a key on every request:
GET /api/v1/me
Authorization: Bearer ohub_<prefix>_<secret>Members create keys on API keys, admins create integration keys on Admin → Integrations. See Which key?. Cookies are ignored.
These all get the same 401 unauthorized with WWW-Authenticate: Bearer: a missing, malformed, unknown,
revoked or expired key, or a key whose creator left the guild.
POST /mcp also takes the hub's own sign-in token (ohat_…) of an assistant that connected by
signing in, such as Claude.ai. It acts as the key the member's Allow made, and no other endpoint
takes it. See AI assistant.
What a key can read is worked out on every request: its categories, its accounts, and what its creator
can see right now. An integration key reads what the guild audience sees, and it alone can ask
/members/{discord_id} whether a Discord account is a member of the hub.
Conventions
- Success:
{ "data": …, "meta": { "generated_at": "…" } }. Lists addmeta.count. - Errors:
{ "error": { "code": "…", "message": "…" } }. A 400 addsdetails: [{ path, message }]. - Names: every key the hub defines is snake_case. Data passes through unchanged: skill names
(
"Attack"), equipment slots, item and account names, and an event'sdataobject (the plugin's own camelCase). - Timestamps are ISO-8601 UTC. Ids are opaque strings.
- Query parameters: lists are comma-separated (
skills=attack,defence), dates are ISO-8601 withZor an offset, booleans aretrue/false. Unknown parameters are ignored. - Evolution: v1 only changes additively. Ignore fields you don't know.
- Not found vs not readable: anything the key can't read answers
404 not_found, exactly like an unknown id. - Omitted vs not shared: on
/accounts/{id}and/snapshot, a section the key can't read is left out. A section the key may read but the plugin never sent is{ "shared": false, "updated_at": null }on/accounts/{id}, ornullon/snapshot. - Stale locations: a live location older than 2 minutes has
stale: true. - Ranges:
fromandtoselect a period on the history endpoints.todefaults to now;fromdefaults to 30 days beforeto, and to 24 hours before it on the location trails.
Rate limits
| Limit | Value | On excess |
|---|---|---|
| Per key, all endpoints | 120 requests per sliding minute for a personal key; 600 (or what the admin set) for an integration key | 429 rate_limited with Retry-After |
Per key, /snapshot | 1 request per second | 429 with Retry-After: 1 |
| Failed authentications per client IP | 30 per minute | every request from that IP gets 429 until the window passes |
Every authenticated response carries X-RateLimit-Limit, X-RateLimit-Remaining and
X-RateLimit-Reset (seconds until a request frees up, not a timestamp). Retry-After is always whole
seconds, and a 304 counts too.
Caching
Cache-Control: no-store everywhere, except:
/snapshot:private, no-cachewith a weakETag. Send it back asIf-None-Matchto get304./openapi.json:public, max-age=300./regions.json:public, max-age=86400. The names only change with a hub release.
Errors
| Status | code | When |
|---|---|---|
| 400 | invalid_request | a malformed or out-of-range parameter (details names it) |
| 401 | unauthorized | no valid key |
| 404 | not_found | an unknown or unreadable account, or an unknown path (which /members/{discord_id} is for a personal key) |
| 429 | rate_limited | over a limit; wait Retry-After seconds |
| 503 | unavailable | the hub is busy or its database is unreachable; retry after Retry-After |
| 500 | internal_error | a bug; nothing about it is revealed |
{"error":{"code":"invalid_request","message":"The request is invalid.","details":[{"path":"from","message":"must be an ISO-8601 date-time with Z or an offset"}]}}Endpoints
| Endpoint | Category | What it returns |
|---|---|---|
GET /me | any | the key, its creator and how many accounts it sees |
GET /accounts | the visible accounts, filterable by names, ids, online | |
GET /accounts/{id} | per section | one account's current state |
GET /snapshot | per field | every visible account's current state, for polling |
GET /accounts/{id}/xp, GET /xp | stats | XP series of one or several accounts |
GET /accounts/{id}/gains | stats | XP gained per skill over a period |
GET /events | events | the events cursor feed, or with from/to the events of a time range; item/npc search drops and NPCs |
GET /accounts/{id}/sessions | activity | play sessions |
GET /accounts/{id}/equipment-history | equipment | every change of the worn set |
GET /accounts/{id}/wealth | inventory | wealth per day: bank, inventory and gear |
GET /accounts/{id}/locations, GET /locations | location_history | location trails: every tile visited, how the player got to each, and the place's name |
GET /accounts/{id}/day | per section | one account's day, or up to 7, in one call: sessions, gains, events, places |
GET /accounts/{id}/progress | per section | the Progress page for a range: time online and active, where the time went, XP per skill, loot, boss kills gained, the change in wealth, goals |
GET /accounts/{id}/hiscores, GET /hiscores | hiscores | what the hub last read from the official hiscores |
GET /accounts/{id}/collection-log | events or hiscores | an account's collection log: the total and the slots the hub saw |
GET /collection-log | events or hiscores | the guild's collection log, and with item who has it |
GET /leaderboards/gains | stats | top 10 gainers per skill |
GET /leaderboards/loot | events | the most valuable drops of a period |
GET /leaderboards/kills | hiscores | top 10 per boss by kills gained over 7 or 30 days |
GET /members/{discord_id} | none; integration keys only | whether a Discord account is a member of the hub, and an admin |
POST /mcp | the key's | the hub as an MCP server for AI assistants; see AI assistant |
GET /regions.json | none | the place names behind region |
GET /openapi.json | none | the OpenAPI document |
Pick an endpoint in the sidebar for its parameters, response schema and playground.
Events: feed or time range
GET /events reads in one of two ways.
- The feed (no
fromorto) is for following events as they happen: start withcursor=now, then keep passingmeta.next_cursor. Events come oldest first, andnext_cursoris always a string. Build your own walks through it. - A time range (
from,toor both) answers "what happened between A and B". You get the newestlimitevents whoseoccurred_atlies in the range, newest first.meta.next_cursoris the cursor of the next, older page, ornullon the last one; pass it with the samefrom,toand filters.
The two kinds of cursor don't mix: a feed cursor (or cursor=now) together with from/to, and a
range cursor without them, are a 400. The feed holds events back 10–15 seconds until their write has
settled; a range doesn't, so an event can show up there a few seconds earlier.
Location trails
With HA Exporter 1.6 or newer, a trail has a point for every tile the player was on: one per game tick (0.6 s) on which the tile, plane or boat state changed. An older plugin, and a player standing still, give one point a minute. Trails are kept for 30 days and returned oldest first.
Each point's via says how the player got there from the point before. Only move is a line to draw.
via | What happened |
|---|---|
move | Walked, ran or sailed. Stairs are a move to another plane. |
entrance | Into or out of the underground (a cave, a dungeon, a basement). |
house | From one room of a player-owned house to the next; the coordinates jump although the player walked. |
instance | From one room to the next inside the Gauntlet, the Corrupted Gauntlet or the Chambers of Xeric, where the coordinates jump as they do in a player-owned house. |
teleport | Anything else that wasn't walked. |
gap | More than 5 minutes since the point before: nothing is known about the time in between. |
null | The first point, when the one before it lies before from. |
- New labels: more may be added. Treat one you don't know as not walked.
- Limits: one trail carries at most 20,000 points, the newest ones.
truncated: truemeans older points were left out; ask again withtoset to the first point'sat.GET /locationsshares 100,000 points equally between its accounts, so with more than 5 accounts a trail is cut sooner. - Thinning:
viabelongs to a pair of points. When you thin a trail, keep both points of every step that isn't amove. - Following a trail: ask with
fromset to the last point'sat, and expect overlap. A late message can add points up to 15 minutes back.
Home Assistant
OSRS sensors and automations in Home Assistant with the OSRS Data integration.
The key and its creator GET
The key behind the request (kind, name, prefix, categories, scope, rate limit, expiry), its creator’s display name (`user`, null for a service key) and how many accounts it can see right now. Handy as a connection test.