# Metro — 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.

> Plan your Istanbul Metro trips by checking real-time service status, finding stations on specific lines, and looking up current ticket prices. Access detailed information about all metro lines and the complete network map to navigate the city's transit system efficiently.

**Category:** Maps & Geospatial | **Website:** [metro.istanbul/](https://metro.istanbul/) | **Docs:** [parse.bot/marketplace/59a32ead-240e-4794-94a2-4d0ac2633619/metro-istanbul-api](https://parse.bot/marketplace/59a32ead-240e-4794-94a2-4d0ac2633619/metro-istanbul-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/metro/`
**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 all lines

Get all transit lines operated by Metro Istanbul. Returns line codes, display names, IDs, and RGB color codes for each line in the network (metro, tramway, funicular, cable car).

**Estimated cost:** Metered

_No parameters required._

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

### Get all stations

Get all stations across all lines. Returns station IDs, names, display names, associated line info, ordering within line, and SAP codes. Useful for building a full network graph or searching for stations.

**Estimated cost:** Metered

_No parameters required._

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

### Get line detail

Get detailed information for a specific line including station sequence, operating metrics (length, travel time, hours, daily ridership), and transfer connection descriptions to other lines.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `line_code` | string | Yes | Line code identifying the transit line. Accepted values: F1, F4, M1A, M1B, M2, M3, M4, M5, M6, M7, M8, M9, T1, T3, T4, T5, TF1, TF2. |

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

### Get network map

Get links to network map images including metro, tramway, and construction maps. Returns title and URL for each available map resource.

**Estimated cost:** Metered

_No parameters required._

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

### Get service status

Get real-time service status and equipment fault counts. seferDurumlari contains active service disruptions (empty array means normal service). Equipment fields (arizaliAsansor, arizaliYuruyenMerdiven, etc.) are string counts of faulty units.

**Estimated cost:** Metered

_No parameters required._

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

### Get ticket prices

Get current ticket and fare prices grouped by card category (Anonim Kart, Mavi Kart, Elektronik Kart). Each item has a category, type description, and price in Turkish Lira.

**Estimated cost:** Metered

_No parameters required._

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

## 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.