Skip to content
TORNLIFE More

Potential issue with attacks API

Started by Mr_Red [1693261] on in Bugs & Issues.

4 replies · 71 views · thread synced · 6 days ago · View on torn.com
About this thread

Posts archived: 5 / 5 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
5
Discussion span
→
People posting
4
Likes on archived posts
2
Posts by staff, officers and moderators
3
Authority score
55 / 100
Historical score
32 / 100
Story score
35 / 100
Engagement score
43 / 100
Mr_Red [1693261]
I'm experiencing an odd issue with the faction attacks API and was hoping for a quick review to figure out if it's me or the API that's generating the issue.

I'm attempting to pull several thousand records from a given date, my process is to request the first set of 100 records using the link below -
https://api.torn.com/faction/${factionID}?selections=attacks&key=${process.env.TORNAPIKEY}&from=${from}

This is populated with our own faction ID, my own API key and the from date in the correct format.

I then populate the from field with the latest timestamp_ended value to query the next set of 100 records and keep querying every 30 seconds until I've the full range of results that I need.

My experience with this though is that there are always a few records missing from start to finish and the quantity missing seems to differ, despite the API returning no errors and me confirming that all returned records are correctly saved to my database, which makes me think that the API may not be returning the correct records in some cases.
Bug [1455582] Committee Committee
Maybe I'm misinterpreting, but wouldn't using the timestamp the attack started as your new "from" parameter fix this?

If the attack started after the last attack fetched started but before that attack ended then it would be missed from your next selection.
CloudJumper [1636201]Staff
Are you able to provide exact missing records with timestamps and the query that you are using?
CloudJumper [1636201]Staff
Closing the report due to lack of response from OP. Please file a new report if you are still facing any issues. Thanks..!!