Skip to content
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

Add Endurance Score endpoint #145

Closed
psdupvi opened this issue Sep 8, 2023 · 3 comments
Closed

Add Endurance Score endpoint #145

psdupvi opened this issue Sep 8, 2023 · 3 comments

Comments

@psdupvi
Copy link
Contributor

psdupvi commented Sep 8, 2023

Garmin recently released "Endurance Score", which is detailed here: https://www.garmin.com/en-US/garmin-technology/running-science/physiological-measurements/endurance-score/

I believe the endpoint should be something along the lines of proxy/metrics-service/metrics/endurancescore, but that is currently not working. I'm raising this issue with the intent of adding it in myself, but if someone gets to it before I do, great.

The output I see in the console of their official endpoint (basically, that but without proxy) is something along the lines of:

{
    "userProfilePK": 987654321,
    "deviceId": 12345678910,
    "calendarDate": "2023-09-08",
    "overallScore": 8000,
    "classification": 6,
    "feedbackPhrase": 78,
    "primaryTrainingDevice": true,
    "gaugeLowerLimit": 3570,
    "classificationLowerLimitIntermediate": 5100,
    "classificationLowerLimitTrained": 5800,
    "classificationLowerLimitWellTrained": 6600,
    "classificationLowerLimitExpert": 7300,
    "classificationLowerLimitSuperior": 8100,
    "classificationLowerLimitElite": 8800,
    "gaugeUpperLimit": 10560,
    "contributors": [
        {
            "activityTypeId": null, # This appears to be Running for me?
            "group": 0,
            "contribution": 88.53
        },
        {
            "activityTypeId": 4,
            "group": null,
            "contribution": 6.6
        },
        {
            "activityTypeId": 13,
            "group": null,
            "contribution": 4.03
        },
        # Arbitrarily many?
        {
            "activityTypeId": null,
            "group": 8,
            "contribution": 0.84
        },
            ]
}

Note the inconsistencies in when it's group vs. activityTypeId, but that's a problem for the end user I think

The multi day endpoint returns something like the following:

{
    "userProfilePK": 123456789,
    "startDate": "2023-06-17",
    "endDate": "2023-09-08",
    "avg": 8133,
    "max": 8334,
    "groupMap": {
        "2023-07-22": {
            "groupAverage": 8055,
            "groupMax": 8058,
            "enduranceContributorDTOList": [
                {
                    "activityTypeId": 4,
                    "group": null,
                    "contribution": 1.0875001
                },
                {
                    "activityTypeId": null,
                    "group": 6,
                    "contribution": 1.0875001
                },
                {
                    "activityTypeId": null,
                    "group": 0,
                    "contribution": 86.2175
                },
                {
                    "activityTypeId": 13,
                    "group": null,
                    "contribution": 7.1875
                },
                {
                    "activityTypeId": null,
                    "group": 8,
                    "contribution": 4.42
                }
            ]
        },
        # 12 weeks grouped
        "2023-09-02": {
            "groupAverage": 8280,
            "groupMax": 8334,
            "enduranceContributorDTOList": [
                {
                    "activityTypeId": 4,
                    "group": null,
                    "contribution": 6.5299997
                },
                {
                    "activityTypeId": null,
                    "group": 0,
                    "contribution": 87.50715
                },
                {
                    "activityTypeId": 13,
                    "group": null,
                    "contribution": 5.114286
                },
                {
                    "activityTypeId": null,
                    "group": 8,
                    "contribution": 0.8485714
                }
            ]
        }
    },
    "enduranceScoreDTO": {
        "userProfilePK": 123456789,
        "deviceId": 987654321,
        "calendarDate": "2023-09-08",
        "overallScore": 8271,
        "classification": 6,
        "feedbackPhrase": 78,
        "primaryTrainingDevice": true,
        "gaugeLowerLimit": 3570,
        "classificationLowerLimitIntermediate": 5100,
        "classificationLowerLimitTrained": 5800,
        "classificationLowerLimitWellTrained": 6600,
        "classificationLowerLimitExpert": 7300,
        "classificationLowerLimitSuperior": 8100,
        "classificationLowerLimitElite": 8800,
        "gaugeUpperLimit": 10560,
        "contributors": [
            {
                "activityTypeId": null,
                "group": 0,
                "contribution": 88.53
            },
            {
                "activityTypeId": 4,
                "group": null,
                "contribution": 6.6
            },
            {
                "activityTypeId": 13,
                "group": null,
                "contribution": 4.03
            },
            {
                "activityTypeId": null,
                "group": 8,
                "contribution": 0.84
            }
        ]
    }
}
@matin
Copy link
Contributor

matin commented Sep 12, 2023

Where do you see this information in the app or on the website?

@psdupvi
Copy link
Contributor Author

psdupvi commented Sep 12, 2023

In the app, I see it under "Performance Stats", towards the bottom. On the website, I see it in "Reports". Endurance Score falls under "All Activities", while Hill Score falls under running specifically.

If you don't see them, it's possible they weren't released to your device?

@psdupvi
Copy link
Contributor Author

psdupvi commented Sep 14, 2023

Closed in #148

@psdupvi psdupvi closed this as completed Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants