Skip to content
TORNLIFE More

API question

Started by Quartemioric [3375600] on in Questions & Answers.

3 replies · 76 views · thread synced · 5 days ago · View on torn.com
About this thread

Posts archived: 4 / 4 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
4
Discussion span
→
People posting
2
Likes on archived posts
4
Authority score
43 / 100
Historical score
15 / 100
Story score
27 / 100
Engagement score
46 / 100
Quartemioric [3375600]

Hey gang, wanted to ask if I'm calling the API correctly on something

 

I want to get the 100 most recently bumped threads in General Discussion up until the unix timestamp 1753477825.

This is the request url I've called:

"https://api.torn.com/v2/forum/2/threads?limit=100&sort=DESC&to=1753477825&key="+API_KEY

where API_KEY is my key. Here's the output:

 

etc

so position 0 is the most recently bumped one as returned by the API, which is fedded archives. But, look at general discussion right after I ran my code:

Same thing. The timestamp "1753477825" was about an hour and a half before I called this but it returned the most recent threads up until right now. I bumped a thread to test this and the positions in the returned API data changed:

Am I using the "to" thing wrong?

Blake [2159903]

Yes, the "to" parameter is based off of 'first_post_time' not 'last_post_time'. If you change the "to" parameter to even 1 unix second before the thread's 'first_post_time' it will not be included in the results:

[image: i.imgur.com]

If you want to "get the 100 most recently bumped threads in General Discussion up until the unix timestamp 1753477825" I would take the "to" parameter out of your initial api request and, after requesting, plug the results into a function like this:

[image: i.imgur.com]