Jump to content

Item ID to/from Name API & Revised PriceLookup API


Recommended Posts

Posted (edited)

I've had the need to write both of these in a script currently under development. RSBuddy's price API didn't seem to update often enough (or just not return the proper data).

 

The PriceLookup API uses Jagex's JSON API for their website. 

 

The Item ID to/from Name API uses a (relatively modern) list of IDs and Names which I added to database. Simply change the function being executed in the URL and enter the proper argument.

 

Downloads can be found on my website below

http://polycoding.com/osb/

 

37 minutes ago, Trees said:

In order to avoid the overhead of having to make web calls or parsing a text file, I went ahead and made a serialized hashmap of the items. The serialized file can be found here and the code to serialize it can be found here.

 

 

Old School RuneScape Id to/from Name API

Get an item's ID from its name.

http://polycoding.com/osb/itemIdNames.php?getId=ITEM_NAME
Get an item's name from its ID.

http://polycoding.com/osb/itemIdNames.php?getName=ITEM_ID
Polycoding Old School RuneScape Grand Exchange Price Lookup Usage


		public PriceLookup prices = new PriceLookup();

		System.out.println(prices.getPriceById(1333)); //print price for Rune Scimitar by inputting ID

		System.out.println(prices.getPriceByName("rune scimitar")); //print price for Rune Scimitar by inputting name
		
		System.out.println(prices.getId("rune scimitar")); //getting the ID of Rune Scimitar using Polycoding API

 
Edited by Polymorphism
  • Like 3
Posted (edited)
24 minutes ago, Polymorphism said:

I've had the need to write both of these in a script currently under development. RSBuddy's price API didn't seem to update often enough (or just not return the proper data).

 

The PriceLookup API uses Jagex's JSON API for their website. 

 

The Item ID to/from Name API uses a (relatively modern) list of IDs and Names which I added to database. Simply change the function being executed in the URL and enter the proper argument.

 

Downloads can be found on my website below

http://polycoding.com/osb/

 

 


Old School RuneScape Id to/from Name API

Get an item's ID from its name.

http://polycoding.com/osb/itemIdNames.php?getId=ITEM_NAME
Get an item's name from its ID.

http://polycoding.com/osb/itemIdNames.php?getName=ITEM_ID
Polycoding Old School RuneScape Grand Exchange Price Lookup Usage


		public PriceLookup prices = new PriceLookup();

		System.out.println(prices.getPriceById(1333)); //print price for Rune Scimitar by inputting ID

		System.out.println(prices.getPriceByName("rune scimitar")); //print price for Rune Scimitar by inputting name
		
		System.out.println(prices.getId("rune scimitar")); //getting the ID of Rune Scimitar using Polycoding API


 

It's best to use Osbuddy. They update the prices every x seconds. As jagex does every 1min - x (can't remember).  

Kappa I didn't read. From what I can see tho, rsbuddy uses their own prices and their prices are based off of the amount of buys/sells people make through osbuddy.

Edited by Satire
  • Like 1
Posted
13 hours ago, Satire said:

It's best to use Osbuddy. They update the prices every x seconds. As jagex does every 1min - x (can't remember).  

Kappa I didn't read. From what I can see tho, rsbuddy uses their own prices and their prices are based off of the amount of buys/sells people make through osbuddy.

This explains the need i had to just scrape jagex's website.

  • 2 months later...
  • 3 weeks later...
Posted

This is pretty cool :) I remember having a few issues with some personal scripts that I was developing when I wanted to get real-time price data for items which I had no direct way of getting the ID for. I noticed that OSBuddy only seemed to offer an ID-based price grabbing API so, not being motivated to create a system like yours, I just used my inventory listener to map ids to names - a less neat solution. If I had seen this earlier I would have used it. I will keep this page bookmarked for future projects - thanks for this! (:

-Apa

 

  • Like 2
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...