# 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:** 1\
**Showing post:** 2

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

---

_[View the full topic](https://forums.eveonline.com/t/importjson-to-google-sheets/239043)._
