Discover/Metro API
live

Metro APImetro.istanbul

Access Istanbul Metro lines, stations, real-time service disruptions, ticket prices, and network maps via 6 structured JSON endpoints.

This API takes change requests — .
Endpoint health
verified 6h ago
get_all_stations
get_line_detail
get_service_status
get_network_map
get_all_lines
6/6 passing latest checkself-healing
Endpoints
6
Updated
28d ago

What is the Metro API?

The Metro Istanbul API covers all 6 data categories published by metro.istanbul — lines, stations, line detail, live service status, ticket fares, and network maps — in structured JSON. The get_service_status endpoint returns active disruptions alongside fault counts for elevators, escalators, moving walkways, and other station equipment. The get_all_lines endpoint includes RGB color codes for every line type in the network, including metro, tramway, funicular, and cable car.

Try it

No input parameters required.

api.parse.bot/scraper/c9026794-8ccd-456e-a6fb-d85c5e313a38/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/c9026794-8ccd-456e-a6fb-d85c5e313a38/get_all_lines' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace metro-istanbul-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""Walkthrough: Metro Istanbul SDK — check service status, browse lines, and view fares."""
from parse_apis.metro_istanbul_api import MetroIstanbul, LineCode, LineNotFound

client = MetroIstanbul()

# Check real-time service status (disruptions + equipment faults).
status = client.servicestatuses.get()
print(f"Faulty elevators: {status.faulty_elevators}, escalators: {status.faulty_escalators}")
for d in status.disruptions[:2]:
    print(f"  Disruption (line {d.line_id}): {d.description[:80]}")

# List all transit lines; limit caps total items fetched.
for line in client.lines.list(limit=5):
    print(f"{line.code}: {line.display_name}")

# Get detailed info for a specific line using the LineCode enum.
try:
    detail = client.linedetails.get(line_code=LineCode.M2)
    print(f"{detail.title} — {len(detail.stations)} stations")
    print(f"  First: {detail.stations[0]}, Last: {detail.stations[-1]}")
except LineNotFound as exc:
    print(f"Line not found: {exc}")

# Browse fares.
fare = client.fares.list(limit=3).first()
if fare:
    print(f"Fare: {fare.category} / {fare.type} — {fare.price}")

# List network maps.
for m in client.networkmaps.list(limit=3):
    print(f"Map: {m.title} -> {m.url}")

print("Exercised: servicestatuses.get / lines.list / linedetails.get / fares.list / networkmaps.list")
All endpoints · 6 totalmissing one? ·

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

Input

No input parameters required.

Response
{
  "type": "object",
  "fields": {
    "items": "array of line objects with METROISTHATID, HATADI (line code), HATTANIM (internal name), EKTANIM (display name), RENKR/RENKG/RENKB (RGB color)"
  },
  "sample": {
    "data": {
      "items": [
        {
          "RENKB": "88",
          "RENKG": "115",
          "RENKR": "124",
          "HATADI": "F1",
          "EKTANIM": "Taksim-Kabataş Füniküler Hattı",
          "HATTANIM": "F1 ISLETME",
          "METROISTHATID": 4
        },
        {
          "RENKB": "68",
          "RENKG": "153",
          "RENKR": "0",
          "HATADI": "M2",
          "EKTANIM": "Yenikapı-Seyrantepe-Hacıosman Metro Hattı",
          "HATTANIM": "M2 ISLETME",
          "METROISTHATID": 1
        }
      ]
    },
    "status": "success"
  }
}

About the Metro API

Lines and Stations

get_all_lines returns every transit line operated by Metro Istanbul, including internal fields like METROISTHATID, the line code (HATADI), display name (EKTANIM), and per-line RGB values (RENKR, RENKG, RENKB) useful for rendering colored route maps. get_all_stations covers the full network: each station object carries a station_id, name, display_name, associated line_id and line_name, ordering position within its line (order), and a sap_code for cross-referencing operational data.

Line Detail

get_line_detail accepts a required line_code parameter (e.g., M2, T1, F1) and returns a full profile for that line: a title, a details object with operating metrics such as line length, station count, vehicle count, journey time, operating hours, and daily ridership, an ordered stations array with station names in sequence, and a transfers array describing connections to other lines. Thirteen line codes are currently accepted, spanning metro, tramway, and funicular services.

Service Status and Fares

