RuneScape:Real-time Prices

From Old School RuneScape Wiki
Jump to: navigation, search

We've partnered with RuneLite to bring real-time Grand Exchange prices to the wiki. You can check an item's current prices by clicking the View Real-time Prices on any item article. We plan to add historical real-time price graphs in the near future.

We're also sharing the real-time pricing APIs with the community, in the hope that people will use the data for interesting projects and community-facing tools.

Please be aware that this is a fairly new project, and the endpoints may have downtime, and the prices may not be 100% accurate.

Discord channel[edit source]

If you're planning to use this for some sort of real-time pipeline, please come talk to us in the #api-discussion channel on our Discord so we can keep you informed about future changes and maintenance.

If you react to the message in the #welcome, you'll be able to see the #api-discussion channel.

Acceptable use policy[edit source]

Within reason, we want people to use these APIs as much as they need to build cool projects and tools. We do not explicitly ratelimit any of the endpoints, and we do our best to cache the responses at multiple levels.

However, we reserve the right to limit access to anyone, if their usage is so frequent that it threatens the stability of the entire API. We don't know where that line is right now, but for Grand Exchange prices, it would probably have to be multiple large queries per second for a sustained period. If we end up blocking your tool, feel free to reach out on Discord and we'll see if there's a better solution for what you're doing.

Please set a descriptive User-Agent![edit source]

This is the only thing we ask! If you're using automated tooling to scrape the wiki's APIs, please set a User-Agent that describes what you're using it for, and if you're willing, some sort of contact info (like an email or Discord).

This helps us understand what people are using the APIs for, and helps us reach out in advance if there are any breaking changes coming, or your usage is problematic (or can be improved using bulk modules).

We currently pre-emptively block the following user-agents, and may add more:

  • python-requests
  • Python-urllib
  • Apache-HttpClient
  • RestSharp
  • Java/{version}

See here for how to change the User-Agent in python-requests, which seems to be the dominant tool people are using

An awesome example of a User-Agent would be something like "volume_tracker - @Cook#2222".

Note this does not at all mean you can't use the python-requests library or similar, but we just ask that you set a user-agent in your code.

Routes[edit source]

  • API endpoint: prices.runescape.wiki/api/v1/osrs

Latest price (all items)[edit source]

Get the latest high and low prices for the items that we have data for, and the Unix timestamp when that transaction took place.

Map from itemId (see here for a reference) to an object of {high, highTime, low, lowTime}. If we've never seen an item traded, it won't be in the response. If we've never seen an instant-buy price, then high and highTime will be null (and similarly for low and lowTime if we've never seen an instant-sell).

Query parameters[edit source]

  • id - (optional) Item ID. If provided, will only display the latest price for this item. Example: Abyssal whip

There's almost no scenario where you should be using the id parameter to loop over every item. If you need to get all 3700 item prices, don't hit us with 3700 API requests – just don't use the id parameter. It will result in about 100 times less resources used on both your side and ours.


Mapping[edit source]

Gives a list of objects containing the name, id, examine text, members status, lowalch, highalch, GE buy limit, icon file name (on the wiki).

[
    {"examine":"Fabulously ancient mage protection enchanted in the 3rd Age.","id":10344,"members":true,"lowalch":20200,"limit":8,"value":50500,"highalch":30300,"icon":"3rd age amulet.png","name":"3rd age amulet"},
    ...,
    {"examine":"A powerful staff.","id":22647,"members":true,"lowalch":120000,"limit":10,"value":300000,"highalch":180000,"icon":"Zuriel's staff.png","name":"Zuriel's staff"}
]

Note that this route is not an official part of the API yet. It is subject to change without warning.


5-minute prices[edit source]

Gives 5-minute average of item high and low prices as well as the number traded for the items that we have data on. Comes with a Unix timestamp indicating the 5 minute block the data is from.

Query parameters[edit source]

  • timestamp - (optional) Timestep to return prices for. If provided, will display 5-minute averages for all items we have data on for this time. The timestamp field represents the beginning of the 5-minute period being averaged. Example: [1]

1-hour prices[edit source]

Gives hourly average of item high and low prices, and the number traded.

Query parameters[edit source]

  • timestamp - (optional) Timestep to return prices for. If provided, will display 1-hour averages for all items we have data on for this time. The timestamp field represents the beginning of the 1-hour period being averaged. Example: [2]

Time-series[edit source]

Gives a list of the high and low prices of item with the given id at the given interval, up to 300 maximum.

Query parameters[edit source]

  • id - (required) Item id to return a time-series for.
  • timestep - (required) Timestep of the time-series. Valid options are "5m" and "1h".

Example: [3]

Note: We may paginate the results from this endpoint in the future. For now, this returns at most the last 300 points we have data for.