im trying to learn api to make a automatic system that tracks market item values in google sheets, i dont know where to start. is there any tutorials for complete beginners?
im trying to learn api
Started by bIgfatone [2094425] on in API Development.
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
- 3
- Likes on archived posts
- 2
- Authority score
- 52 / 100
- Historical score
- 24 / 100
- Story score
- 29 / 100
- Engagement score
- 52 / 100
what do you need help with... API usage or actual programming tutorials? the API is used by simple HTTP requests, which is why I assume you are better of looking for tutorials on javascript and jQuery (not necessary but perhaps recommended). As for google sheets integration, this might probably be a good starting point to gain some knowledge: https://developers.google.com/apps-script/overview (easiest method I know of is creating a sheet with code published as a webapp).
The API website contains all you need regarding the API usage, it gives you the URL you need to query for the different endpoints with the selections you want right there so that you can copy paste them in your HTTP requests
The API website contains all you need regarding the API usage, it gives you the URL you need to query for the different endpoints with the selections you want right there so that you can copy paste them in your HTTP requests
from the way I see your application goes, there is several components to it.
1) pull market data from Torn
2) push the market data into a server, could be sql, or heck, you can use csv for it. I'm lazy, so most of the stuff i did are in csv.
3) do some running-average on the market item values (in case some clowns placed $1 for a xanax, i'm sure you don't want that)
4) update the values on google sheet.
I'll try to give you a more detailed walkthrough on 1. my application uses python. so if you're the javascript guy, I would be wasting my time. :p
1) Go to API Website
2) Click on Try It
3) key in your API Key
4) scroll down to Torn, in the Selections TextBox, key in "items", check pretty instead of raw, click on try it.
[image: i.imgur.com]
5) you see a bunch of json script coming out. Assuming you want to track the pricing of a hammer, which is by no coincidence item 1.
6) Scroll up a little to Item Market, you'll need to put in Item ID here. In Item ID, Key in 1, in Selections, Key in bazaar. Check Pretty, you'll get the json configuration for hammer (item ID 1) in bazaar. Do the same for itemmarket by changing the Selections textbox to itemmarket.
6) How you wanna parse the API data is up to you, I'm using python.
To read more on json: https://www.json.org/json-en.html
1) pull market data from Torn
2) push the market data into a server, could be sql, or heck, you can use csv for it. I'm lazy, so most of the stuff i did are in csv.
3) do some running-average on the market item values (in case some clowns placed $1 for a xanax, i'm sure you don't want that)
4) update the values on google sheet.
I'll try to give you a more detailed walkthrough on 1. my application uses python. so if you're the javascript guy, I would be wasting my time. :p
1) Go to API Website
2) Click on Try It
3) key in your API Key
4) scroll down to Torn, in the Selections TextBox, key in "items", check pretty instead of raw, click on try it.
[image: i.imgur.com]
5) you see a bunch of json script coming out. Assuming you want to track the pricing of a hammer, which is by no coincidence item 1.
6) Scroll up a little to Item Market, you'll need to put in Item ID here. In Item ID, Key in 1, in Selections, Key in bazaar. Check Pretty, you'll get the json configuration for hammer (item ID 1) in bazaar. Do the same for itemmarket by changing the Selections textbox to itemmarket.
6) How you wanna parse the API data is up to you, I'm using python.
To read more on json: https://www.json.org/json-en.html
https://www.torn.com/forums.php#/p=threads&f=61&t=16164471
https://www.torn.com/forums.php#/p=threads&f=61&t=16164860
https://www.torn.com/forums.php#/p=threads&f=61&t=16164860