Get item from API using item name?
UnknownFreak.2805:
Hio!
I’m currently working on a overlay project, and was wondering if you can easily get the item from v2/items by using a item name, how should I do this?
Was thinking of making a map of <itemName,itemID>, but that will require me to go trough every item id in the item list, and that is a bit tedious, I can do it, and then save every <itemName, itemID> locally, so I can access it faster next time.
Or will it be possible to add a search to v2/items by name?
smiley.1438:
Simply put: you will need your own database to do a reverse search.
Lawton Campbell.8517:
that will require me to go trough every item id in the item list, and that is a bit tedious
It’s a lot faster if you paginate through all the items, e.g. /v2/items?page=0&page_size=200. The total number of pages is returned in the X-Page-Total response header (or you can continue until you get a “no more pages” error). I’d recommend doing this nightly since items don’t appear in the list until they’re discovered by players, which happens fairly regularly.
UnknownFreak.2805:
Ok, will try that