I'm not familiar with JSON in spreadsheets, but is this making a request per field that is using it? Or is it making one request and then referencing stored data somehow? If the first one, you're gonna have to be incredibly careful with it.
The way around this would be to use one page/tab of the spreadsheet to dump all variables from a particular selection and then a second tab to display the info as you want it
For example, you could use =ImportJSON(http://api.torn.com/user/?selections=profile&key={APIKEYHERE}")
This will then dump all the User/profile variables into the page in one call and help avoid hitting the request limit
Then use a second spreadsheet tab to display what you want
How would I limit the function to only output the first entry? I want to pull multiple items at the same time, but I want to avoid having like 10 sheets in the same workbook.
Sorry for the noob question, as I am very new to all this api stuff.
Can something like this be done but for excel?
I've seen people build spreadsheets for EVE Online in excel using api links and import data from web, however when I try this for the Torn API it just asks me to save it as a JSON.
Is there a simple way of doing it? Or shall I just leave it well alone?
I've got this working with pricing data, which is exactly what I wanted. Thanks for that. :)
In an effort to reduce the data imported, just to clean things up a bit, is there a way to import only the first(and therefore lowest) item price, and simply not include any further data in the imported array? This isn't even strictly necessary, more of a curiosity for me. Thanks in advance. Nevermind, I see someone has already asked that, and the answer is no simple way.
I should probably also add that I can't get "noHeaders" to work...
This works: =importJSON("https://api.torn.com/market/258?selections=&key=APIKEY)
This doesn't: =importJSON("https://api.torn.com/market/258?selections=&key=APIKEY", "noHeaders")
Nor does this: =importJSON("https://api.torn.com/market/258?selections=&key=APIKEY", "rawHeaders,noHeaders")
Any idea what API link you can use which will show only the cheapest of say item 258 rather than showing all the listings?
Also is there a way using =importJSON("https://api.torn.com/user/1976144?selections=personalstats&key=APIKEY") that rather than it all going across in columns to have it going down in rows?
Beefcake, what I did to get only the cheapest item was to just load the item info into an entirely different sheet, and then just reference that first cell, with the cheapest price in it from whichever sheet I needed to have the info in. Works just fine.
I'm still looking for a way to use this to import current stock prices. I get an error when using it with the "Torn" API option(shown at the bottom of the API "try it!" page), with "stocks" as the selection.
Also, on a slightly off topic note: does anyone know of a way to pull item prices from other countries? Drugs, specifically. Is there even a way to do that with the API? Is there a way to do it with a different API? Does travelrun have an API?(heard a rumor that it did, but haven't seen one anywhere yet)