# Citymapper Journey Scraper (`rl1987/citymapper-api-scraper`) Actor

Multi-modal journey planning from Citymapper's mobile routing API (reversed from the Citymapper Android app): given start and end coordinates, returns journey options with legs, modes, durations and optional turn-by-turn walking instructions. No key or login required.

- **URL**: https://apify.com/rl1987/citymapper-api-scraper.md
- **Developed by:** [R.L.](https://apify.com/rl1987) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 journeys

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Citymapper Journey Scraper

Plan multi-modal journeys with [Citymapper](https://citymapper.com)'s mobile routing API
(reversed from the Citymapper Android app). Give it **start and end coordinates** and it returns
the **journey options** Citymapper would show — walk / transit / bike / on-demand legs, with
durations, distances and prices — plus optional **turn-by-turn walking instructions**. No API
key, account or request signing is required.

### What it does

For each start → end pair, the actor:

1. resolves the Citymapper **region** from the start coordinate (or uses the one you pass),
2. calls `/{region}-api.citymapper.com/7/journeys`, and
3. pushes **one dataset row per journey option**. When enabled, it also fetches `/8/walk` and
   attaches the walking steps to the first row of the route.

### Input

| Field | Type | Notes |
|-------|------|-------|
| `startCoordinate` | string | Origin `"lat,lng"`, e.g. `51.5074,-0.1278`. |
| `endCoordinate` | string | Destination `"lat,lng"`. |
| `region` | string | Optional Citymapper region id (`uk-london`, `us-newyork`, …); auto-resolved if empty. |
| `routes` | JSON array | Optional batch of `{start, end, region?}` objects — overrides the single pair. |
| `includeWalkInstructions` | boolean | Attach turn-by-turn walking steps per route (default `true`). |
| `maxItems` | integer | Cap total journey rows. `0` = all. |
| `proxyConfiguration` | proxy | Defaults to Apify Proxy. Endpoints are unauthenticated, so any group works. |

#### Example input

```json
{
  "startCoordinate": "51.5074,-0.1278",
  "endCoordinate": "51.5007,-0.1246",
  "includeWalkInstructions": true,
  "proxyConfiguration": { "useApifyProxy": true }
}
```

### Output

One row per journey option:

```json
{
  "start": "51.507400,-0.127800",
  "end": "51.500700,-0.124600",
  "region": "uk-london",
  "journey_index": 0,
  "journey_count": 13,
  "duration_seconds": 900,
  "walk_seconds": 300,
  "distance_meters": 1400,
  "price": null,
  "legs": [ { "type": "walk", "duration_seconds": 300, "distance_meters": 400 } ],
  "signature": "…",
  "walk_instructions": { "results": [ { "journey8": { "legs": [ { "instructions": [ … ] } ] } } ] },
  "raw": { "…": "full raw journey object" }
}
```

### Pricing

Pay-per-event: **$0.001 per journey** option returned.

### Notes & limitations

- Region coverage is limited to the cities Citymapper supports; a coordinate outside every
  known region fails with an actionable message (pass an explicit `region`).
- The routing endpoints are the same public-looking ones the app calls with only a User-Agent
  and User-Device header — no key, login or signing.
- This is an unofficial client and is not affiliated with or endorsed by Citymapper.

# Actor input Schema

## `startCoordinate` (type: `string`):

Start of the journey: a "lat,lng" pair (e.g. 51.5074,-0.1278) OR a place name (e.g. "King's Cross"). For a name, also set `region` — the geocoder is region-scoped.

## `endCoordinate` (type: `string`):

End of the journey: a "lat,lng" pair OR a place name (e.g. "London Bridge"). Names require `region`.

## `region` (type: `string`):

Citymapper region id (e.g. uk-london, us-nyc, fr-paris). Auto-detected from coordinates; REQUIRED when start/end is a place name.

## `routes` (type: `array`):

Optional batch: a JSON array of objects like {"start": "51.5074,-0.1278", "end": "51.5007,-0.1246", "region": "uk-london"}. When set, this overrides the single start/end fields above.

## `includeWalkInstructions` (type: `boolean`):

Also fetch turn-by-turn walking steps (/8/walk) for each route and attach them to the first journey row.

## `maxItems` (type: `integer`):

0 = all journey options for every route.

## `proxyConfiguration` (type: `object`):

Route requests through a proxy (Apify Proxy by default). The routing endpoints are unauthenticated, so any group works.

## Actor input object example

```json
{
  "startCoordinate": "51.5074,-0.1278",
  "endCoordinate": "51.5007,-0.1246",
  "includeWalkInstructions": true,
  "maxItems": 0,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startCoordinate": "51.5074,-0.1278",
    "endCoordinate": "51.5007,-0.1246",
    "region": "",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("rl1987/citymapper-api-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "startCoordinate": "51.5074,-0.1278",
    "endCoordinate": "51.5007,-0.1246",
    "region": "",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("rl1987/citymapper-api-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startCoordinate": "51.5074,-0.1278",
  "endCoordinate": "51.5007,-0.1246",
  "region": "",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call rl1987/citymapper-api-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rl1987/citymapper-api-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/aVpiGxn9qdBcsTSC7/builds/cTDmE5tUWhopH29Nj/openapi.json
