Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Get item name from its ID?


    theknig

    Recommended Posts

    Posted

    Is it possible to get the item name or buy limit from its ID? for example ID=2 will return Cannonball and 11000.
    Thanks

    Posted

    You can get the name by instantiating a new item object: "new Item(id, 1).getName()". To get the buy limit you'd need to query an online database.

    • 4 weeks later...
    Posted

    To follow up on Hashtag's comment - you can use the official OSRS api for pricing (and name to some extent, though it'd be more longwinded than just .getName()).

    Item Prices - https://prices.runescape.wiki/api/v1/osrs/latest?id=2

    Information on how to use - https://oldschool.runescape.wiki/w/RuneScape:Real-time_Prices#Query_parameters

    You can query your item prices here but please don't flood the API by looping through tonnes of IDs, you'd be better off just doing a blind query with no ID set for all items and then looping locally.

     

    Item Details - https://prices.runescape.wiki/api/v1/osrs/mapping

    If you were using the mapping for item names, I'd probably query mapping once at the start then loop through and store item "objects" in a hash map.

     

    • 1 year later...
    • 3 weeks later...
    Posted

    Hey there! It's possible to get the item name and buy limit from its ID. You can use the ID=2 to retrieve the item "Cannonball" and its buy limit 11000. You should use an appropriate API or database to access item information based on their IDs. Also, there are services like this one https://fakeyourdrank.com that help solve the issue when you've lost an ID. Good luck with your item retrieval!

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.