Skip to content
This repository was archived by the owner on Jun 16, 2019. It is now read-only.

World routes

Stefano Borzì edited this page Jan 3, 2016 · 21 revisions

World Database routes

Here are listed all routes providing information from the world database of TrinityCore:

Creatures

Templates

Given the numeric creature_template.entry {id} of a creature, retrieve all creature template fields using:

/creature/template/{id}

Given a string {name}, retrieve all creatures having the string {name} in their creature_template.name:

/creature/template/{name}

It is possible to optionally pass a string {subname?} in order to further filtering the results, retrieving all creatures having {name} in their creature_template.name and {subname?} in their creature_template.subname:

/creature/template/{name}/{subname?}

For further informations about creature_template fields see TrinityCore documentation of creature_template table.

If you want to retrieve just the name of a creature {id}, you can use:

/creature/template/name/{id}

Equip Templates

Given the numeric creature_template.entry {id} of a creature, retrieve all creature_equip_template fields using:

/creature/equip_template/{id}

For further informations about creature_equip_template fields see TrinityCore documentation of creature_equip_template table.

Template Addons

Given the numeric creature_template.entry {id} of a creature, retrieve all creature_template_addon fields using:

/creature/template_addon/{id}

For further informations about creature_equip_template fields see TrinityCore documentation of creature_template_addon table.

Spawns

You can look for creature spawns by passing the {id} of the creature template (creature_template.entry) and retrieving all spawns of the creature {id}:

/creature/spawn/id/{id}

or by passing the GUID which globally identifies each single spawn:

/creature/spawn/guid/{guid}

Spawns addon

Given the numeric creature_template.entry {id} of a creature, retrieve all creature_addon fields using:

/creature/spawn/addon/id/{id}

Given the numeric creature.guid {guid} of a creature, retrieve all creature_addon fields using:

/creature/spawn/addon/guid/{guid}

For further informations about creature_addon fields see TrinityCore documentation of creature_addon table.

Gameobjects

Templates

Given the numeric gameobject_template.entry {id} of a gameobject, retrieve all gameobject template fields using:

/gameobject/template/{id}

Given a string {name}, retrieve all gameobjects having the string {name} in their gameobject_template.name:

/gameobject/template/{name}

For further informations about gameobject_template fields see TrinityCore documentation of gameobject_template table.

If you want to retrieve just the name of a gameobject {id}, you can use:

/gameobject/template/name/{id}

Spawns

You can look for gameobject spawns by passing the {id} of the gameobject template (gameobject_template.entry) and retrieving all spawns of the gameobject {id}:

/gameobject/spawn/id/{id}

or by passing the GUID which globally identifies each single spawn:

/gameobject/spawn/guid/{guid}

Items

Templates

Given the numeric item_template.entry {id} of an item, retrieve all item template fields using:

/item/template/{id}

Given a string {name}, retrieve all items having the string {name} in their item_template.name:

/item/template/{name}

For further informations about item_template fields see TrinityCore documentation of item_template table.

If you want to retrieve just the name of an item {id}, you can use:

/item/template/name/{id}

If you want to retrieve just the icon name of an item or more items {id}, you can use:

/item/template/icon/{id}

or

/item/template/icon/{id1,id2,id3,...}

Example:

Get icon of 28773 and 28774

/item/template/icon/28773,28774

Enchantment Templates

Given the numeric item_template.entry {id} of an item, retrieve all item enchantment template fields using:

/item/enchantment/{id}

For further informations about item_enchantment_template fields see TrinityCore documentation of item_enchantment_template table.

Quests

Templates

Given the numeric quest_template.id {id} of a quest, retrieve all quest template fields using:

/quest/template/{id}

Given a string {name}, retrieve all quests having the string {name} in their quest_template.title:

/quest/template/{name}

For further informations about quest_template fields see TrinityCore documentation of quest_template table.

If you want to retrieve just the Title of a quest {id}, you can use:

/quest/template/title/{id}

Details

Given the numeric quest_details.ID {id} of a quest, retrieve all quest details fields using:

/quest/details/{id}

Objectives

Given the numeric quest_objectives.QuestID {id} of a quest, retrieve all quest objectives fields using:

/quest/objectives/{id}

Offer Reward

Given the numeric quest_offer_reward.ID {id} of a quest, retrieve all quest offer reward fields using:

