Jump to content

Item ID to/from Name API & Revised PriceLookup API


Polymorphism

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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
Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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