Skip to content
TORNLIFE More

{Function request]API for stock market

Started by AngelOD [2166048] on in API Development.

5 replies · 221 views · thread synced · 5 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
6
Likes on archived posts
6
Authority score
52 / 100
Historical score
25 / 100
Story score
32 / 100
Engagement score
52 / 100
AngelOD [2166048]
I would find it incredibly useful if there was an API that at the very least gave you the current stock prices, if not the stocks I have in each company. Would anyone else find this useful? I could have missed it somewhere in the API's but I don't think so. Hopefully it would be easy for Torn to implement.
saeed [1826888]
what he said

{ "stocks": { "3469178": { "stock_id": 7, "shares": 150000, "bought_price": "502.7396", "time_bought": 1433347670, "time_listed": 0 }, "3470665": { "stock_id": 17, "shares": 100000, "bought_price": "590.52", "time_bought": 1433435524, "time_listed": 0 }, "4522557": { "stock_id": 14, "shares": 100000, "bought_price": "71.0446", "time_bought": 1489591328, "time_listed": 0 },


so on so forth. you'll have to pull the stock id and then call the appropriate section of the api to get the stock name and current price, etc, but meh
shro [1332742]
It's 2 api calls:
1) all stocks (as mentioned above by everyone): https://api.torn.com/torn/?selections=stocks&key=
2) your stocks: https://api.torn.com/user/?selections=stocks&key=
jrm250 [1747448]
As Shro said you will need to do the 2 api calls.

I was recently searching for the same thing and ended up making a Google Sheets for Stocks which should give you the data you want.

https://docs.google.com/spreadsheets/d/1pxVvyzvWmklsPI6RHH8BE2sYfAs1RtMwl5YXXaH29kc/edit?usp=sharing