PHPackages                             dawguk/strava - 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. [API Development](/categories/api)
4. /
5. dawguk/strava

ActiveLibrary[API Development](/categories/api)

dawguk/strava
=============

A simple-to-use (single file!) library to easily interrogate the Strava v3 API

833PHP

Since Nov 11Pushed 10y ago1 watchersCompare

[ Source](https://github.com/dawguk/php-strava-client)[ Packagist](https://packagist.org/packages/dawguk/strava)[ RSS](/packages/dawguk-strava/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Strava v3 API Client
====================

[](#strava-v3-api-client)

This is a single-file-library that you can use to interrogate the Strava v3 API. It handles authentication as well as whatever API calls you want to make (as long as they are valid)

Usage
-----

[](#usage)

First off you need to construct a configuration array. The array should contain at least the following information:

- CLIENT\_ID
- CLIENT\_SECRET
- REDIRECT\_URI
- ACCESS SCOPE

CLIENT\_ID and CLIENT\_SECRET should be taken from the [My API Application](https://www.strava.com/settings/api) section of the site. Valid ACCESS\_SCOPE values can be found in the [Strava API documentation](http://strava.github.io/api/v3/oauth/)

Optionally, you can supply the following addition configuration options:

- CACHE\_DIRECTORY
- ACCESS\_TOKEN

If CACHE\_DIRECTORY isn't supplied, the library falls back to writing to /tmp

If ACCESS\_TOKEN is supplied, we bypass authorization and token exchange - assuming the ACCESS\_TOKEN is correct.

Examples
--------

[](#examples)

To configure the client, you would define your parameters as follows:

```
