PHPackages                             phpruntastic/phpruntastic - 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. phpruntastic/phpruntastic

ActiveLibrary[API Development](/categories/api)

phpruntastic/phpruntastic
=========================

It is a class to gain easy access to Runtastic (www.runtastic.com) activity data via PHP. This is a very dirty approach since Runtastic doesn't offer an official API.

0225PHP

Since Nov 20Pushed 10y ago1 watchersCompare

[ Source](https://github.com/ferranmarlet/php-runtastic)[ Packagist](https://packagist.org/packages/phpruntastic/phpruntastic)[ RSS](/packages/phpruntastic-phpruntastic/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#Runtastic PHP Runtastic PHP is a class to gain easy access to Runtastic ([www.runtastic.com](http://www.runtastic.com)) activity data via PHP. This is a very dirty approach since Runtastic doesn't offer an official API.

\##REQUIREMENTS This class requieres at least PHP 5.2 and the JSON and CURL (with SSL) extension.

\##INSTALLATION Simply include the class and you are good to go.

\##CLASSES ###Runtastic
-----------------------

[](#classesruntastic)

#### setUsername()

[](#setusername)

**\[Mandatory\]** Sets the username used for logging into Runtastic

#### setPassword()

[](#setpassword)

**\[Mandatory\]** Sets the password used for logging into Runtastic

#### setTimeout()

[](#settimeout)

Sets the connection timeout (in seconds) for cURL

#### login()

[](#login)

Logs into Runtastic (requires valid username and password)

#### logout()

[](#logout)

Logs out and closes the cURL connection

#### getUsername()

[](#getusername)

Returns the Username used by Runtastic

#### getUid()

[](#getuid)

Returns the UID used by Runtastic

#### getToken()

[](#gettoken)

Returns the session token

#### getActivities($week=null, $month=null, $year=null)

[](#getactivitiesweeknull-monthnull-yearnull)

Returns every activity in your Runtastic account as a RuntasticActivityList (usable as array) of objects. If

- `$iWeek` is set, all activities within requested week will be returned (week starts on monday).
- `$iMonth` is set, all activities within requested month will be returned.
- `$iYear` is set, all activities within the requested year will be returned.

`$iWeek` and `$iMonth` can be used together with `$iYear`. if `$iYear` is null, the current year will be used for filtering.

### RuntasticActivityList

[](#runtasticactivitylist)

---

#### filterBy(array())

[](#filterbyarray)

`$runtastic->getActivities()` returns an RuntasticActivityList. Furthermore, you are able to filter the results (i.e. just cycling). For an example see below:

\##EXAMPLE This is an example which logs into runtastic, fetches every activity in your account and outputs internal Runtastic data (Username, UID) and a simple string.

```

```

#### Output:

[](#output)

```
Username: Example-User
UID: 1337

My latest cycling activity was awesome!

```

ACTIVITY OBJECT
---------------

[](#activity-object)

This is what a typical activity object looks like:

```
array(1) {
	[0]=>
		object(stdClass)#11 (24) {
		["id"]=>
		int(1111111)
		["type"]=>
		string(7) "cycling"
		["type_id"]=>
		int(3)
		["duration"]=>
		int(630003)
		["distance"]=>
		int(2435)
		["pace"]=>
		float(4.31213333333)
		["speed"]=>
		string(6) "13.914"
		["kcal"]=>
		int(48)
		["heartrate_avg"]=>
		int(0)
		["heartrate_max"]=>
		int(0)
		["elevation_gain"]=>
		float(18)
		["elevation_loss"]=>
		float(19)
		["surface"]=>
		string(4) "road"
		["weather"]=>
		string(5) "sunny"
		["feeling"]=>
		string(7) "awesome"
		["weather_id"]=>
		int(1)
		["feeling_id"]=>
		int(1)
		["surface_id"]=>
		int(1)
		["notes"]=>
		string(0) ""
		["page_url"]=>
		string(47) "/en/users/Example-User/sport-sessions/1111111"
		["create_route_url_class"]=>
		string(0) ""
		["create_route_url"]=>
		string(36) "/en/routes/new?sport_session=1111111"
		["map_url"]=>
		string(201) ""
		["date"]=>
		object(stdClass)#8 (6) {
			["year"]=>
			int(2011)
			["month"]=>
			string(2) "05"
			["day"]=>
			string(2) "19"
			["hour"]=>
			int(22)
			["minutes"]=>
			int(18)
			["seconds"]=>
			int(23)
		}
	}
}

```

UPDATES
-------

[](#updates)

I might write one or two things about this class on my blog [www.timo.in](http://www.timo.in) but the code itself will be maintained on GitHub only

LICENSE
-------

[](#license)

The MIT License (MIT)

Copyright (c) 2014 Timo Schlueter

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 65.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.

### Community

Maintainers

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

---

Top Contributors

[![timoschlueter](https://avatars.githubusercontent.com/u/3465220?v=4)](https://github.com/timoschlueter "timoschlueter (15 commits)")[![ferranmarlet](https://avatars.githubusercontent.com/u/4703969?v=4)](https://github.com/ferranmarlet "ferranmarlet (6 commits)")[![Donderda](https://avatars.githubusercontent.com/u/3691838?v=4)](https://github.com/Donderda "Donderda (2 commits)")

### Embed Badge

![Health badge](/badges/phpruntastic-phpruntastic/health.svg)

```
[![Health](https://phpackages.com/badges/phpruntastic-phpruntastic/health.svg)](https://phpackages.com/packages/phpruntastic-phpruntastic)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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