-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GraphQL endpoints for Garmin Connect #210
Comments
@psdupvi interesting! |
These endpoints are accessible through in the following way: query = {"query":"query {trainingReadinessRangeScalar(startDate:\"2024-06-11\", endDate:\"2024-07-08\")}"}
r = api.garth.post("connectapi","graphql-gateway/graphql", json=query)
data = r.json() Note that we're using Now that I know how to access these, I'll take a look at comparing the available data from these vs. existing endpoints and collecting a list of known queries. The good news is it looks like Garmin (stupidly) sends a GraphQL request even for widgets that you haven't selected -- e.g., I've never used the new Jet Lag functionality, but I still see a This will take some time, but I think it's valuable, especially since there may possibly be more functionality here |
This file contains the queries I was able to find for this endpoint. There are 35 of them. This file contains queries and responses, with (hopefully) all my PII removed |
@psdupvi I'm thinking we should keep this information, maybe on an developer wiki page here? |
I have renamed the file to an .txt extension otherwise the lint tools went bonkers ;-) |
Inspired by #207 , I noticed that there are GraphQL endpoints which appear to populate the new Garmin Connect home page.
The existing endpoints which we utilize still populate the Reports pages (and so on), but it may be worth investigating what's available from the Garmin GraphQL endpoints and whether we can effectively query them.
The endpoints all appear to be just
https://connect.garmin.com/graphql-gateway/graphql
, with a payload that specifies the query.For example, I suspect that the Weight widget is populated by a request to
https://connect.garmin.com/graphql-gateway/graphql
with the payload{"query":"query{weightScalar(startDate:\"2024-06-07\", endDate:\"2024-06-13\")}"}
The response for that endpoint is at the bottom of this issue.
In general, this may be a larger request, and may not be worth doing if the data returned from these endpoints is basically the same as what we currently get.
The text was updated successfully, but these errors were encountered: