bradjasper / ImportJSON

Import JSON into Google Sheets, this library adds various ImportJSON functions to your spreadsheet
GNU Lesser General Public License v3.0
2.1k stars 1.06k forks source link

How to add Api Key header #235

Open Carlos-OL opened 2 years ago

Carlos-OL commented 2 years ago

Hello. Thank you so much for your code. It has proved to be extremely helpful for so many tasks. I do have a question though. Which function should I use and how should I add a header to include my API key?

https://docs.opensea.io/reference/asset-listings

I have tried ImportJsonPost but it doesn't seem to work.
The URL in question is:

image

My current formula (not working) is:

=ImportJSONViaPost("https://api.opensea.io/api/v1/asset/0x8EE5DD62A654a60f6F17A99d544102f37B58dA26/256/listings","X-API-KEY=9d1749851941443d97XXXXXXXXX")

Thank you

Gilles-H commented 2 years ago

Hi Carlos. I was stuck with this too. Not sure if you've sorted it but looks like there are newer projects addressing this. Now using https://github.com/qeet/importjsonapi

=IMPORTJSONAPI("https//...", "$.*", "column1, column2, column3", "headers={'API-key':'mykey'}")