Page last updated: 27 October 2023 08:40
Diablo 2 API
Welcome to www.diablo-2.net's API.
Currently this API is exposing only the items endpoint. Others will come soon or when appropriate.
Authentication
Authentication is happening via a request header - X-D2API-KEY and with an api key as a value
Currently, as we are in BETA, If you want a key for yourself, you need to contact me personally via the Contact Form but I have left a key for general use:
X-D2API-KEY : 004fabdaa2a38c2a7a2f9df2e886e1a2f093eb64cea418da9b
Limits
The API enforces the following limits (number of requests made to the endpoint):
Daily | 1000 |
Total | 100000 |
Methods
Depending on the endpoint. Check individual endpoints for methods
Response
Response is in JSON Pretty format or XML
Example
https://www.diablo-2.net/api/items?item=ColossusSword&class=Barbarian&level=99&output=xml - XML reponse
https://www.diablo-2.net/api/items?item=ColossusSword&class=Barbarian&level=99&output=json - JSON reponse
https://www.diablo-2.net/api/items?item=ColossusSword&class=Barbarian&level=99 - Ommited output params defaults to JSON reponse
Endpoints
Here are the active api endpoints
White Items
If you want to query for a normal (white) item from the api, send GET method request to the endpoint https://www.diablo-2.net/api/items with some query parameters that are listed below
Let's say you want to get the stats for white normal Colossus Sword. In this API, Colossus Sword becomes ColossusSword. If you want to recieve a white item the synthax is the following:
Query parameters
- item - format: removed spaces and removed ''. Example: The General's Tan Do Li Ga becomes TheGeneralsTanDoLiGa. Full list for devs - here
- class (case insensitive) - amazon, assassin, necromancer, barbarian, sorceres, paladin, druid
- level - 1 to 99
- output (Optional) - json - for JSON response or xml for xml response. Omitted defaults to json
Try the API call. Also i will use the response of the API to build an image and tooltip and visualize the item
Unique Items
Let's say you want to get the stats for the unique item - The Gladiator's Bane (Wire Fleece). The synthax is very similar to white items and is this:
The Gladiator's Bane becomes TheGladiatorsBane. So your query parameter will be item=GladiatorsBane
But we need a base item too. In this API the base items are underscored. For example Wire Fleece becomes wire_fleece. If base item is Shako - shako. So in our case, wire_fleece. We need to append another query parameter called base-item and add the value. Example: base-item=wire_fleece
So our entire call will look like this
Query parameters
- item - format: removed spaces and removed ''. Example: The General's Tan Do Li Ga becomes TheGeneralsTanDoLiGa
- base-item: spaces and - are replaced with _ and ' are removed. Example: Sacred Armor - sacred_armor, Bec-De-Corbin - bec_de_corbin
- class - (case insensitive) amazon, assassin, necromancer, barbarian, sorceres, paladin, druid
- level - 1 to 99
- identified (Optional) - yes (for identified item) or no (for unidentified item). Will default to identified if ommited
- Strength (Optional) - 1 to 1000. Will default if ommited
- Dexterity (Optional) - 1 to 1000. Will default if ommited
- Theme (Optional) - 'd2r' for D2R and 'legacy' for Legacy. Will default to D2R if ommited
- output (Optional) - json - for JSON response or xml for xml response. Omitted defaults to json
I have not restricted the base items :D This means you can try TheGrandFather sacred_armor (not very meaningful) or TyraelsMight quilted_armor, which is a lot of fun :)
Try the API call. Also i will use the response of the API to build an image and tooltip and visualize the item
Runes
If you want to query the api for a Rune, do this:
So our entire call will look like this
Query parameters
- item - format: removed spaces. Example: Zod Rune becomes ZodRune. Full list for devs - here
- level - 1 to 99
- Theme (Optional) - 'd2r' for D2R and 'legacy' for Legacy. Will default to D2R if ommited
- output (Optional) - json - for JSON response or xml for xml response. Omitted defaults to json
Getting Started
So if you want to get started, download this file and read it. It conains a ready example on fetching a result from the API and vizualizing it as an item.
Page link: https://www.diablo-2.net/api/