Application programming interface

**Application programming interfaces**, or APIs, are what developers, fansite operators and bots use to retrieve information about the game and the wiki.

## The RuneScape Wiki

The RuneScape Wiki's API can be accessed here. The API Explorer special page can be used in addition to the documentation that MediaWiki has. Some features are limited to logged in users, system operators, bureaucrats and Wikia staff. For more information, Wikia Inc. provides a wiki about their API and developer program here.

## Grand Exchange Database API

The Grand Exchange Database, like the Bestiary API, is vast. It encompasses the Item Database which shows images of items not purchasable on the Grand Exchange itself and the catalogue information on tradeable items within the Grand Exchange. Queries in the API return JSON (JavaScript Object Notation).

### Configuration

`info` returns the runedate of when the Grand Exchange Database was last updated. The URL for the info query is `https://secure.runescape.com/m=itemdb\_rs/api/info.json`.

### Catalogue

#### category

`category` returns the number of items determined by the first letter. The URL for category queries is `http://services.runescape.com/m=itemdb\_rs/api/catalogue/category.json?category=X` where X is the category identification number as listed below for all possible types. For example, if we want to find all tradeable summoning familiars, we'd go to http://services.runescape.com/m=itemdb\_rs/api/catalogue/category.json?category=9, which would result in

`{"types":[],"alpha":[{"letter":"#","items":0},{"letter":"a","items":6},{"letter":"b","items":8},{"letter":"c","items":1},{"letter":"d","items":3},{"letter":"e","items":2},{"letter":"f","items":3},{"letter":"g","items":5},{"letter":"h","items":2},{"letter":"i","items":5},{"letter":"j","items":0},{"letter":"k","items":1},{"letter":"l","items":2},{"letter":"m","items":5},{"letter":"n","items":1},{"letter":"o","items":1},{"letter":"p","items":4},{"letter":"q","items":0},{"letter":"r","items":3},{"letter":"s","items":27},{"letter":"t","items":2},{"letter":"u","items":1},{"letter":"v","items":5},{"letter":"w","items":2},{"letter":"x","items":0},{"letter":"y","items":0},{"letter":"z","items":0}]}`

#### items

`items` returns the first 12 items in the category given as shown below determined by the first letter. The URL for items queries are `http://services.runescape.com/m=itemdb\_rs/api/catalogue/items.json?category=X&alpha=Y&page=Z` where X is the category identification number, Y is the starting letter (lower case) for the items and Z is the page number beginning at 1. Note that any items that start with a number bust instead use "%23" instead of "#".

For example, if we want to find all tradeable summoning familiars that begin with "c", we'd go to http://services.runescape.com/m=itemdb\_rs/api/catalogue/items.json?category=9&alpha=c&page=1, which would result in

`{"total":89,"items":[{"icon":"http://services.runescape.com/m=itemdb_rs/4856_obj_sprite.gif?id=12091","icon_large":"http://services.runescape.com/m=itemdb_rs/4856_obj_big.gif?id=12091","id":12091,"type":"Familiars","typeIcon":"http://www.runescape.com/img/categories/Familiars","name":"Compost mound pouch","description":"I can summon a compost mound familiar with this.","current":{"trend":"neutral","price":873},"today":{"trend":"neutral","price":0},"members":"true"}]}`

#### detail

`detail` returns current price and price trends information on tradeable items in the Grand Exchange, the category, item image and examine for the given item. The URL for detail queries is `http://services.runescape.com/m=itemdb\_rs/api/catalogue/detail.json?item=X` where X is the ItemID.

For example, if we want the information on steadfast boots, we'd go to http://services.runescape.com/m=itemdb\_rs/api/catalogue/detail.json?item=21787, which would result in

`{"item":{"icon":"http://services.runescape.com/m=itemdb_rs/4856_obj_sprite.gif?id=21787","icon_large":"http://services.runescape.com/m=itemdb_rs/4856_obj_big.gif?id=21787","id":21787,"type":"Miscellaneous","typeIcon":"http://www.runescape.com/img/categories/Miscellaneous","name":"Steadfast boots","description":"A pair of powerful-looking boots.","current":{"trend":"neutral","price":"17.0m"},"today":{"trend":"negative","price":"-897.2k"},"members":"true","day30":{"trend":"positive","change":"+27.0%"},"day90":{"trend":"positive","change":"+30.0%"},"day180":{"trend":"positive","change":"+8.0%"}}}`

#### Images

The Grand Exchange Database can return item images with `obj_big` and `obj_sprite`. These images can sometimes be skewed since it includes items that might not necessarily be seen ingame such as placeholder graphics for most cosmetic overrides from Solomon's General Store, use the mtx pet icon for various pets and the achievement banner in other cases. Many items from Treasure Hunter and Solomon's General Store can be seen before being released in-game by sometimes over a month ahead.

* The URL for obj\_big queries is `http://services.runescape.com/m=itemdb\_rs/obj\_big.gif?id=X` where X is the ItemID.
* The URL for obj\_sprite queries is `http://services.runescape.com/m=itemdb\_rs/obj\_sprite.gif?id=X` where X is the ItemID.

