PHPackages                             dawguk/php-garmin-connect - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. dawguk/php-garmin-connect

ActiveLibrary

dawguk/php-garmin-connect
=========================

A PHP adapter for interrogating the Garmin Connect "API"

v1.7.0(4y ago)856.4k↓100%41[3 issues](https://github.com/10REM/php-garmin-connect/issues)[3 PRs](https://github.com/10REM/php-garmin-connect/pulls)MITPHPPHP &gt;=5.3.0

Since Jul 26Pushed 3mo ago18 watchersCompare

[ Source](https://github.com/10REM/php-garmin-connect)[ Packagist](https://packagist.org/packages/dawguk/php-garmin-connect)[ RSS](/packages/dawguk-php-garmin-connect/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (17)Used By (0)

PHP Garmin Connect
==================

[](#php-garmin-connect)

A PHP adapter for interrogating the Garmin Connect "API"

Preamble
========

[](#preamble)

Garmin doesn't really have a proper API for their Connect tool. Well, they sort of do, but it's half-baked; they appear to have either abandoned it or let it go stale, the documentation is very thin on the ground and there appears to be no "proper" way of authenticating the user.

So thanks to Collin @tapiriik and his wonderful public python repo (), this project was born for those of us that prefer elephants to snakes ;)

Thanks also to @Matin and his python lib repo , this project helped to adapt the code to new Garmin protocol.

The code is pretty well documented, and it has to be because some things we have to do is pretty gnarly. Once authentication is done though, it's pretty much good old RESTFUL API stuff. Oh, but we're using the CURL cookie handling to maintain session state. Ugh.

Full Example
============

[](#full-example)

2026/01 : adaptation with garth porting The credentials need 2 mandatory additionnal parameters and one optional 'consumer\_key' =&gt; "xxxx", 'consumer\_secret' =&gt; "xxxx", 'tokenstore' =&gt; "" The first one are used for getting credentials oauth1 steps and oauth2 steps for access to Garmin API. They can be retrieved directly to Garmin , or you can used the one from garth project. The third one is used to store oauth1 and oauth2 token and bearer We added also traces so after unzipping the code source the command line must be launched `composer update `

We simply connect using our Garmin Connect credentials.

```

         Garmin Connect

      2014-09-18T17:22:50.000Z

      Untitled

            54.599998474121094
            2014-09-18T17:22:50.000Z

                  22.0
                  0

```

### getWorkoutList(integer $intStart, integer $intLimit, bool $myWorkoutsOnly, bool $sharedWorkoutsOnly)

[](#getworkoutlistinteger-intstart-integer-intlimit-bool-myworkoutsonly-bool-sharedworkoutsonly)

Returns an array of stdClass objects.

#### Example

[](#example-5)

```
try {
   $objGarminConnect = new \dawguk\GarminConnect($arrCredentials);
   $obj_results = $objGarminConnect->getWorkoutList(0, 10);
   print_r($obj_results);
} catch (Exception $objException) {
   echo "Oops: " . $objException->getMessage();
}
```

#### Response

[](#response-3)

```
[

    {
        "workoutId": 12345678,
        "ownerId": 12345678,
        "workoutName": "1.5h run",
        "description": null,
        "updateDate": "2020-04-20T15:26:05.0",
        "createdDate": "2020-04-20T15:26:05.0",
        "sportType": {
            "sportTypeId": 1,
            "sportTypeKey": "running",
            "displayOrder": 1
        },
        "trainingPlanId": null,
        "author": {
            "userProfilePk": null,
            "displayName": null,
            "fullName": null,
            "profileImgNameLarge": null,
            "profileImgNameMedium": null,
            "profileImgNameSmall": null,
            "userPro": false,
            "vivokidUser": false
        },
        "estimatedDurationInSecs": null,
        "estimatedDistanceInMeters": null,
        "poolLength": 0.0,
        "poolLengthUnit": {
            "unitId": null,
            "unitKey": null,
            "factor": null
        },
        "workoutProvider": null,
        "workoutSourceId": null,
        "consumer": null,
        "atpPlanId": null,
        "workoutNameI18nKey": null,
        "descriptionI18nKey": null,
        "exerciseCriteria": null,
        "shared": false,
        "estimated": true
    }
]
```

### createWorkout(string $data)

[](#createworkoutstring-data)

Returns a JSON object of the created workout.

#### Example

[](#example-6)

```
try {
   $data = '';
   $objGarminConnect = new \dawguk\GarminConnect($arrCredentials);
   $obj_results = $objGarminConnect->createWorkout($data);
   print_r($obj_results);
} catch (Exception $objException) {
   echo "Oops: " . $objException->getMessage();
}
```

#### Response

[](#response-4)

```
{"workoutId":204516560,"ownerId":80242598,"workoutName":"Testing 1, 2, 3...","description":null,"updatedDate":"2020-04-20T16:06:19.0","createdDate":"2020-04-20T16:06:19.0",...}
```

### deleteWorkout(integer $id)

[](#deleteworkoutinteger-id)

Deletes a workout from the Garmin website and returns no content.

#### Example

[](#example-7)

```
try {
   $objGarminConnect = new \dawguk\GarminConnect($arrCredentials);
   $obj_results = $objGarminConnect->deleteWorkout(593520370);
   print_r($obj_results);
} catch (Exception $objException) {
   echo "Oops: " . $objException->getMessage();
}
```

### createStepNote(integer $stepID, string $note, integer $workoutID)

[](#createstepnoteinteger-stepid-string-note-integer-workoutid)

Creates a new note and attaches it to a step. No content is returned from Garmin - 204.

#### Example

[](#example-8)

```
try {
   $data = '';
   $objGarminConnect = new \dawguk\GarminConnect($arrCredentials);
   $obj_results = $objGarminConnect->createStepNote(593520370, 'Hello World', 123456789);
   print_r($obj_results);
} catch (Exception $objException) {
   echo "Oops: " . $objException->getMessage();
}
```

### scheduleWorkout(integer $id, string $data)

[](#scheduleworkoutinteger-id-string-data)

Creates a new event on your calendar and returns a JSON object as the response.

#### Example

[](#example-9)

```
try {
   $data = '';
   $objGarminConnect = new \dawguk\GarminConnect($arrCredentials);
   $obj_results = $objGarminConnect->scheduleWorkout(593520370, $data);
   print_r($obj_results);
} catch (Exception $objException) {
   echo "Oops: " . $objException->getMessage();
}
```

#### Response

[](#response-5)

```
{"workoutScheduleId":305583643,"workout":{"workoutId":204503966,"ownerId":80242598,"workoutName":"3h run","description":null,"updatedDate":"2020-04-20T15:26:06.0","createdDate":"2020-04-20T15:26:06.0","sportType":{"sportTypeId":1,"sportTypeKey":"running", ...}
```

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance54

Moderate activity, may be stable

Popularity38

Limited adoption so far

Community26

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 69.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~117 days

Total

16

Last Release

1816d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d9cd577dc1dc498e5c8ff3041bff4a0ecb2b11f57bdd4c61093b2974e60f3477?d=identicon)[dawguk](/maintainers/dawguk)

---

Top Contributors

[![DaveWilcock](https://avatars.githubusercontent.com/u/424094?v=4)](https://github.com/DaveWilcock "DaveWilcock (63 commits)")[![gear4dave](https://avatars.githubusercontent.com/u/12171117?v=4)](https://github.com/gear4dave "gear4dave (10 commits)")[![AnneWielis](https://avatars.githubusercontent.com/u/41674213?v=4)](https://github.com/AnneWielis "AnneWielis (4 commits)")[![evanbarter](https://avatars.githubusercontent.com/u/583308?v=4)](https://github.com/evanbarter "evanbarter (3 commits)")[![lsolesen](https://avatars.githubusercontent.com/u/148026?v=4)](https://github.com/lsolesen "lsolesen (3 commits)")[![amyboyd](https://avatars.githubusercontent.com/u/398210?v=4)](https://github.com/amyboyd "amyboyd (2 commits)")[![pygoubet](https://avatars.githubusercontent.com/u/1819088?v=4)](https://github.com/pygoubet "pygoubet (1 commits)")[![davereid](https://avatars.githubusercontent.com/u/62967?v=4)](https://github.com/davereid "davereid (1 commits)")[![iFery](https://avatars.githubusercontent.com/u/9416668?v=4)](https://github.com/iFery "iFery (1 commits)")[![JavierMartinz](https://avatars.githubusercontent.com/u/1155507?v=4)](https://github.com/JavierMartinz "JavierMartinz (1 commits)")[![jentscke](https://avatars.githubusercontent.com/u/8313630?v=4)](https://github.com/jentscke "jentscke (1 commits)")[![JLTRY](https://avatars.githubusercontent.com/u/20617033?v=4)](https://github.com/JLTRY "JLTRY (1 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/dawguk-php-garmin-connect/health.svg)

```
[![Health](https://phpackages.com/badges/dawguk-php-garmin-connect/health.svg)](https://phpackages.com/packages/dawguk-php-garmin-connect)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
