# ImportJSON to Google Sheets

**URL:** <https://forums.eveonline.com/t/importjson-to-google-sheets/239043>\
**Category:** Third Party Developers\
**Created:** [May 7, 2020, 11:04am UTC](https://forums.eveonline.com/t/importjson-to-google-sheets/239043 "2020-05-07T11:04:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xao\_Acakypa](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/xao_acakypa/32/203604_2.png) [@Xao\_Acakypa](https://forums.eveonline.com/u/Xao_Acakypa)\
**Post date:** [May 7, 2020, 11:04am UTC](https://forums.eveonline.com/t/importjson-to-google-sheets/239043/1 "2020-05-07T11:04:19Z")

</div>

Hello, everyone!  
Since [evemarketer.com](http://evemarketer.com) have problems (market aggregator return error when trying retrive data with “usesystem”), i try use fuzzwork API, but there not XML ☹ 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 - [https://gist.github.com/paulgambill/cacd19da95a1421d3164](https://gist.github.com/paulgambill/cacd19da95a1421d3164)  
There example of how I try to do it - [https://docs.google.com/spreadsheets/d/1ToqiEqkYUu3jzbNK-LjDT5kyQF6kG7p9N7PvwsNQUVs/edit?usp=sharing](https://docs.google.com/spreadsheets/d/1ToqiEqkYUu3jzbNK-LjDT5kyQF6kG7p9N7PvwsNQUVs/edit?usp=sharing)  
Hope someone can help me and sorry for bad english.

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [May 7, 2020, 1:06pm UTC](https://forums.eveonline.com/t/importjson-to-google-sheets/239043/2 "2020-05-07T13:06:32Z")

</div>

```
/**
* 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) ? type_ids.map(function(id) { return id[0]; }) : [type_ids];
  var fuzz_price_data = JSON.parse(UrlFetchApp.fetch("https://market.fuzzwork.co.uk/aggregates/?station=60003760&types=" + type_ids.join(',')));
  return [['minSell', 'maxBuy']].concat(type_ids.map(function(type_id) { 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.

`=fuzzApiPriceData(A1:A500)`

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`.

---

<div class="post-metadata">

**Author:** ![Xao\_Acakypa](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/xao_acakypa/32/203604_2.png) [@Xao\_Acakypa](https://forums.eveonline.com/u/Xao_Acakypa)\
**Post date:** [May 7, 2020, 1:38pm UTC](https://forums.eveonline.com/t/importjson-to-google-sheets/239043/3 "2020-05-07T13:38:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [May 7, 2020, 1:39pm UTC](https://forums.eveonline.com/t/importjson-to-google-sheets/239043/4 "2020-05-07T13:39:28Z")

</div>

See [https://pr.reddit.com/r/evetech/comments/get652/spreadsheets\_are\_hard/fprlp7n/](https://pr.reddit.com/r/evetech/comments/get652/spreadsheets_are_hard/fprlp7n/) for handling structures.

---

<div class="post-metadata">

**Author:** ![Xao\_Acakypa](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/xao_acakypa/32/203604_2.png) [@Xao\_Acakypa](https://forums.eveonline.com/u/Xao_Acakypa)\
**Post date:** [May 7, 2020, 1:56pm UTC](https://forums.eveonline.com/t/importjson-to-google-sheets/239043/5 "2020-05-07T13:56:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [May 7, 2020, 1:57pm UTC](https://forums.eveonline.com/t/importjson-to-google-sheets/239043/6 "2020-05-07T13:57:32Z")

</div>

Ah yes, you’ll need to install GESI. Can follow these steps: [https://github.com/Blacksmoke16/GESI#script-editor](https://github.com/Blacksmoke16/GESI#script-editor).

---

<div class="post-metadata">

**Author:** ![Xao\_Acakypa](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/xao_acakypa/32/203604_2.png) [@Xao\_Acakypa](https://forums.eveonline.com/u/Xao_Acakypa)\
**Post date:** [May 7, 2020, 2:08pm UTC](https://forums.eveonline.com/t/importjson-to-google-sheets/239043/8 "2020-05-07T14:08:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [May 7, 2020, 2:12pm UTC](https://forums.eveonline.com/t/importjson-to-google-sheets/239043/9 "2020-05-07T14:12:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Steve\_Ronuken](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/steve_ronuken/32/373894_2.png) [@Steve\_Ronuken](https://forums.eveonline.com/u/Steve_Ronuken)\
**Post date:** [May 7, 2020, 6:59pm UTC](https://forums.eveonline.com/t/importjson-to-google-sheets/239043/10 "2020-05-07T18:59:27Z")

</div>

> <https://github.com/fuzzysteve/eve-googledocs-script/blob/master/FuzzworkMarket.gs>

I did link this on the [api page on my site](https://market.fuzzwork.co.uk/api/). along with a sample sheet.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/eveonline/original/3X/4/1/41ec4921cbaca7a6f9ea556e7cc20018461eae5e.png) [@system](https://forums.eveonline.com/u/system)\
**Post date:** [August 5, 2020, 6:59pm UTC](https://forums.eveonline.com/t/importjson-to-google-sheets/239043/11 "2020-08-05T18:59:29Z")

</div>

Closed on August 5, 2020, 6:59pm UTC

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