API Documentation

API Documentation

in API Development

Posted by: Cliff Spradlin.3512

Cliff Spradlin.3512

Lead Programmer

Next

Hi,

Welcome to the API Development forum!

We’re really excited to share these APIs with you. There are already some amazing community apps and websites out there, and we hope that these APIs enhance them and enable new ones to be created.

This thread documents the currently available APIs for use. These APIs are in beta, so don’t be surprised if the interfaces change, but we will try to warn you if we have to make any breaking changes.

All currently available APIs are accessed using simple REST-style HTTP URLs.


API Terms:

These API’s are wholly owned by ArenaNet, LLC (“ArenaNet”). Any use of the API’s must comply with the Website Terms of Use and Content Terms of Use , however you may use the API’s to make commercial products so long as they are otherwise compliant and do not compete with ArenaNet. ArenaNet may revoke your right to use the API’s at any time. In addition, ArenaNet may create and/or amend any terms or conditions applicable to the API’s or their use at any time and from time to time. You understand and agree that ArenaNet is in the process of developing a full license agreement for these API’s and ArenaNet will publish it when it is complete. Your continued use of the API’s constitutes acceptance of the full license agreement and any related terms or conditions when they are posted.


Dynamic Events API – BETA


https://api.guildwars2.com/v1/events.json?world_id=1001

Optional parameters: world_id, map_id, event_id

This API returns an object with an “events” array. Each element contains the world_id, map_id, event_id, and state of an event. The ids can be translated to strings using the APIs listed below. The optional parameters can be used to filter the results to a desired scope of events.

The possible event states are:

  • Active – The event is running now
  • Inactive – The event is not running now
  • Success – The event has succeeded
  • Fail – The event has failed
  • Warmup – The event is waiting for certain criteria to be met before activating
  • Preparation – The criteria for the event to start have been met, but certain activities (such as an NPC dialogue) have not completed yet. After the activites have been completed, the event will become Active.

https://api.guildwars2.com/v1/event_names.json
https://api.guildwars2.com/v1/map_names.json
https://api.guildwars2.com/v1/world_names.json

Optional parameters: lang

Each of these APIs takes an optional querystring parameter “lang”. So for example, if you go to /v1/world_names.json?lang=de the results will be returned in german.

Currently supported languages: en, fr, de, es

These APIs return a JSON array of ids to strings. The ids correspond to ids returned in the events.json API.

The region a world is in can be determined by its world_id:
1xxx – North America
2xxx – Europe


https://api.guildwars2.com/v1/event_details.json

Optional parameters: event_id, lang

Returns detailed information about events. This includes their static starting location in the world. This location is not updated dynamically, so it’s only accurate for events that don’t move.



WvW API – BETA


https://api.guildwars2.com/v1/wvw/matches.json

Returns the currently running WvW matches, and the world ids in each match. The match_id can be used with match_details.json API documented below.


https://api.guildwars2.com/v1/wvw/match_details.json

Required parameter: match_id

Returns details about a match. This information includes the scores on each of the maps, and which team owns each objective. If an objective is held by a guild, the guild_id is also provided.


https://api.guildwars2.com/v1/wvw/objective_names.json

Optional parameter: lang

These APIs return a JSON array of ids to strings. The ids correspond to ids returned in the events.json API.



Item and Recipe Database API – BETA


https://api.guildwars2.com/v1/items.json

Returns a list of all items discovered by players in the game.


https://api.guildwars2.com/v1/item_details.json

Required parameter: item_id
Optional parameter: lang

This API takes an item_id and returns details about the item it represents. The format of the item details returned depends on the type of item represented. Some aspects of the item details will be present for all types of items, and some will be specific to specific item types.


https://api.guildwars2.com/v1/recipes.json

Returns a list of all recipes discovered by players in the game.


https://api.guildwars2.com/v1/recipe_details.json

Required parameter: recipe_id

This API takes an recipe_id and returns details about the recipe it represents.



Guild API – BETA


https://api.guildwars2.com/v1/guild_details.json

Required parameter: guild_id or guild_name

This API takes a guild_name or guild_id. It returns public data about a guild, including its name, tag, and emblem.

The emblem data is currently only the text metadata that can be used to compose the emblem. In the future, we may be able to provide the emblem as an image through this API, but that’s not currently possible.

The colors in emblem data are color IDs that represent an color value. The color IDs can be translated using the color API detailed below. Emblems use the ‘cloth’ material value in the color. We do not currently have an API to resolve foreground_id or background_id to more useful information about the images they represent.



Map API – BETA


https://api.guildwars2.com/v1/continents.json

Optional parameter: lang

Returns a list of continents, and information about each continent. This information is meant to be used in conjunction with the world map tile service, and with the map floor API.


https://api.guildwars2.com/v1/maps.json

Optional parameters: lang, map_id

