how to query all ids at once?

how to query all ids at once?

in API Development

Posted by: Dagins.5163

Dagins.5163

Hello, I would like to query all ids of items at once for market prices, but there is a limit of 200 per query. I tried to use ‘ids=all’, but it doesn’t work. I can do it sequentially, but it takes too long for my taste. I am thinking about doing it with threads, where each thread would query pack of 200 ids.

What is the best way to do this?

PS: I use Python.

Signed, level 1 alt

(edited by Dagins.5163)

how to query all ids at once?

in API Development

Posted by: Eearslya.6309

Eearslya.6309

I’m using PHP in my implementation, but the logic behind my answer is about the same. Simply use /v2/items?page=0&page_size=200 to fetch 200 items at once. You can read the X-Page-Total HTTP header to know how many other pages there are. Then you can fetch all 206 (currently) pages of items with threads and do what you need with them there. /v2/items?page=1&page_size=200 and so on.

Blackgate
Harbinger Tryssa – Revenant

how to query all ids at once?

in API Development

Posted by: smiley.1438

smiley.1438

(edited by smiley.1438)