Aabahran

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}
ComponentExampleDescription
basehttps://theforsakenlands.comScheme and host. HTTPS only.
collection/api/itemsThe items collection.
{resource}3021, lookup, enumsAn 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.

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.

StatusCondition
400Malformed request. A vnum that is not an integer, or a missing required parameter such as name.
404No item matched the request.
429Rate limit exceeded. See the Retry-After header.
503The item database is not loaded.

Resources

GET/api/items/{vnum}

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.

GET /api/items/3021
{
  "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": []
}
GET/api/items/lookup

Returns the first item whose name contains name, as a single object. name is required. 404 if nothing matches.

GET /api/items/lookup?name=long+sword
{
  "vnum": 3021,
  "name": "sword long",
  "short_desc": "a long sword",
  "item_type": "weapon",
  "level": 18
}
GET/api/items/enums

Returns the accepted values for the filter parameters. Takes no parameters.

GET /api/items/enums
{
  "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.

FieldTypeDescription
vnumintUnique item id.
namestringMatch keywords.
short_descstringInventory line.
descriptionstringAppearance on the ground.
materialstringMaterial.
item_type / item_type_numstring / intType name and its numeric form.
levelintItem level.
weightintTenths of a pound. 120 is 12.0 lb.
costintBase value in gold.
condition_pctintCondition, 0 to 100.
wear_flagsstringWhere it is worn or held.
extra_flagsstringItem flags.
area_namestringSource area.
value0 .. value4intType-specific values. Meaning follows item_type.
weapon_class / damage_noun / weapon_flagsstringWeapons only.
ac_pierce / ac_bash / ac_slash / ac_exoticintArmor value per damage kind.
class_restrict / race_restrictintRestriction indexes, matching the class and race filters.
type_infostringType summary.
spellforge / spellforge_lvlstring / intSpellforged spell and its level, if any.
exclude_flags, cexclude_flags,
include_race_flags, include_class_flags
intRaw restriction bitfields.
reset_num / obj_countintSpawn count and current count.
affects[]arrayDetail only. apply_type, modifier, where, bitvector.
resets[]arrayDetail only. reset_type, mob_vnum, mob_name, container_vnum, container_name, room_vnum, area_name.
progs[]arrayDetail only. trig_type, description.