/quest/offer_reward/{id}

Quest Poi

Given the numeric quest_poi.QuestID {id} of a quest, retrieve all quest poi fields using:

/quest/poi/{id}

Quest Poi Points

Given the numeric quest_poi_points.QuestID {id} of a quest, retrieve all quest poi points fields using:

/quest/poi/points/{id}

Request Items

Given the numeric quest_request_items.ID {id} of a quest, retrieve all quest request items fields using:

/quest/request_items/{id}

Quest Starters

You can look for quest starter relations by passing the numeric {id} of the creature/gameobject (creature_template.entry or gameobject_template.entry):

/creature/queststarter/id/{id}

/gameobject/queststarter/id/{id}

or by passing the numeric {id} of the quest (quest_template.id):

/creature/queststarter/quest/{id}

/gameobject/queststarter/quest/{id}

furthermore, they will return also the names of creatures or gameobjects (when looking for quest), or quests (when looking for creature or gameobject).

If you don't want to retrieve names, concatenete ?names=0 at the end of the request, for example:

gameobject/queststarter/quest/140?names=0

Quest Enders

You can look for quest ender relations by passing the numeric {id} of the creature/gameobject (creature_template.entry or gameobject_template.entry):

/creature/questender/id/{id}

/gameobject/questender/id/{id}

or by passing the numeric {id} of the quest (quest_template.id):

/creature/questender/quest/{id}

/gameobject/questender/quest/{id}

furthermore, they will return also the names of creatures or gameobjects (when looking for quest), or quests (when looking for creature or gameobject).

If you don't want to retrieve names, concatenete ?names=0 at the end of the request, for example:

/gameobject/questender/quest/94?names=0

Vendors

You can look for vendor relations by passing the {id} of the creature (creature_template.entry) and retrieving all items sold by the creature {id}:

/vendor/creature/{id}

or by passing the {id} of the item, retrieving all creatures that sold the item {id}:

/vendor/item/{id}

with these 2 routes you will get also, respectively, the item names and the creature names.

If you want to get only the npc_vendor fields (without the names) use:

/npc_vendor/creature/{id}

and:

/npc_vendor/item/{id}

For further informations about npc_vendor fields see TrinityCore documentation of npc_vendor table.

Trainers

You can look for trainer relations by passing the {id} of the creature (creature_template.entry) and retrieving all items sold by the creature {id}:

/npc_trainer/creature/{id}

or by passing the {id} of the spell, retrieving all creatures that train the spell {id}:

/npc_trainer/spell/{id}

For further informations about npc_trainer fields see TrinityCore documentation of npc_vendor table.

Loot templates

There are several types of loot templates, all of them and their fields are documented at the TrinityCore documentation of *_loot_template tables.

This API supports the following types of loot templates with the very same syntax:

  • creature
  • reference
  • gameobject
  • item
  • fishing
  • disenchant
  • prospecting
  • milling
  • pickpocketing
  • skinning
  • spell

The syntax is the same for all of them, the loot template routes start with /loot/ followed by the type of the loot template, for example /loot/creature/...

The following examples are showed for the creature loot template, but they are valid for all types of loot templates.

Given the numeric {id} of a creature, you can retrieve the loot template of that creature using:

/loot/creature/{id}

it will also give the item name for each row.

Given the numeric {id} of an item, you can retrieve all the creatures having that item in their loot template using:

/loot/creature/item/{id}

it will give also the entity name (if any) for each row (in the example the entity is creature).

As said before, the syntax for all types of loot template is the same, below there are few examples to enforce this concept.

Retrieve the loot template of the reference {id}:

/loot/reference/{id}

Retrieve all gameobject having an item {id} in their gameobject loot template:

/loot/gameobject/item/{id}

Retrieve all fishing loot template of the fishing zone {id}:

/loot/fishing/{id}

And so on.

Loot template with no additional external fields

As written before, loot routes like:

/loot/creature/{id}

will also give the item name for each row.

If you don't want that additional external field, just use:

/loot/template/creature/{id}

the result is the same without the item name field, which doesn't belong to the *_loot_template table.

SmartAI scripts

You can retrieve all scripts of an entity identified by the couple ({source_type}, {entryorguid}) by using:

/smart_scripts/{source_type}/{entryorguid}

For further informations about smart_scripts fields see TrinityCore documentation of smart_scripts table.