For example, if we want to see the image for Mod Daze's homework, we'd go to http://services.runescape.com/m=itemdb\_rs/obj\_big.gif?id=34775 for a detailed image or http://services.runescape.com/m=itemdb\_rs/obj\_sprite.gif?id=34775 for the inventory icon. Unlike the images as seen in the game, the Grand Exchange Database images have a completely solid line surrounding items, which is different from ingame since there are breaks in images for borders.

Note that item images retrieved outside of the above place the most recent runedate before `obj_big` and `obj_sprite`. When the next system update occurs and `info.json` is updated, the link no longer operates for those that had a runedate in the link.

### Graph

Graph shows the prices each day of a given item for the previous 180 days. The timecode is the number of milliseconds that has passed since 1 January 1970 and the price is the market value of the item for the given day. When no price information is available, then a value of zero is returned.

The URL for a graph is `http://services.runescape.com/m=itemdb\_rs/api/graph/X.json` where X is the ItemID. For example, if we want to know the last 180 days for steadfast boots, we'd go to http://services.runescape.com/m=itemdb\_rs/api/graph/21787.json, where the previous three days, truncated for this article, would start out as

`{"daily":{"1419897600000":15633853,"1419984000000":15475988,"1420070400000":15379017},"average":{"1419897600000":14708793,"1419984000000":14764787,"1420070400000":148288055}}`

## Hiscores

The hiscores can show a players current ranking in their clan, any skill or activity and active and past seasonal events.

### Skills and Activites

#### ranking

`ranking` returns up to the top 50 players in a given skill or activity. The URL for ranking is `http://services.runescape.com/m=hiscore/ranking.json?table=Z&category=Y&size=Z` where Z is the current skill, overall level or activity, Y are skills or activities and Z is the amount requested up to the top 50 players.

For example, if we want to know the top 2 players in the Woodcutting skill we would go to http://services.runescape.com/m=hiscore/ranking.json?table=9&category=0&size=2, which would result in

`[{"name":"Elfinlocks","score":"200,000,000","rank":"1"},{"name":"Cow1337killr","score":"200,000,000","rank":"2"}]`

#### userRanking

`userRanking` returns the current logged in player's rank in the overall hiscores table. The URL for userRanking is http://services.runescape.com/c=0/m=hiscore/userRanking.json where /c=0/ needs to be the current session of the player to view their overall rank.

#### Hiscores Lite

`index_lite` returns a player's rank, level and experience or score in an activity. The URL for index\_lite is http://services.runescape.com/m=hiscore/index\_lite.ws?player=X where X is the player's name.

#### Ironman Lite

`index_lite` returns a player's rank, level and experience or score in an activity. The URL for index\_lite is http://services.runescape.com/m=hiscore\_ironman/index\_lite.ws?player=X where X is the player's name.

#### Hardcore Ironman Lite

`index_lite` returns a player's rank, level and experience or score in an activity. The URL for index\_lite is http://services.runescape.com/m=hiscore\_hardcore\_ironman/index\_lite.ws?player=X where X is the player's name.

### Seasonal

#### getRankings

`getRankings` returns the player's current or previous scores in one or more Seasonal HiScores. The URL for getRankings is http://services.runescape.com/m=temp-hiscores/getRankings.json?player=X where X is the player's name. It can also be used to view previous scores for past seasonals with the URL http://services.runescape.com/m=temp-hiscores/getRankings.json?player=X&status=archived.

#### getHiscoreDetails

`getHiscoreDetails` returns the current or previous Seasonal events. The URL for getHiscoreDetails is http://services.runescape.com/m=temp-hiscores/getHiscoreDetails.json and http://services.runescape.com/m=temp-hiscores/getHiscoreDetails.json?status=archived for previous events.

### Clans

#### clanRanking

`clanRanking` returns the top three clans. The URL for clanRanking is http://services.runescape.com/m=clan-hiscores/clanRanking.json.

#### userClanRanking

`userClanRanking` returns the current logged in player's clan and the rank of the clan. The URL for userClanRanking is http://services.runescape.com/c=0/m=clan-hiscores/userClanRanking.json where /c=0/ needs to be the current session of the player to view their clan's rank.

#### Clan Members Lite

`members_lite.ws` returns a CSV file with a list of clan members, their rank in the clan, their total experience and total kills. The URL for members\_lite.ws is http://services.runescape.com/m=clan-hiscores/members\_lite.ws?clanName=X where X is the name of the clan. The list is sorted by clan ranking starting with Owner and ending with Recruit.

## Old School Hiscores

### Hiscores Lite

`index_lite` returns a player's rank, level and experience or score in an activity. The URL for index\_lite is http://services.runescape.com/m=hiscore\_oldschool/index\_lite.ws?player=X where X is the player's name.

### Ironman Lite

`index_lite` returns a player's rank, level and experience or score in an activity. The URL for index\_lite is http://services.runescape.com/m=hiscore\_oldschool\_ironman/index\_lite.ws?player=X where X is the player's name.

### Ultimate Ironman Lite

