Page last updated: 19 April 2022 05:44

Diablo 2 API

Welcome to 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):

Daily1000
Total100000

Methods

Depending on the endpoint. Check individual endpoints for methods

Response

Response is in JSON Pretty format or XML

Example

https://diablo-2.net/api/items?item=ColossusSword&class=Barbarian&level=99&output=xml - XML reponse

https://diablo-2.net/api/items?item=ColossusSword&class=Barbarian&level=99&output=json - JSON reponse

https://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://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:

https://diablo-2.net/api/items?item=ColossusSword&class=Barbarian&level=99
* Make sure that you have the authentication header present

Query parameters

Try the API call. Also i will use the response of the API to build an image and tooltip and visualize the item


Loading...

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

https://diablo-2.net/api/unique-items?item=TheGrandFather&base-item=colossus_blade&class=Assassin&level=55&strength=75&dexterity=75&theme=d2r&identified=yes&output=json
* Make sure that you have the authentication header present

Query parameters

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

Output

Theme

Loading...

Runes

If you want to query the api for a Rune, do this:

So our entire call will look like this

https://diablo-2.net/api/runes?item=ElRune&level=1
* Make sure that you have the authentication header present

Query parameters

Output

Theme

Loading...

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://diablo-2.net/api/