Attacks & AttacksFull limit | API Development | TORN

Attacks & AttacksFull limit

    • Neodecadente [2238335]
    • Role: Civilian
    • Level: 16
    • Posts: 101
    • Karma: 253
    • Last Action: 1 hour
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Thread created on 19:45:35 - 15/10/24 (1 month ago)
    |
    Last replied 11:38:16 - 16/10/24 (1 month ago)

    I read this in the unofficial documentation and I wanted to confirm. I can't fetch old data from any of these and the documentation says:

     

    attacksfull

    Retrieves the last 1000 attacks, with less details.

    attacks

    Retrieves the last 100 attacks.

     

    So the obvious question is, you can't retrieve more than those limits? I know you can get older (and more limited) data from the logs, but can I get the first mug I received in Torn through these selections?

     

    Thanks for anyone answering!

     

     

    • Mauk [1494436]
    • Role: Civilian
    • Level: 75
    • Posts: 1,735
    • Karma: 5,183
    • Last Action: 3 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 20:00:13 - 15/10/24 (1 month ago)
    Post link copied to clipboard Copy post link

    This is easily missed in the official API documentation, but you can use the query parameters `to` and `from` to effectively page through the results.

     

    The unofficial API docs make these parameters a little more explicit.

    MAUK

    • Neodecadente [2238335]
    • Role: Civilian
    • Level: 16
    • Posts: 101
    • Karma: 253
    • Last Action: 1 hour
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 20:37:34 - 15/10/24 (1 month ago)
    Post link copied to clipboard Copy post link

    I appreciate the help. However I should've specified

     

    If I try this endpoint

     

    https://api.torn.com/user/?selections=attacks&key=0kjXcId---------&from=0&to=1697402076

    Which is from the start of times (1970-01-01) to one year ago (2023-10-15), the result is an empty object. The same goes for attacksfull

    • Omanpx [1906686]
    • Role: Civilian
    • Level: 100
    • Posts: 2,455
    • Karma: 15,758
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 21:12:59 - 15/10/24 (1 month ago)
    Post link copied to clipboard Copy post link

    Neodecadente [2238335]

    I appreciate the help. However I should've specified

     

    If I try this endpoint

     

    https://api.torn.com/user/?selections=attacks&key=0kjXcId---------&from=0&to=1697402076

    Which is from the start of times (1970-01-01) to one year ago (2023-10-15), the result is an empty object. The same goes for attacksfull

    It's janky and i think it might be limited to ~1 year ago, but try using 

    https://api.torn.com/user/?selections=attacks&from=0&sort=asc&key= 

    Toolbox - a collection of my tools and spreadsheets made for Torn.

    Guidebook - a collection of guides i made for Torn.

    • Neodecadente [2238335]
    • Role: Civilian
    • Level: 16
    • Posts: 101
    • Karma: 253
    • Last Action: 1 hour
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 11:38:16 - 16/10/24 (1 month ago)
    Post link copied to clipboard Copy post link

    Neodecadente [2238335]

    I appreciate the help. However I should've specified

     

    If I try this endpoint

     

    https://api.torn.com/user/?selections=attacks&key=0kjXcId---------&from=0&to=1697402076

    Which is from the start of times (1970-01-01) to one year ago (2023-10-15), the result is an empty object. The same goes for attacksfull

    Omanpx [1906686]

    It's janky and i think it might be limited to ~1 year ago, but try using 

    https://api.torn.com/user/?selections=attacks&from=0&sort=asc&key= 

    Thank you! I think it is limited somehow, since this option shows as earliest attack one from October 25th, 2023.

     

    Thanks for the help!

Reply
Thread Title: