About Map My Tracks

About the API

How does it work

Map My Tracks provides a simple interface that allows developers to access and update their activity data. You can use this API to make your own widgets or applications that seamlessly integrate Map My Tracks with other services.

If you have any questions or suggestions about our API don't hesitate to contact us at support@mapmytracks.com.

Overview

The API consists of a number of services which are accessed by sending a HTTP POST to the Map My Tracks API URL at http://www.mapmytracks.com/api/. All requests require basic HTTP authentication using a valid Map My Tracks username and password. All API requests will be asigned to the user's account. The API reponds with an XML formatted message. The content of this message will be dependant on the type of request that was made.

Services

Data retrieval
Data input
Get activities

Get a list of a user's activities.

Parameters
request
The request identifier. To perform this API request, set this to 'get_activities'.
author
The user's username.
Returns

A list of activities, ordered by the time at which they were performed. If requesting your own activities, the list will contain both your public and private tracks.

Example POST
request = get_activities
author = rsmith
Returns a complete list of user's activities.
<?xml version="1.0" encoding="UTF-8"?>
<message>
	<author>Rob</author>
	<activities>
		<activity1>
			<id>54</id>
			<title>Wednesday run</title>
			<date>1198053480</date>
		</activity1>
		<activity2>
			<id>500</id>
			<title>Bike ride home</title>
			<date>1223050320</date>
		</activity2>
		<activity3>
			<id>569</id>
			<title>Westgate to herne</title>
			<date>1223126383</date>
		</activity3>
	</activities>
</message>
Get activity

Get a specific activity's location data.

Parameters
request
The request identifier. To perform this API request, set this to 'get_activity'.
activity_id
The id of an activity, as returned by the activities API service.
from_time
A UNIX timestamp from which location data will be returned.
Returns

A list of positional data for the given activity, limited to 100 points, and a flag identifiying if the activity is live. Points are formatted in space delimeted blocks. Each block consists of the unixtime at which the location was recorded, followed by the location's latitude, longitude and altitude.

To get all location data within an activity with more than 100 points, call the API multiple times and modify the start_from parameter to suit.

Example POST
request = get_activity
activity_id = 54
from_time = 0
Returns the first 100 points for an activity.
<?xml version="1.0" encoding="UTF-8"?>
<message>
	<complete>Yes</complete>
	<points>
	1198052842,51.3704583333333,1.15737333333333,1.345 1198052846,51.370465,...
	</points>
</message>

In the event that the activity contains more than 100 points or the track is live, further requests are made to retrieve subsequent data in batches of 100 points.

Start activity

Initiate the tracking of an activity.

Parameters
request
The request identifier. To perform this API request, set this to 'start_activity'.
title
The title of the new activity. The title must be no longer that 100 characters.
privicity
Indicates if this activity is to be public or privately visible. Possible values are "public" and "private".
activity
The activity type. Possible values are "running", "cycling", "sailing", "driving", "walking", "skiing", "motor racing", "canoeing", "rowing", "windsurfing", "kiteboarding", "orienteering", "mountaineering", "skating", "horse riding", "hang gliding", "gliding", "snowboarding", "paragliding", "hot air ballooning" and "miscellaneous".
points
A list of points indicating the location(s) that this track is to be initiated with. The list of points should be space delimited in blocks containing latitude, longitude, altitude, and time data. These blocks are themselves space delimited.
source
An identifier representing the source application from which this API call is being made.
Optional parameters
tags
A comma seperated list of tags. Each tag must be no longer that 50 characters.
version
An identifier representing the version of the source application from which this API call is being made.
Returns

If the request was successful, the XML reponse will contain a unique activity id realting to the newly created activity. If the point data supplied was in an incorrect format, the XML reponce will indicate an error.

