Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
APIRT
Regular Visitor

Connect to API via Power Query troubleshot

Hello guys,

I'm having a little troble connecting to the Hevy app API via Power Query.

I've read the documentation they provide and watched other peoples videos and examples but so far I haven't had any luck.

I also have available the curl in the below link:

Here the documentation: https://api.hevyapp.com/docs/  I would like to use the table "/v1/workouts/events"

 

Thank you very much!

 

PS: More info just in case (I should be able to connect using only the information below:)

 

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Use Anonymous auth.

 

 

let
    Source = Json.Document(Web.Contents("https://api.hevyapp.com", [RelativePath="v1/workouts",Query=[page="1",pageSize="5"],Headers=[accept="application/json", #"api-key"="do not share on the interwebs"]])),
    #"Converted to Table" = Table.FromList(Source[workouts], Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "title", "description", "start_time", "end_time", "updated_at", "created_at", "exercises"}),
    #"Expanded exercises" = Table.ExpandListColumn(#"Expanded Column1", "exercises"),
    #"Expanded exercises1" = Table.ExpandRecordColumn(#"Expanded exercises", "exercises", {"index", "title", "notes", "exercise_template_id", "superset_id", "sets"}, {"index", "title.1", "notes", "exercise_template_id", "superset_id", "sets"}),
    #"Expanded sets" = Table.ExpandListColumn(#"Expanded exercises1", "sets"),
    #"Expanded sets1" = Table.ExpandRecordColumn(#"Expanded sets", "sets", {"index", "set_type", "weight_kg", "reps", "distance_meters", "duration_seconds", "rpe"}, {"index.1", "set_type", "weight_kg", "reps", "distance_meters", "duration_seconds", "rpe"})
in
    #"Expanded sets1"

 

 

Please do not share your API key on the interwebs!

View solution in original post

Anonymous
Not applicable

Hi @APIRT ,

 

Here I agree with lbendlin, I can connect to the REST API with his code.
According to your request url, you just need to add a since parameter in Query.

let
    Source = Json.Document(Web.Contents("https://api.hevyapp.com", [RelativePath="v1/workouts",Query=[page="1",pageSize="5",since="1970-01-01T00:00:00Z"],Headers=[accept="application/json", #"api-key"="..."]])),
    #"Converted to Table" = Table.FromList(Source[workouts], Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "title", "description", "start_time", "end_time", "updated_at", "created_at", "exercises"}),
    #"Expanded exercises" = Table.ExpandListColumn(#"Expanded Column1", "exercises"),
    #"Expanded exercises1" = Table.ExpandRecordColumn(#"Expanded exercises", "exercises", {"index", "title", "notes", "exercise_template_id", "superset_id", "sets"}, {"index", "title.1", "notes", "exercise_template_id", "superset_id", "sets"}),
    #"Expanded sets" = Table.ExpandListColumn(#"Expanded exercises1", "sets"),
    #"Expanded sets1" = Table.ExpandRecordColumn(#"Expanded sets", "sets", {"index", "set_type", "weight_kg", "reps", "distance_meters", "duration_seconds", "rpe"}, {"index.1", "set_type", "weight_kg", "reps", "distance_meters", "duration_seconds", "rpe"})
in
    #"Expanded sets1"

It works well in my test as well.

vrzhoumsft_0-1724744970341.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

6 REPLIES 6
lbendlin
Super User
Super User

Use Anonymous auth.

 

 

let
    Source = Json.Document(Web.Contents("https://api.hevyapp.com", [RelativePath="v1/workouts",Query=[page="1",pageSize="5"],Headers=[accept="application/json", #"api-key"="do not share on the interwebs"]])),
    #"Converted to Table" = Table.FromList(Source[workouts], Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "title", "description", "start_time", "end_time", "updated_at", "created_at", "exercises"}),
    #"Expanded exercises" = Table.ExpandListColumn(#"Expanded Column1", "exercises"),
    #"Expanded exercises1" = Table.ExpandRecordColumn(#"Expanded exercises", "exercises", {"index", "title", "notes", "exercise_template_id", "superset_id", "sets"}, {"index", "title.1", "notes", "exercise_template_id", "superset_id", "sets"}),
    #"Expanded sets" = Table.ExpandListColumn(#"Expanded exercises1", "sets"),
    #"Expanded sets1" = Table.ExpandRecordColumn(#"Expanded sets", "sets", {"index", "set_type", "weight_kg", "reps", "distance_meters", "duration_seconds", "rpe"}, {"index.1", "set_type", "weight_kg", "reps", "distance_meters", "duration_seconds", "rpe"})
in
    #"Expanded sets1"

 

 

Please do not share your API key on the interwebs!

Thanks for the response but it's not working. THe data is associated to a user and an account.

That's why the API

Anonymous
Not applicable

Hi @APIRT ,

 

Here I agree with lbendlin, I can connect to the REST API with his code.
According to your request url, you just need to add a since parameter in Query.

let
    Source = Json.Document(Web.Contents("https://api.hevyapp.com", [RelativePath="v1/workouts",Query=[page="1",pageSize="5",since="1970-01-01T00:00:00Z"],Headers=[accept="application/json", #"api-key"="..."]])),
    #"Converted to Table" = Table.FromList(Source[workouts], Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "title", "description", "start_time", "end_time", "updated_at", "created_at", "exercises"}),
    #"Expanded exercises" = Table.ExpandListColumn(#"Expanded Column1", "exercises"),
    #"Expanded exercises1" = Table.ExpandRecordColumn(#"Expanded exercises", "exercises", {"index", "title", "notes", "exercise_template_id", "superset_id", "sets"}, {"index", "title.1", "notes", "exercise_template_id", "superset_id", "sets"}),
    #"Expanded sets" = Table.ExpandListColumn(#"Expanded exercises1", "sets"),
    #"Expanded sets1" = Table.ExpandRecordColumn(#"Expanded sets", "sets", {"index", "set_type", "weight_kg", "reps", "distance_meters", "duration_seconds", "rpe"}, {"index.1", "set_type", "weight_kg", "reps", "distance_meters", "duration_seconds", "rpe"})
in
    #"Expanded sets1"

It works well in my test as well.

vrzhoumsft_0-1724744970341.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

It's working for me, I can see the data. What is your error message?

APIRT
Regular Visitor

up

APIRT
Regular Visitor

Updated the post with all the information.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.