Returns summary about one or all maps in the game. The summary contains information like the floors that a map is on, and translation data that can be used to translate world coordinates to map coordinates.


https://api.guildwars2.com/v1/map_floor.json

Required parameters: continent_id, floor
Optional parameter: lang

Returns detailed information about a map floor. This data can be used to populate a world map. Any coordinates provided have already been translated to map coordinates, which can be used in conjunction with the world map tile service.

The data provided currently only contains static content. Dynamic content, such as vendors, is not currently available.



Miscellaneous APIs – BETA


https://api.guildwars2.com/v1/build.json

No parameters.

Returns the current build ID. This can be useful for a number of purposes, such as resetting event timers due to server restarts.


https://api.guildwars2.com/v1/colors.json

Optional parameter: lang

Returns all of the colors / dyes in the game, and their color component information.

Colors are represented in their original color shifting form (HSL + contrast/brightness) as well as in RGB form. An example of how to interpret the original form is here: http://jsfiddle.net/cliff/jQ8ga/

The exact color applied to an item depends on its material. The different color/material combinations are enumerated in the API for each color.


https://api.guildwars2.com/v1/files.json

No parameters.

Returns a set of commonly requested in-game assets. These assets can be used to enhance API-derived applications. The results returned this API can be used to fetch assets from the Render service.

(edited by Cliff Spradlin.3512)

API Documentation

in API Development

Posted by: Cliff Spradlin.3512

Previous

Cliff Spradlin.3512

Lead Programmer

Next

World Map Tile Service

The world map tile service provides game map tiles that can be used to present a world map outside of the game. The service is designed to provide tile data in a format compatible with Google Maps, Leaflet, and similar map libraries.

The basic tile format is described here: https://developers.google.com/maps/documentation/javascript/v2/overlays#Google_Maps_Coordinates

A tile can be accessed by constructing a URL in the following form:

https://tiles.guildwars2.com/{continent_id}/{floor}/{z}/{x}/{y}.jpg

A list of valid continents and floors can be downloaded using the continents.json API. The map_floor.json API contains useful information like the size of each floor, and bounding rects. The bounding rects define which tiles are available for download, as well as the area of the map that should presented to the user. Tiles outside of the bounding rect are not available for download.

The map tile service does not currently include map interiors, which are used to provide detailed overlays on some parts of the world map, such as when a character enters a cave.

Additionally, we’re providing the same fonts used for the in-game map for use on the web. These can be referenced through the following two URLs:

It’s allowed and encouraged to link directly to our servers so that you don’t have to download and host the map tiles and fonts.

A very rudimentary example of using this service is available here: http://jsfiddle.net/cliff/CRRGC/

(edited by Cliff Spradlin.3512)

API Documentation

in API Development

Posted by: Cliff Spradlin.3512

Previous

Cliff Spradlin.3512

Lead Programmer

Next

Render Service

The render service provides in-game assets in web-friendly formats.

To use the render service, you need to get a file ID and a signature. Various APIs can be used to find these values (for example, the /files.json API). Once you have these values you can construct a URL to access the file:

https://render.guildwars2.com/file/{signature}/{file_id}.{format}

For example: https://render.guildwars2.com/file/943538394A94A491C8632FBEF6203C2013443555/102478.png

Valid formats:

  • png
  • jpg

API Documentation

in API Development

Posted by: Stephane Lo Presti

Previous

Stephane Lo Presti

Content Marketing Manager, French

Next

Hi everyone,

As explained here, we’re going to progressively move this stickied thread to the official Guild Wars 2 wiki.

The main page for the API documentation will be this one: http://wiki.guildwars2.com/wiki/API:Main
It’s not finalized yet but you can see the structure, split in subpages for each part of the API.

Feel free to join the API editor group on the wiki to add information or maintain the page above ! You can leave comments about this on the forum thread I linked above or directly get in touch with me via forum private messages. Thanks.

(edited by Stephane Lo Presti.7258)

API Documentation

in API Development

Posted by: Anatoli Ingram

Previous

Anatoli Ingram

Content Marketing Specialist

Hi everyone,

We’ve made improvements by streamlining our Content Terms of Use and list of APIs. You can now find our updated Content Terms of Use that covers use of our APIs on our website at: https://www.guildwars2.com/en/legal/guild-wars-2-content-terms-of-use/, our updated Website Terms of Use at: https://www.guildwars2.com/en/legal/website-terms-of-use/, and a full list of our APIs available on the official Guild Wars 2 wiki at: http://wiki.guildwars2.com/wiki/API:Main

The do’s and don’t’s of using the Guild Wars 2 APIs are in one place and easier to understand. We haven’t changed how we’ve been working together, but we have made it clear that you may include the Guild Wars 2 APIs in applications that are sold or contain in app purchases as long as these in compliance with the Content Terms of Use and Website Terms of Use and are not in competition with us.

Thanks.