Gsheets IMPORTDATA or just getting all "data from APIs"

Hey there,

This one looks so obvious, I can´t get it working.

Using gsheet the function:
=IMPORTDATA("https://intervals.icu/api/athlete/123456/activities.csv?api_key=1234567890123456789";",")

Doesn´t work.

It would be so easy this way to get data into gsheets for further analysis.

Best,
Johannes

You need the v1 link.
Check the Api thread.

Example:
/api/v1/athlete/{id}/activities.csv

My bad, copied the wrong link. Even with

=importdata("https://intervals.icu/api/v1/athlete/i123456/activities.csv?api_key=12345678901234567890";",")

Returning 403 I guess.

Firing a curl commend on the terminal works.

Here’s an example of a Google sheet getting the wellness data from the API. It might help you to do what you want.
I have no experience with Google sheets.

Hi Johannes,

I’m not familiar with that function, but have been playing around with the API through Google sheets quite a bit lately. You’re welcome to have a play with what I’ve pulled together (you’ll need to take a personal copy first to do anything with your own data).

https://drive.google.com/drive/folders/111ji2LYKzKAPIPHKXvpdpxrLlE_f-vNI

3 Likes

Alright! :love_you_gesture: This one makes a day! Awesome.

I wanted to go the “simple” path, using gsheets too easy function IMPORTDATA to avoid what you basically did.

Looks like you´re gathering from all available APIs every small crumb of data.

To be honest, I can´t even tell how much time you saved me now. thx

PS: Adjusted the title now. Others might be interested in your stuff as well.

1 Like

Out of curiosity. I would also need the sync way back from gsheets in order to update Activity Names and Activity Description in a regular manner. As you have the way out. Just asking. thx

I’ve not looked into doing it, so can’t help there unfortunately. If you figure out a way, do please share your solution.