# ESI Excel login

**URL:** <https://forums.eveonline.com/t/esi-excel-login/209096>\
**Category:** Third Party Developers\
**Created:** [December 30, 2019, 11:10am UTC](https://forums.eveonline.com/t/esi-excel-login/209096 "2019-12-30T11:10:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nilaim](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/nilaim/32/254156_2.png) [@Nilaim](https://forums.eveonline.com/u/Nilaim)\
**Post date:** [December 30, 2019, 11:10am UTC](https://forums.eveonline.com/t/esi-excel-login/209096/1 "2019-12-30T11:10:28Z")

</div>

Hello all,

I am trying to find a guide on how to login from Excel to query ESI. I am fine with the ESI API side of things which is well described on the esi evetech net website. I have also set up my app at developers eveonline com.  
The difficulty is how to login and manage the token exchange from excel prior to the queries.

It seems there used to be a guide on wiki zancha space, but the site is offline… Can anyone enlighten me please?

I have an excel SS for all my indie stuff that I used to use with data pulled out of api eveonline com and eve-central com. Unfortunately both are gone, good things cannot last forever…

---

<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:** [December 30, 2019, 2:05pm UTC](https://forums.eveonline.com/t/esi-excel-login/209096/2 "2019-12-30T14:05:52Z")

</div>

I’m not sure of the capabilities of Excel (via custom functions or whatever that is) but one option would be to generate a refresh token outside of Excel, then just store that. This way you wouldn’t have to setup the whole OAuth flow within Excel. Probably would then be doable to check if your cached access token is expired, and refresh it with the stored refresh token if needed.

> **[Using ESI with Google Sheets - Fuzzwork Enterprises](https://www.fuzzwork.co.uk/2017/03/14/using-esi-google-sheets/)**
>
> I’ve been meaning to write this post for a while now, so here it finally is; How to use ESI, with google sheets. Now, the unauthenticated endpoints are relatively easy. You’ll still need to write a little code for them, or steal it from somewhere...

@Steve_Ronuken Made a blog post a while ago related to Google Sheets, however his `Setup` and `Postman` steps would be pretty much what you would have to do; of course storing the tokens in Excel versus Sheets.

---

<div class="post-metadata">

**Author:** ![Nilaim](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/nilaim/32/254156_2.png) [@Nilaim](https://forums.eveonline.com/u/Nilaim)\
**Post date:** [December 30, 2019, 4:33pm UTC](https://forums.eveonline.com/t/esi-excel-login/209096/3 "2019-12-30T16:33:43Z")

</div>

> storing the tokens in Excel versus Sheets

This is precisely the part I need help with.  
I can run queries that require no characterID from Excel, Postman can manually get me the tokens, but how to use them in Excel?  
Alternatively is there a way to use the excel login modes or http headers that the Data → From Web supports? This seems infinitely easier.

Does anyone has the guide that was available at Wiki Zancha Space?

---

<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:** [December 30, 2019, 5:46pm UTC](https://forums.eveonline.com/t/esi-excel-login/209096/4 "2019-12-30T17:46:14Z")

</div>

> [@Nilaim](#):
>
> Does anyone has the guide that was available at Wiki Zancha Space?

[https://web.archive.org/web/20190310221844/https://wiki.zansha.space/index.php/SSO\_Authentication\_in\_Microsoft\_Power\_Query](https://web.archive.org/web/20190310221844/https://wiki.zansha.space/index.php/SSO_Authentication_in_Microsoft_Power_Query)

---

<div class="post-metadata">

**Author:** ![Nilaim](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/nilaim/32/254156_2.png) [@Nilaim](https://forums.eveonline.com/u/Nilaim)\
**Post date:** [December 30, 2019, 11:51pm UTC](https://forums.eveonline.com/t/esi-excel-login/209096/5 "2019-12-30T23:51:41Z")

</div>

Thanks a lot. I managed to get my assets into an excel table.

Next problem is being able to read all the assets and not just 1000… I have seen a post from you on this:

> It’s not really a big deal. You just check the `X-Pages` header, and loop n times, concatenating results to an array so you end up with one singular array of all the data.

How can I do this ( **1** - Check X-Pages header and **2** -concatenate)?

---

<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:** [December 30, 2019, 11:58pm UTC](https://forums.eveonline.com/t/esi-excel-login/209096/6 "2019-12-30T23:58:09Z")

</div>

I’m not sure how you would go about doing it in Excel but I’m sure there is a way. Sorry 😕

---

<div class="post-metadata">

**Author:** ![Sally\_Ann\_Anderson](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/sally_ann_anderson/32/389116_2.png) [@Sally\_Ann\_Anderson](https://forums.eveonline.com/u/Sally_Ann_Anderson)\
**Post date:** [January 23, 2020, 12:02pm UTC](https://forums.eveonline.com/t/esi-excel-login/209096/7 "2020-01-23T12:02:14Z")

</div>

I have never been able to figure out how to get the page numbers from the header, but you can set this as a hard parameter in the query code. Depending on how you have the query setup you can add a custom column that acts as the page number, you just need to estimate how many pages there might be. I have found that 6 is an ok number of I have exceed this ever, for both character and corpID pulls.

#“Add Custom” = Table.AddColumn(#“Change Type”, “Custom”, each {1…6}),  
#“Expand Custom” = Table.ExpandlistColumn(#“Add Custom”, “Custom”),  
#“Rename Columns” = Table.RenameColumns(#'Expand Custom",{{“Custom”, “Page”}}),

So if you are retrieving the asset information from one character, this will add 6 rows with a page number of 1 through 6. From this you can invoke a modified call to retrieve the asset list. The main thing with this is even if the there is only 2 pages, pages 3, 4, 5, 6 do not exist, the return error is ignored so does not effect the functionality of the call.

This is the invoke function that I use  
let  
Source = (AccessToken, CharacterID, Page) =\>  
let  
Source = Json.Document(Web.Contents(“[https://esi.evetech.net/latest/characters/](https://esi.evetech.net/latest/characters/)”& Number.ToText(CharacterID) &"/assets/?datasource=tranquility&page="& Number.ToText(Page) &"&token="& (AccessToken) &"&user\_agent=XXXXXXX"))

in  
Source  
in  
Source  
This will return a list of itemsID and Quantity for each row (page) of the query which can be expanded and then manipulated to display what you want.

If you are still having an issue with the SSO esi tokens let me know I have a step by step on how to set this up for multiple characters.

---

<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:** [January 26, 2020, 12:43am UTC](https://forums.eveonline.com/t/esi-excel-login/209096/8 "2020-01-26T00:43:42Z")

</div>

FWIW it looks like you would have to create a custom data connector to do it?

See [https://community.powerbi.com/t5/Desktop/Retrieve-API-response-headers/m-p/641107/highlight/true#M307053](https://community.powerbi.com/t5/Desktop/Retrieve-API-response-headers/m-p/641107/highlight/true#M307053)

---

<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:** [April 25, 2020, 12:43am UTC](https://forums.eveonline.com/t/esi-excel-login/209096/9 "2020-04-25T00:43:42Z")

</div>

Closed on April 25, 2020, 12:43am UTC

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