# Citymapper — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Get real-time transit information including live stop arrivals, service status, and line details across major cities worldwide. Search for nearby transit options and stay informed with service alerts to plan your commute efficiently.

**Category:** Maps & Geospatial | **Website:** [citymapper.com/](https://citymapper.com/) | **Docs:** [parse.bot/marketplace/dbdf3c3c-3b5a-4801-8409-35962bd14f6d/citymapper-com-api](https://parse.bot/marketplace/dbdf3c3c-3b5a-4801-8409-35962bd14f6d/citymapper-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/citymapper/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get city service status

Get current service status for all transit lines in a given region. Returns lines grouped by transit mode (Tube, Overground, National Rail, etc.), each with a status level (0=Good Service, 1+=disruption), summary, description, and weekend status. The last_updated_time indicates data freshness.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `region_id` | string | Yes | The region ID of the city. Obtain from get_supported_cities endpoint. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/citymapper/get-city-service-status \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"region_id":"<string>"}'
```

### Get line details

Get detailed information for a specific transit line including its stops (with coordinates and connecting routes), route patterns (with geographic paths and ordered stop sequences), and current status. Useful for mapping a line's coverage and finding stop IDs for arrival queries.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `region_id` | string | Yes | The region ID of the city. |
| `route_id` | string | Yes | The route alias ID (e.g. 'bakerloo', 'central', 'dlr'). Obtain from get_city_service_status routes[*].aliases[0] or search_lines matches[*].route_id. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/citymapper/get-line-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"region_id":"<string>","route_id":"<string>"}'
```

### Get line service alerts

Get active service alerts and disruption notifications for a specific transit line. Returns alerts with level, summary, description, and optionally affected stops. Returns an empty alerts array when no disruptions are active.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `region_id` | string | Yes | The region ID of the city. |
| `route_id` | string | Yes | The route alias ID of the transit line (e.g. 'central', 'bakerloo'). Obtain from search_lines matches[*].route_id. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/citymapper/get-line-service-alerts \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"region_id":"<string>","route_id":"<string>"}'
```

### Get nearby transit

Get nearby transit stops and stations based on latitude and longitude coordinates. Returns stops within walking distance with route information, walk time in seconds, and stop IDs usable for arrival queries. Results cover multiple transit modes.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `lat` | number | Yes | Latitude of the location (e.g. 51.5072). |
| `lon` | number | Yes | Longitude of the location (e.g. -0.1276). |
| `region_id` | string | Yes | The region ID of the city. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/citymapper/get-nearby-transit \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"lat":"<number>","lon":"<number>","region_id":"<string>"}'
```

### Get stop arrivals

Get real-time arrival/departure ETAs for a specific stop or station. Returns departures grouped by line and direction, with time_seconds indicating seconds until arrival. Covers all lines serving the stop. last_updated_time indicates data freshness.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `region_id` | string | Yes | The region ID of the city. |
| `stop_id` | string | Yes | The CamelCase station ID (e.g. 'Bank', 'OxfordCircus', 'KingsCross'). Obtain from get_line_details stops keys or get_nearby_transit elements[*].id. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/citymapper/get-stop-arrivals \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"region_id":"<string>","stop_id":"<string>"}'
```

### Get supported cities

Get the list of major cities supported by Citymapper. Each city includes a region_id used as a required parameter for all other endpoints, a slug, name, and country. The list is curated to major metro areas with active transit coverage.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/citymapper/get-supported-cities \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Search lines

Search for transit lines by name or alias within a city. Performs a case-insensitive substring match against line names, live_line_codes, and aliases. Returns matching lines with their current status, brand, and mode grouping.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | The search query (e.g. 'Central', 'Bakerloo', 'DLR'). |
| `region_id` | string | Yes | The region ID of the city. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/citymapper/search-lines \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>","region_id":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.