Skip to content
TORNLIFE More

Need help with API

Started by TTTZ [2572033] on in API Development.

5 replies · 168 views · thread synced · 6 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
3
Likes on archived posts
2
Authority score
51 / 100
Historical score
19 / 100
Story score
28 / 100
Engagement score
49 / 100
TTTZ [2572033]
I need to get status (online/offline and traveling/hospital[optional]) of many players automatically updated to my Google Spreadsheet.

If u know how to get status of players and put it into Google Spreadsheet or something I can import from, u can help me really much and be credited.

Also market values of tons of items would be great(optional)
Mephiles [2087524]
To get statuses of players, you need to make a separate request to fetch their info (1/user). This means that you can do maximum 100 user requests/minute as the API request limit is 100.

To get item market values, then you need to do 1 request per minute to fetch the item list that also contains their market value.

All requests and URLs can be found @ www.torn.com/api.html -> try it -> User -> enter User ID. or ... -> Torn -> selections: items

EDIT: -Rascal- already got ahead of me. If the users are in a faction/company then you can get all their statuses with 1 request but that also means you have API access in case of factions.
Mephiles [2087524]
All selections are under "Available fields" the names of fields are quite straightforward. Sometimes to find the thing you need, it just comes down to testing and looking through them to find what you need.

To get the status of a player, use the URL "
https://api.torn.com/user/[USER ID]?selections=&key=[API KEY]".
Torn's item list: "
https://api.torn.com/torn/?selections=items&key=[API KEY]
"
kYo [2106640]
To add on, you don't need to be in same faction. Mephiles solution will work if you're targetting one individual or random individual who are not in same faction or company, and that's the right way to go.

But if they're in the same faction, like 9357 (your faction)
https://api.torn.com/faction/9357?selections=&key=
[API KEY]


or company, like 84456 (your company)
https://api.torn.com/company/84456?selections=&key=
[API KEY]