Launch Citymapper for Directions
The easiest way for your users to Get Directions
Let's say that you have an app or website with a database of places. But for your users, finding out how to get to those places is a pain. So we've worked on tools that make it easy for you to launch Citymapper for directions straight from your app. Getting directions, one tap. Done.
Let's see some examples...
How it works
Your code can generate a Citymapper directions link like this:
Let's break down the parameters:
The end coordinate is the only absolutely necessary part of the link; without it Citymapper doesn't know where you want to go. In this case, we're encoding the latitude 51.537060 and the longitude -0.079179. (The %2C in the middle is a URL-encoded comma.)
This is the business name or nickname of the destination. It's optional, but it will make the directions look much nicer if you can include it. In this case it's just a URL-encoded version of The Proud Archivist.
This is the street address of the destination. This is also optional, but if you provide it, it will be displayed to the user at the end of the trip to help them find the right door. In this case, it's a URL-encoded version of the street address 2-10 Hertford Road, London, N1 5ET.
If your destination is an event, you can include the date & time in the link to get directions that will arrive in time.
In this case, we're encoding the arrival date/time of August 6, 2016, at 9:00pm in the British Summer Time timezone, encoded in ISO-8601 format (
2016-08-06T21:00+01:00), then URL-encoded.
We have previously supported the use of arriveby as a paramater in the url. We still do so but this is being deprecated so we recommend that you use arrival_time instead.
If you want the directions to have a specific start point (rather than using the user's current location), you can specify it using the
startaddress parameters, which work like the
endaddress parameters, respectively.
Native Link Scheme
If you want to support older versions of iOS, or to force the directions to open in the native app in all cases, you can simply replace the web domain with
citymapper://, for example:
citymapper://directions?endcoord=51.537060%2C-0.079179&endname=The%20Proud%20Archivist&endaddress=2-10%20Hertford%20Road%2C%20London%2C%20N1%205ETBack to app links for iOS 7 & 8
To ensure that your users can easily get back on iOS 7 & 8, we also support the x-callback-url scheme. This will add a banner to Citymapper that looks like this:
To use this, change the prefix of the url to:
x-source (the user-visible name of your app) and
x-success (the deep link back into your app) parameters. For example:
NOTE: Android and iOS 9 automatically allow you to get back to the previous app when deep-linking, so no need for this on these platforms.
All together now...
Putting it all together, here's a summary of the Citymapper directions link scheme:
For iOS developers, our open-source CMMapLauncher Objective-C library makes it easy to generate links for Citymapper and many other mapping apps.
Citymapper is rapidly expanding its cities and coverage. If you want to make sure that your Citymapper directions link will work for a specific place, you can use the server-side Coverage API.
This API lets you get information on whether locations fall into the Citymapper coverage areas. You can either POST multiple locations with the coverage call, or do a simple GET request for a single location with the singlepointcoverage call. As Citymapper adds more cities, these results automatically get updated.
To access this API, anyone can instantly get a key on our Citymapper API portal. After signing up, you will be granted an initial quota for experimentation. (To get larger quotas for public deployment, please send mail to email@example.com.)
Check out our clever web widgets...
Want even more?
Check out our other tools for developers
Want even even more?
Tell us what you'd like. Get in touch