Skip to content
TORNLIFE More

API Bazaar / ItemMarket

Started by Brizo [2715469] on in Bugs & Issues.

5 replies · 131 views · thread synced · 10 days ago · View on torn.com
About this thread

Posts archived: 6 / 6 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
6
Discussion span
→
People posting
5
Likes on archived posts
8
Posts by staff, officers and moderators
3
Authority score
57 / 100
Historical score
43 / 100
Story score
44 / 100
Engagement score
54 / 100

Most-liked replies

Brizo [2715469]

I'm finding on occassion that the API is returning different results.

 

This is both the ItemMarket endpoint and the Bazaar endpoint

Example below

https://api.torn.com/v2/market/399/itemmarket?key=[Key]&bonus=Any&offset=0

On occassion the total records returned differs. For example, currently it returns 121, however after enough calls, it can return several less - such as 119.
It's very difficult to replicate.

On the flip side

https://api.torn.com/user/[profileID]?selections=bazaar&key=[Key]&comment=TryItPage

 

I've found that the above, can return different data. I thought I was going crazy and wrote a log to see and prove that it's not actually me. Please see attached image

 

Apologies, I attached a lot of data to ensure I wasn't going mad. however 'CValue' causes the ping - which is effectively how much is sold, but the next call has that value in it.

This person has been inactive for over a day, so I know they aren't delisting and relisting.

 

 

I know this issue also isn't exclusive to me, I've had other users building scripts having the same issue.

splent [2088243] Admin Staff

Hey, 

So, after some detailed investigation with Brizo, we found out these are two separate issue. 

The item market "issue" itself is not an issue - this can happen occasionally as players add/remove/sell listings on item market and as a result the position of some items get changed, so they could appear as "missing" between the requests.
You could reduce the next offset by 5 just to make sure to fetch all the items even if they moved (this seems to be working for @Brizo)

The bazaar itself is another issue that I still need to figure out. 

Glasnost [1844049]

Just adding my 2c here that I am seeing this on a lot of bazaar requests I am making, but it seems to drop all bazaar entries rather than just a few. It isn't a common occurrence, but given the quantity of requests I am seeing, I do see them a lot. I have sent a demo response I capture to splent and he pointed me towards this topic.

 

My subjective observation is that it appears more common on bazaars with lots of items listed, but I don't have hard evidence to back this up at the moment or numbers.

splent [2088243] Admin Staff

Hey, 

So recent change to 'market' -> 'itemmarket' highlighted this issue. It helped to point the issue towards the global cache logic.

I believe this issue should now be fixed both for 'user' -> 'bazaar' & 'market' -> 'itemmarket' selections - it looks like for whatever reason the caching wrapper function would occasionally return empty response for the requests setting/regenerating the cache.

 

After finally being able to reproduce this locally, I took slightly different approach which I believe should now always work, but if you notice anything strange again, please do let me know. 

Thanks for your patience!