Skip to content
TORNLIFE More

API log timestamp

Started by Delldax [1978647] on in Questions & Answers.

2 replies · 34 views · thread synced · 3 days ago · View on torn.com
About this thread

Posts archived: 3 / 3 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
3
Discussion span
→
People posting
2
Likes on archived posts
4
Authority score
42 / 100
Historical score
15 / 100
Story score
25 / 100
Engagement score
40 / 100
Delldax [1978647]

Hello all, currently trying to get a new script to work but for some reason the api will only let me call my logs from the past 48 hours.

 

is there a limit on how far back i can call or am i missing something.

 

any help is appreciated.

with [2145430]

There is kind of a limit to how far back you can go in the fact that log calls return the most recent 100 (I believe) most recent logs. To search for logs in a different time, you add a different parameter to the log, in the form of a "from" or "to", and a Unix timestamp.

 

For example, https://api.torn.com/user/?selections=log will return the 100 most recent logs.

 

https://api.torn.com/user/?selections=log&to=1736751600 will return the 100 most recent logs, starting from Unix timestamp 1736751600. That timestamp is the new day for today at time of writing, January 13th. 100 most recent logs in this case would be the 100 logs leading up to the new day.

 

Likewise, https://api.torn.com/user/?selections=log&from=1736751600 would do the inverse. It would retrieve the 100 logs right after the new day.

 

The most straightforward way to start getting more logs is to do a second API call with the "to" parameter set to the timestamp of the oldest log.

Delldax [1978647]

thank you very much, that is the exact terminology i was needing. i tried so many different versions of date_start and date_end but never thought to just use from & to