`index_lite` returns a player's rank, level and experience or score in an activity. The URL for index\_lite is http://services.runescape.com/m=hiscore\_oldschool\_ultimate/index\_lite.ws?player=X where X is the player's name.

## Solomon's General Store

Solomon's General Store's configuration API lists every past, current and upcoming items for the store. The URL for the configuration query is `https://secure.runescape.com/m=mtxn\_rs\_shop/api/config?context%5B0%5D=0` where context[0]=0 allows players to view the media in the store. It is unsorted without help from secondary programs such as Google Chrome's developer tools to organize the list.

The version number in the API represents the last time the store was updated in milliseconds since 1 January 1970. There are several other API's that the store uses, however as they require players to be logged in to the RuneScape site.

## Website Data

Website data can provide information on a player's friends, their titles and what clan they are in.

### playerDetails

`playerDetails` returns multiple players' titles, their clan, their name and if the clan they are in is recruiting. The URL for playerDetails is http://services.runescape.com/m=website-data/playerDetails.ws?names=%5B%22X%22%5D&callback=jQuery000000000000000\_0000000000&\_=0 where X is the first players name and addition names can be provided by using a comma after X and surrounding them with quotes inside the brackets.

If the request is performed as a JSONP object on the RuneScape site, it can give the world the player is on if the online status is true.

```
$.ajax({
 url:"http://services.runescape.com/m=website-data/playerDetails.ws?names=[%22Name%22]",
 dataType: "jsonp"
});

```

### playerFriendsDetails

`playerFriendsDetails` returns the logged-in player's own friends list. The URL for playerFriendsDetails is http://services.runescape.com/c=0/m=website-data/playerFriendsDetails.json?resultsPerPage=24&currentPage=1&callback=jQuery000000000000000\_0000000000&\_=0 where you must be logged in to view, the max results per request is 24 and the current page shows up to 24 players. It cannot be viewed as a web page. Depending on in-game settings, even when a player is online they might not appear to be online if Private is set to off.

### avatardetails

`avatardetails` returns a player's item information worn when taking a picture at the Photo booth for their Adventurer's Log. The URL for avatardetails is http://services.runescape.com/m=adventurers-log/avatardetails.json?details=X where X is the content of the `appearance.dat` for the player being viewed. The URL for appearance.dat is http://services.runescape.com/m=avatar-rs/X/appearance.dat where X is the player's name.

#### NPCs

Using appearance.dat, players can view the appearances of Jagex Moderators and other players easily. It allows anyone to see any monster, override, equipable items and the item information as an indirect item API. Strings are in the form of bits from 0 to 63 where the order is A-Z, a-z, 0-9, then - and \*.

When an NPC is viewed, there is no information in avatardetails.json and the animation for the NPC. In a javascript console, players can view any NPC that is in the game with:

```
Module.avatar.module.ccall("SetAppearance", "void", ["string"], ["AP--AAA-----------------"]);

```

Where AAA is the NPC ID starting at 0 (Hans) and the next NPC starting at AAE as each NPC takes up four bits. The seventeen dashes following the ID are necessary to prevent from getting bad request messages in their console.

In a javascript console, when clicking on 'Idle' does not work, players can fix the animation of any NPC by using:

```
Module.avatar.SetAnimID(0)

```

Where 0 is the default structure of every NPC. It can sometimes be substituted for the animation IDs for that NPC if they are shown in their bestiary entry. Players might have to re-enter the *SetAppearance* string again to correct any issues.

#### Players

In a javascript console, players can view any other player with:

```
avatarViewer.avatarChange("X")

```

Where X is the other players' character name. This allows a player to view Jagex Moderators and other players that have privacy settings activated. Regardless of privacy settings, along with the full character image and chathead for the forums, the appearance.dat file is always viewable.

Each string can be changed to show equipable items that were not worn during the usage of the Photo Booth. The only way to use a custom string is in a javascript console by using:

```
Module.avatar.module.ccall("SetAppearance", "void", ["string"], ["AAAAAAABcgABHAEmAWEBIgEqAQ6zIwAAAAAAABAQyAAAAAAAAAqL"]);

```

Where the string of letters and numbers can be modified to show different hair styles, default clothing, and worn items. In this string, `AWE` refers to the curtains long hairstyle of the player and can be changed to `AQA`' for a bald hairstyle as 'AWE' are the long curtains hairstyle.

The only item worn in this string is an aura, Daemonheim aura 4, noted by the string `6zIw`. Not all strings are four letters and numbers as many are three letters and numbers. It changes the more items that are visible and whether or not they are recolourable can add complexity to the string.

## Other

### player\_count

`player_count` returns the number of players currently online in RuneScape, Old School RuneScape, and RuneScape Classic. The URL for player\_count is http://www.runescape.com/player\_count.js?varname=iPlayerCount&callback=jQuery000000000000000\_0000000000&\_=0 where the varname is always `iPlayerCount`.

### rsusertotal

`rsusertotal` returns the current amount of accounts created that can access any form of RuneScape. This includes accounts made on FunOrb or a particular version of RuneScape. The URL for rsusertotal is http://services.runescape.com/m=account-creation-reports/rsusertotal.ws?callback=jQuery000000000000000\_0000000000&\_=0.