# Help with Google Sheets xml call

**URL:** <https://forums.eveonline.com/t/help-with-google-sheets-xml-call/253316>\
**Category:** Third Party Developers\
**Created:** [July 6, 2020, 4:37pm UTC](https://forums.eveonline.com/t/help-with-google-sheets-xml-call/253316 "2020-07-06T16:37:10Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Apollo\_North](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/apollo_north/32/507639_2.png) [@Apollo\_North](https://forums.eveonline.com/u/Apollo_North)\
**Post date:** [July 6, 2020, 4:37pm UTC](https://forums.eveonline.com/t/help-with-google-sheets-xml-call/253316/1 "2020-07-06T16:37:10Z")

</div>

Hello all o7

I have an industry worksheet on Google Sheets that I want to use to pull market data from Eve Marketer. Here is the situation I need some assistance with.

I am using this formula in cell D2.  
=importxml(“[https://api.evemarketer.com/ec/marketstat?usesystem=30000142&typeid=34","//sell/min](https://api.evemarketer.com/ec/marketstat?usesystem=30000142&typeid=34%22,%22//sell/min)”)

I’m trying to pull the sell/min data from Jita for the item listed in typeid, in this situation it is Tritanium. I get a “Formula Parse Error” with this entered into cell D2.

How do I complete this call? Also, how would I be able to use cell B2 to reference typeid, instead of typing each specific id into every formula?

TIA  
Apollo North

---

<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:** [July 6, 2020, 4:46pm UTC](https://forums.eveonline.com/t/help-with-google-sheets-xml-call/253316/2 "2020-07-06T16:46:37Z")

</div>

It would probably be easier to use [https://market.fuzzwork.co.uk/api/](https://market.fuzzwork.co.uk/api/).

For example, add this function to your script editor:

```auto
/**
* 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';
  const ids = Array.isArray(type_ids) ? type_ids.map(id => id[0]) : [type_ids];
  const fuzz_price_data = JSON.parse(UrlFetchApp.fetch(`https://market.fuzzwork.co.uk/aggregates/?station=60003760&types=${ids.join(',')}`));
  return [['minSell', 'maxBuy']].concat(type_ids.map(type_id => [parseFloat(fuzz_price_data[type_id]['sell']['min']), parseFloat(fuzz_price_data[type_id]['buy']['max'])]));
}

```

You could then use it like `=fuzzApiPriceData(A1:A100)`, and it’ll return the max buy and min sell for each `type_id` in that range.

---

<div class="post-metadata">

**Author:** ![Apollo\_North](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/apollo_north/32/507639_2.png) [@Apollo\_North](https://forums.eveonline.com/u/Apollo_North)\
**Post date:** [July 6, 2020, 4:52pm UTC](https://forums.eveonline.com/t/help-with-google-sheets-xml-call/253316/3 "2020-07-06T16:52:34Z")

</div>

Thank you for the response. I don’t have any experience using scripts in spreadsheets. When I click on Script Editor in my Tools dropdown, a new tab opens that says “Sorry, unable to open the file at this time.”  
So without digging to deep into fixing my google issue, I am trying to learn the function for importxml, so I can adapt and scale my queries upwards as I learn more.

---

<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:** [July 6, 2020, 5:07pm UTC](https://forums.eveonline.com/t/help-with-google-sheets-xml-call/253316/4 "2020-07-06T17:07:24Z")

</div>

> [@Apollo\_North](#):
>
> Sorry, unable to open the file at this time.

> **[i am unable to use option "script editor" in "tools" of google sheets. -...](https://support.google.com/docs/thread/10723995?hl=en)**

Should solve your problem.

---

<div class="post-metadata">

**Author:** ![Apollo\_North](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/apollo_north/32/507639_2.png) [@Apollo\_North](https://forums.eveonline.com/u/Apollo_North)\
**Post date:** [July 6, 2020, 5:31pm UTC](https://forums.eveonline.com/t/help-with-google-sheets-xml-call/253316/5 "2020-07-06T17:31:13Z")

</div>

Thank you for the quick script editor fix. I will poke around and give the script you shared a try.

However, for my own knowledge, I am still hoping to learn what was wrong with the importxml function i posted, and how I would be able to reference a specific cell for typeID.

Cheers

---

<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:** [July 6, 2020, 6:28pm UTC](https://forums.eveonline.com/t/help-with-google-sheets-xml-call/253316/6 "2020-07-06T18:28:34Z")

</div>

> [@Apollo\_North](#):
>
> I am still hoping to learn what was wrong with the importxml function i posted

Your quotes aren’t the right quotes. Try `=importxml("https://api.evemarketer.com/ec/marketstat?usesystem=30000142&typeid=34","//sell/min")`.

> [@Apollo\_North](#):
>
> how I would be able to reference a specific cell for typeID.

Prob something like `importxml("https://api.evemarketer.com/ec/marketstat?usesystem=30000142&typeid="&A1,"//sell/min")`

However, XML is a legacy format. You would be better off learning custom functions and Steve’s JSON API. It’s a bit easier to use, and allows for more flexibility.

---

<div class="post-metadata">

**Author:** ![Apollo\_North](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/apollo_north/32/507639_2.png) [@Apollo\_North](https://forums.eveonline.com/u/Apollo_North)\
**Post date:** [July 6, 2020, 6:53pm UTC](https://forums.eveonline.com/t/help-with-google-sheets-xml-call/253316/7 "2020-07-06T18:53:19Z")

</div>

Thank you so much! You rock.

---

<div class="post-metadata">

**Author:** ![Vasily\_Degtyaryov](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/vasily_degtyaryov/32/176203_2.png) [@Vasily\_Degtyaryov](https://forums.eveonline.com/u/Vasily_Degtyaryov)\
**Post date:** [July 25, 2020, 1:33pm UTC](https://forums.eveonline.com/t/help-with-google-sheets-xml-call/253316/8 "2020-07-25T13:33:50Z")

</div>

This looks neat and worked on first try. Can you tell me how to adapt this to limit the query to orders in Jita, Amarr, Perimeter, etc from another cell reference?

---

<div class="post-metadata">

**Author:** ![ISD\_Sakimura](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/isd_sakimura/32/382213_2.png) [@ISD\_Sakimura](https://forums.eveonline.com/u/ISD_Sakimura)\
**Post date:** [July 25, 2020, 3:38pm UTC](https://forums.eveonline.com/t/help-with-google-sheets-xml-call/253316/9 "2020-07-25T15:38:30Z")

</div>

the _“usesystem=”_ part of the call determines your specific system, though you’ll need to know the systems id number, like _30000142_ = Jita

so your formula would be like this:

> =importxml(“`https://api.evemarketer.com/ec/marketstat?usesystem=`” & \< cell reference \> & “&typeid=” & \< cell reference \>, “//sell/min”)

---

<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:** [July 26, 2020, 7:00pm UTC](https://forums.eveonline.com/t/help-with-google-sheets-xml-call/253316/10 "2020-07-26T19:00:07Z")

</div>

You would just replace the `station=` value with the station ID you want. See the docs at the top of [https://market.fuzzwork.co.uk/api/](https://market.fuzzwork.co.uk/api/).

---

<div class="post-metadata">

**Author:** ![Vasily\_Degtyaryov](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/vasily_degtyaryov/32/176203_2.png) [@Vasily\_Degtyaryov](https://forums.eveonline.com/u/Vasily_Degtyaryov)\
**Post date:** [July 26, 2020, 7:10pm UTC](https://forums.eveonline.com/t/help-with-google-sheets-xml-call/253316/11 "2020-07-26T19:10:09Z")

</div>

Yes, thats how I’m doing it now. I meant, can the function to be changed to ask for a cell with the station name? Like FuzzWhatsItsName(A3:A21, A1) Where the second section asks for the station ID, so that I can make a dropdown for it.

Also, I get weird results using anything but stations. System=[jitacode] or structure=[TTT code] and so on give results that are all the same, perhaps those cluster-wide, but I guess that is another matter.

---

<div class="post-metadata">

**Author:** ![Golden\_Gnu](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/golden_gnu/32/459734_2.png) [@Golden\_Gnu](https://forums.eveonline.com/u/Golden_Gnu)\
**Post date:** [July 26, 2020, 9:18pm UTC](https://forums.eveonline.com/t/help-with-google-sheets-xml-call/253316/12 "2020-07-26T21:18:47Z")

</div>

Fuzzwork only support some stations/systems:

```auto
    Global - 0
    Jita - 30000142
    Perimeter - 30000144
    Jita 4-4 CNAP - 60003760
    Amarr VIII - 60008494
    Dodixie - 60011866
    Rens - 60004588
    Hek - 60005686

```

It does not support the `system` or `structure` parameters (only `region` and `station`)  
Just use `region` for everything supported, that is what I do, it’s fine:

> (Due to how it works, you can give a station or a system as a region, and it will return correctly. These are all precalculated aggregates)

EDIT:  
if you’re using evemarketer, it’s the same, only support `regionlimit` or `usesystem`  
Here is the reference: [https://api.evemarketer.com/ec/](https://api.evemarketer.com/ec/)

---

<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:** [October 24, 2020, 9:18pm UTC](https://forums.eveonline.com/t/help-with-google-sheets-xml-call/253316/13 "2020-10-24T21:18:59Z")

</div>

Closed on October 24, 2020, 9:18pm UTC

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