# 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. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-metro-istanbul-api-59a32ead/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## 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/parse-metro-istanbul-api-59a32ead/get_all_lines \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-metro-istanbul-api-59a32ead/get_all_stations \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-metro-istanbul-api-59a32ead/get_line_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-metro-istanbul-api-59a32ead/get_network_map \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-metro-istanbul-api-59a32ead/get_service_status \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-metro-istanbul-api-59a32ead/get_ticket_prices \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