get_service_status is the real-time endpoint. The seferDurumlari array lists active service disruptions; an empty array means normal service. Alongside disruption status, the response returns string counts for faulty station equipment: elevators (arizaliAsansor), escalators (arizaliYuruyenMerdiven), moving walkways (arizaliYuruyenBant), restrooms (arizaliTuvalet), baby rooms (arizaliBebekOdasi), and prayer rooms (arizaliMescid). get_ticket_prices returns current fares grouped by card category — Anonim Kart, Mavi Kart, and Elektronik Kart — with each entry specifying a category, type description, and price in Turkish Lira.

Network Maps

get_network_map returns a list of objects each containing a title and url pointing to map image resources, covering metro, tramway, and construction maps. These URLs can be embedded directly in transit planning interfaces.

Reliability & maintenanceVerified

The Metro API is a managed, monitored endpoint for metro.istanbul — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when metro.istanbul changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official metro.istanbul API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
6h ago
Latest check
6/6 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Display color-coded line routes using the RGB values from get_all_lines in a custom transit map.
  • Build a full Istanbul Metro station search by indexing the name, display_name, and sap_code fields from get_all_stations.
  • Show real-time service disruption banners in a commuter app using seferDurumlari from get_service_status.
  • Surface accessibility alerts by monitoring elevator and escalator fault counts from get_service_status.
  • Calculate fare estimates for different card types using the category and price fields from get_ticket_prices.
  • Render a station-by-station route view for a given line using the stations array and operating metrics from get_line_detail.
  • Embed up-to-date network map images using the URLs returned by get_network_map.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does metro.istanbul offer an official developer API?+
Metro Istanbul does not publish a documented public developer API. This Parse API provides structured access to line, station, status, fare, and map data from metro.istanbul.
What does `get_service_status` return when there are no disruptions?+
seferDurumlari returns an empty array during normal service. The response still includes equipment fault counts — strings representing the number of faulty elevators, escalators, moving walkways, restrooms, baby rooms, and prayer rooms across the network, regardless of train service status.
Which line codes are accepted by `get_line_detail`?+
The endpoint accepts 13 codes: F1, F4, M1A, M1B, M2, M3, M4, M5, M6, M7, M8, M9, and T1. These cover metro, tramway, and funicular lines. Submitting an unlisted code will not return valid line data.
Does the API return real-time train arrival predictions or timetables?+
Not currently. The API covers live service disruptions, equipment fault counts, line operating metrics (e.g., total journey time and operating hours), and static station sequences — but not per-station arrival times or live vehicle positions. You can fork this API on Parse and revise it to add an endpoint targeting arrival or timetable data if metro.istanbul exposes that information.
Are stations filterable by line directly, or do I need to filter client-side?+
get_all_stations returns all stations across all lines in a single response; there is no line_code filter parameter on that endpoint. Each station object includes line_id and line_name fields, so filtering by line is straightforward client-side. Alternatively, get_line_detail returns a stations array for a specific line when you supply a line_code. You can fork this API on Parse and revise it to add a filtered station endpoint if you need server-side filtering.
Page content last updated . Spec covers 6 endpoints from metro.istanbul.
Related APIs in Maps GeoSee all →
citymapper.com API
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.
mbta.com API
Track real-time subway, bus, and commuter rail departures across Greater Boston, check schedules and service alerts, and find detailed information about routes and stops. Plan your commute with up-to-the-minute MBTA transit data and never miss your connection.
ratp.fr API
Monitor real-time traffic conditions and service disruptions across Paris's RATP and RER networks to plan your commute efficiently. Get instant updates on line statuses, delays, and service alerts for all metro and regional rail lines.
turkishairlines.com API
Search Turkish Airlines flights and airport locations, then check real-time flight status to stay updated on your travel plans. Browse available flights to find the best options for your journey, though availability searches may occasionally experience interruptions due to site protection measures.
gtt.to.it API
Access GTT (Turin) public transport data including available service basins, line routes and stop lists, full-day timetables by route and date, stop search, and real-time arrivals with accessibility details.
metro.sk API
Check current fuel prices at Metro Cash & Carry gas stations throughout Slovakia and locate available stores in your area. Get real-time pricing information to find the best deals at participating Metro locations.
rfi.it API
Check real-time train schedules and station information across Italy's railway network, search for stations, and get live alerts about delays and service disruptions. Monitor train circulation status and access detailed station mappings to plan your journeys efficiently.
amtrak.com API
Search for Amtrak trains across stations, compare fares, and discover discounts to plan your rail journey with current pricing and availability. Get detailed train information, autocomplete station names, and find the cheapest routes for your travel dates.