ImportJSON to Google Sheets

Hello, everyone!
Since have problems (market aggregator return error when trying retrive data with “usesystem”), i try use fuzzwork API, but there not XML :frowning: I am not familiar with programming and can’t figure out how to make Fuzzwork’s API work correctly.
The problem is that I can not import the desired array. For ImportJSON I use this script -
There example of how I try to do it -
Hope someone can help me and sorry for bad english.

* Query's Fuzz market API for the given types
* @param {range} A vertical range of type_ids.
* @return maxBuy and minSell for each type_id
* @customfunction
function fuzzApiPriceData(type_ids) {
  if (!type_ids) throw 'type_ids is required';
  var type_ids = Array.isArray(type_ids) ? { return id[0]; }) : [type_ids];
  var fuzz_price_data = JSON.parse(UrlFetchApp.fetch("" + type_ids.join(',')));
  return [['minSell', 'maxBuy']].concat( { return [parseFloat(fuzz_price_data[type_id]['sell']['min']), parseFloat(fuzz_price_data[type_id]['buy']['max'])]; }));

Can copy/paste this into your sheets script editor, Tools => Script Editor.

Then you can use it by passing it a vertical range of IDs to get prices for. By default the function is getting min sell and max buy in Jita.


Suggested way to use this would be have a sheet for static data, like type_id and type_name, then use this function to get price data for those items. This would allow you to then easily use vlookup to get the prices/name of a type_id.

1 Like

Thank you! It’s working. I suppose this will not work with Perimeter (system) or Tranquillty Trading Tower (structure)?

See for handling structures.

1 Like

this function returns me an error:
ReferenceError: GESI is not defined (line 10).

Ah yes, you’ll need to install GESI. Can follow these steps:

1 Like

Oh. I fogget to Add a library. Now it’s work perfect!
BTW, this function get data from ESI without any of agreggator? Not depending on Fuzzwork status?

Correct. However because of that, it’s not as easy to use (only 1 ID at a time). Also sheets has a limit on the number of requests that can be made per day. So just be mindful of that.

I did link this on the api page on my site. along with a sample sheet.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.