Items API
Read-only HTTP access to the game's item database, returning JSON.
About
The items API exposes the game's item prototype data over HTTP. It uses the GET method,
returns JSON, and is read-only. There are no write operations. The HTML pages under /items render the
same data for browsing; this API is the interface for programmatic access.
The API is unversioned and served under /api. Responses may gain fields over time.
Existing fields are not renamed or removed without notice; clients should ignore fields they do not recognize.
Authentication
None. All endpoints are public and read-only. No key, token, or session is required.
URI structure
Resource URIs have the form:
https://theforsakenlands.com/api/items/{resource}
| Component | Example | Description |
|---|---|---|
| base | https://theforsakenlands.com | Scheme and host. HTTPS only. |
| collection | /api/items | The items collection. |
| {resource} | 3021, lookup, enums | An item vnum, or a named sub-resource. |
Requests
All requests are GET over HTTPS. Parameters are supplied in the query string and, unless
stated otherwise, are optional. Reserved characters in parameter values must be percent-encoded. Request bodies are
ignored.
Parameters documented as csv take a comma-separated list, for example
affects=hitroll,damroll.
Responses
Responses are JSON with Content-Type: application/json; charset=utf-8, indented with two
spaces. Fields whose value is empty or zero may be omitted. Collection endpoints wrap their results in an envelope;
single-item endpoints return the item object directly.
Pagination
The /api/items collection is paged at 50 items per page. The page parameter
selects the page and is 1-indexed. The response envelope reports the paging state:
{
"items": [ ... ],
"page": 1,
"total_pages": 3,
"total": 118
}
total is the number of matches across all pages; total_pages is
total divided by 50, rounded up.
Ordering
sort selects the field: name, level, type, or
area. It defaults to level. order selects the direction, asc or
desc, defaulting to asc.
Rate limiting
Requests to /api/items endpoints are limited per client address to 120 per minute
(2 per second), with a burst allowance of 30. Requests over the limit receive 429 Too Many Requests
with a Retry-After header in seconds and the body:
{
"error": "rate limit exceeded",
"retry_after_seconds": 3
}
Successful responses set Cache-Control: 60 seconds for searches, 300 for item detail,
600 for enums. Identical requests within that window may be served from cache without reaching the origin.
Errors
Errors return a JSON body of the form { "error": "message" } with the status code below.
The 429 body additionally carries retry_after_seconds.
| Status | Condition |
|---|---|
| 400 | Malformed request. A vnum that is not an integer, or a missing required parameter such as name. |
| 404 | No item matched the request. |
| 429 | Rate limit exceeded. See the Retry-After header. |
| 503 | The item database is not loaded. |
Resources
Searches the item collection. Returns a paged envelope. Items in the list omit the affects,
resets, and progs arrays; request a single item for those.
| Param | Type | Description |
|---|---|---|
| q | string | Keyword. Matches name and short description. |
| type | string | Item type. Values from /api/items/enums. |
| min_level | int | Minimum level, inclusive. |
| max_level | int | Maximum level, inclusive. |
| wear | string | Wear-slot keyword, e.g. head, wrist, finger. |
| area | string | Area name, exact. |
| class | int | Class restriction index. -2 any, -1 unrestricted, 0+ a class. |
| race | int | Race restriction index. -1 any, 0 unrestricted, 1+ a race. |
| weapon_class | string | Weapon class, e.g. sword, axe, mace. |
| weapon_flags | csv | AND-chained. An item must carry all listed flags. |
| damage_nouns | csv | OR-chained. An item matches any listed noun. |
| affects | csv | Apply-type names, AND-chained. |
| extra_flags | csv | AND-chained. |
| ident | string | Substring match across the full identify text. |
| sort | enum | name, level, type, area. Default level. |
| order | enum | asc, desc. Default asc. |
| page | int | 1-indexed. Default 1. |
| hide_unlinked | 1 | Excludes items only present in unreachable areas. |
{
"items": [
{
"vnum": 3021,
"name": "sword long",
"short_desc": "a long sword",
"item_type": "weapon",
"item_type_num": 5,
"level": 18,
"weight": 120,
"cost": 500,
"condition_pct": 100,
"wear_flags": "take wield",
"area_name": "Midgaard",
"value1": 5, "value2": 3, "value3": 6,
"weapon_class": "sword",
"damage_noun": "slash"
}
],
"page": 1,
"total_pages": 3,
"total": 118
}
Returns one item by vnum, including the affects, resets, and progs arrays.
404 if no such item, 400 if the vnum is not an integer.
{
"vnum": 3021,
"name": "sword long",
"short_desc": "a long sword",
"item_type": "weapon",
"level": 18,
"weight": 120,
"cost": 500,
"area_name": "Midgaard",
"affects": [
{ "apply_type": "hitroll", "modifier": 2, "where": 0 },
{ "apply_type": "damroll", "modifier": 2, "where": 0 }
],
"resets": [
{
"reset_type": "give",
"mob_vnum": 3005,
"mob_name": "a city guard",
"area_name": "Midgaard"
}
],
"progs": []
}
Returns the first item whose name contains name, as a single object. name is required.
404 if nothing matches.
{
"vnum": 3021,
"name": "sword long",
"short_desc": "a long sword",
"item_type": "weapon",
"level": 18
}
Returns the accepted values for the filter parameters. Takes no parameters.
{
"item_types": ["armor", "weapon", "potion", "wand"],
"affect_types": ["hitroll", "damroll", "strength"],
"weapon_classes": ["sword", "axe", "mace"],
"weapon_flags": ["flaming", "sharp"],
"damage_nouns": ["slash", "pierce", "pound"],
"areas": ["Midgaard", "The Frost Giant Vault"],
"extra_flags": ["glow", "hum", "magic"],
"class_restrictions": [],
"race_restrictions": []
}
Item fields
Fields present on an item object. Empty or zero values may be omitted.
| Field | Type | Description |
|---|---|---|
| vnum | int | Unique item id. |
| name | string | Match keywords. |
| short_desc | string | Inventory line. |
| description | string | Appearance on the ground. |
| material | string | Material. |
| item_type / item_type_num | string / int | Type name and its numeric form. |
| level | int | Item level. |
| weight | int | Tenths of a pound. 120 is 12.0 lb. |
| cost | int | Base value in gold. |
| condition_pct | int | Condition, 0 to 100. |
| wear_flags | string | Where it is worn or held. |
| extra_flags | string | Item flags. |
| area_name | string | Source area. |
| value0 .. value4 | int | Type-specific values. Meaning follows item_type. |
| weapon_class / damage_noun / weapon_flags | string | Weapons only. |
| ac_pierce / ac_bash / ac_slash / ac_exotic | int | Armor value per damage kind. |
| class_restrict / race_restrict | int | Restriction indexes, matching the class and race filters. |
| type_info | string | Type summary. |
| spellforge / spellforge_lvl | string / int | Spellforged spell and its level, if any. |
| exclude_flags, cexclude_flags, include_race_flags, include_class_flags | int | Raw restriction bitfields. |
| reset_num / obj_count | int | Spawn count and current count. |
| affects[] | array | Detail only. apply_type, modifier, where, bitvector. |
| resets[] | array | Detail only. reset_type, mob_vnum, mob_name, container_vnum, container_name, room_vnum, area_name. |
| progs[] | array | Detail only. trig_type, description. |
Aabahran