Example POST
request = start_activity
title = My activity
tags = training, whitstable
privicity = public
activity = running
source = My app
points = 51.3704583333333 1.15737333333333 1.345 1198052842 51.3704586 
1.1573741 1.345 1198052844
Returns a message containing the newly created activity id.
<?xml version="1.0" encoding="UTF-8"?>
<message>
	<type>activity_started</type>
	<activity_id>9346</activity_id>
</message>
Update activity

Add new locations to an activity.

Parameters
request
The request identifier. To perform this API request, set this to 'update_activity'.
activity_id
The unique id of the activity to which this update relates.
points
A list of points indicating new location(s) to append to this activity. The list of points should be space delimeted in blocks containing latitude, longitude, altitude, and time data. These blocks are themselves space delimited.
Returns

If the request was successful, the XML reponse will contain a message indicating that the activity has been updated. If the point data supplied was in an incorrect format, the XML reponce will indicate an error.

Example POST
request = update_activity
activity_id = 9346
points = 51.3704583333333 1.15737333333333 1.345 1198052842 51.3704586 
1.1573741 1.345 1198052844

Returns a message indicating that the activity has been updated.

<?xml version="1.0" encoding="UTF-8"?>
<message>
	<type>activity_updated</type>
</message>
Stop activity

Stop the tracking of an activity.

Parameters
request
The request identifier. To perform this API request, set this to 'stop_activity'.
Returns

The XML reponse will contain a message indicating that the activity has been stopped.

Example POST
request = stop_activity

Returns a message indicating that the activity has been stopped.

<?xml version="1.0" encoding="UTF-8"?>
<message>
	<type>activity_stopped</type>
</message>
Get time

Get the Map My Tracks server's current system time.

Parameters
request
The request identifier. To perform this API request, set this to 'get_time'.
Returns

The XML response contains the current system time.

Example POST
request = get_time

Returns the current system time.

<?xml version="1.0" encoding="UTF-8"?>
<message>
	<type>time</type>
	<server_time>1242988693</server_time>
</message>
Upload activity

Upload an activity in it's entirety, in GPX format

Parameters
request
The request identifier. To perform this API request, set this to 'upload_activity'.
gpx_file
A GPX file formatted representation of the activity
status
Indicates if this activity is to be public or privately visible. Possible values are "public" and "private".
description
The request identifier. To perform this API request, set this to 'get_time'.
activity
The activity type. Possible values are "running", "cycling", "sailing", "driving", "walking", "skiing", "motor racing", "canoeing", "rowing", "windsurfing", "kiteboarding", "orienteering", "mountaineering", "skating", "horse riding", "hang gliding", "gliding", "snowboarding", "paragliding", "hot air ballooning" and "miscellaneous".
Returns

An XML formatted replay indicating success or failure

Example POST

(gpx_file has been truncated for clarity)

request=upload_activity
gpx_file= <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
             <?xml-stylesheet type="text/xsl" href="details.xsl"?>
                <gpx version="1.0" creator=...
status = public
description = My weekend run
activity = running

Returns, if successful.

<?xml version="1.0" encoding="UTF-8"?>
<message>
	<type>success</type>
</message>

Sign up now

Real-time GPS tracking for all sports

Motor racing, Sailing, Cycling, Running, Canoeing, Skiing, Walking, Windsurfing, Orienteering, Mountaineering, Horse riding, Hang gliding, Gliding, Snowboarding, Paragliding, Hot air ballooning, or just for fun.

Map My Tracks tracker screenshots

  • Track overview screen
  • Track speed screen
  • Track pace screen
  • Track location overlay screen
  • Track review screen
  • Track map screen

View more full size screenshots

Who makes this?

Map My Tracks is brought to life by a team of sports enthusiasts looking for a better way to analyse their weekend's sporting activity. It was born out of the frustration at not understanding where races were lost (or won) and not knowing how the leaders were always in front.

Behind the scene is a glorious mix of the latest GPS technology, mobile phones and the web, all brought together by the team at Tinderhouse to provide real-time GPS tracking for mass participation sports.