Journey search (出発 / 到着 / 始発 / 終電)
v1.0.0
OpenAPI 3.0.3

Transit API

Public, read-only transit routing API for Japan.

All times are seconds from the service-date midnight in the result's timezone; values may exceed 86400 (after-midnight service) or be negative (yesterday's service still running) — format for display client-side. Ids are feed-qualified ("feedId:localId"). Geographic endpoints accept "geo:,".

Public API (CORS-enabled, read-only).

Client Libraries

planning

Journey search and guide-UI route options.

Journey search (出発 / 到着 / 始発 / 終電)

Endpoints accept a station id (feedId:stopId) or geo:,. Times are seconds from the service-date midnight in the result timezone and may exceed 86400 or be negative.

Query Parameters
  • from
    Type: string
    min length:  
    1
    required

    Origin: a station id (feedId:stopId) or geo:,.

  • to
    Type: string
    min length:  
    1
    required

    Destination: a station id (feedId:stopId) or geo:,.

  • fromLabel
    Type: string
    min length:  
    1
    max length:  
    120

    Optional display name for the origin.

  • toLabel
    Type: string
    min length:  
    1
    max length:  
    120

    Optional display name for the destination.

  • viaLabel
    Type: string
    min length:  
    1
    max length:  
    120
  • date
    Type: string Pattern: ^\d{8}$

    Service date YYYYMMDD; defaults to today in the result timezone.

  • time
    Type: string Pattern: ^\d{1,2}:\d{2}(:\d{2})?$

    HH:MM or HH:MM:SS; defaults to the current time.

  • type
    Type: stringenum

    出発 / 到着 / 始発 / 終電.

    values
    • departure
    • arrival
    • first
    • last
  • allowModes
    Type: string

    Comma-separated transit modes to allow (pre-scan filter), e.g. rail,bus.

  • avoidModes
    Type: string

    Comma-separated transit modes to avoid (pre-scan filter), e.g. bus,air,ferry.

  • avoidWalk
    Type: stringenum

    When true, exclude any itinerary containing a walking segment.

    values
    • true
    • false
  • maxTransfers
    Type: integer
    min:  
    0
    max:  
    8

    Integer numbers.

  • numItineraries
    Type: integer
    min:  
    1
    max:  
    6

    Integer numbers.

  • via
    Type: array string[] …3

    Up to 3 経由 waypoints, repeated: a station id or geo:,. Departure/arrival searches only.

  • viaLabel
    Type: array string[] …3

    Optional display label for each via, positionally matched to via[].

Responses
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for get/api/v1/plan
curl 'https://api.transit.ls8h.com/api/v1/plan?from=&to=&fromLabel=&toLabel=&viaLabel=&date=&time=&type=departure&allowModes=&avoidModes=&avoidWalk=false&maxTransfers=3&numItineraries=3&via=&viaLabel='
{
  "date": "string",
  "type": "departure",
  "timezone": "string",
  "from": {
    "id": "string",
    "name": "string"
  },
  "to": {
    "id": "string",
    "name": "string"
  },
  "journeys": [
    {
      "departureSecs": 1,
      "arrivalSecs": 1,
      "durationSecs": 1,
      "transferCount": 1,
      "fare": {
        "currency": "string",
        "ticket": 1,
        "ic": 1
      },
      "accessWalkSecs": 1,
      "egressWalkSecs": 1,
      "legs": [
        {
          "kind": "transit",
          "routeName": "string",
          "mode": "string",
          "color": "string",
          "headsign": "string",
          "tripId": "string",
          "from": {
            "id": "string",
            "name": "string",
            "platformCode": "string"
          },
          "to": {
            "id": "string",
            "name": "string",
            "platformCode": "string"
          },
          "departureSecs": 1,
          "arrivalSecs": 1,
          "headwayBased": true
        }
      ]
    }
  ]
}

Guidance plan: ranked options, comparison basis, map geometry

A guide-UI contract over the planner: ranked options with metrics, cognitive load, decision factors, next action, coverage evidence and map geometry as first-class fields.

Query Parameters
  • from
    Type: string
    min length:  
    1
    required

    Origin: a station id (feedId:stopId) or geo:,.

  • to
    Type: string
    min length:  
    1
    required

    Destination: a station id (feedId:stopId) or geo:,.

  • fromLabel
    Type: string
    min length:  
    1
    max length:  
    120

    Optional display name for the origin.

  • toLabel
    Type: string
    min length:  
    1
    max length:  
    120

    Optional display name for the destination.

  • viaLabel
    Type: string
    min length:  
    1
    max length:  
    120
  • date
    Type: string Pattern: ^\d{8}$

    Service date YYYYMMDD; defaults to today in the result timezone.

  • time
    Type: string Pattern: ^\d{1,2}:\d{2}(:\d{2})?$

    HH:MM or HH:MM:SS; defaults to the current time.

  • type
    Type: stringenum

    出発 / 到着 / 始発 / 終電.

    values
    • departure
    • arrival
    • first
    • last
  • allowModes
    Type: string

    Comma-separated transit modes to allow (pre-scan filter), e.g. rail,bus.

  • avoidModes
    Type: string

    Comma-separated transit modes to avoid (pre-scan filter), e.g. bus,air,ferry.

  • avoidWalk
    Type: stringenum

    When true, exclude any itinerary containing a walking segment.

    values
    • true
    • false
  • maxTransfers
    Type: integer
    min:  
    0
    max:  
    8

    Integer numbers.

  • numItineraries
    Type: integer
    min:  
    1
    max:  
    6

    Integer numbers.

  • strategy
    Type: stringenum
    values
    • balanced
    • fastest
    • fewestTransfers
    • lowestFare
    • shortestWalk
  • live
    Type: stringenum
    values
    • true
    • false
  • tracking
    Type: stringenum
    values
    • none
    • origin
    • destination
    • both
  • via
    Type: array string[] …3

    Up to 3 経由 waypoints, repeated: a station id or geo:,. Departure/arrival searches only.

  • viaLabel
    Type: array string[] …3

    Optional display label for each via, positionally matched to via[].

Responses
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for get/api/v1/guidance/plan
curl 'https://api.transit.ls8h.com/api/v1/guidance/plan?from=&to=&fromLabel=&toLabel=&viaLabel=&date=&time=&type=departure&allowModes=&avoidModes=&avoidWalk=false&maxTransfers=3&numItineraries=3&strategy=balanced&live=false&tracking=none&via=&viaLabel='
{
  "date": "string",
  "type": "departure",
  "timezone": "string",
  "from": {
    "id": "string",
    "name": "string"
  },
  "to": {
    "id": "string",
    "name": "string"
  },
  "live": {
    "mode": "manual",
    "tracking": "none",
    "refreshAfterSecs": 1,
    "anchorSecs": 1
  },
  "osm": {
    "status": "notApplicable",
    "regionId": "string",
    "attribution": "string"
  },
  "coverage": {
    "feeds": [
      {
        "feedId": "string",
        "name": "string",
        "transitModes": [
          "tram"
        ],
        "serviceEnd": "string",
        "stale": true
      }
    ],
    "transitModes": [
      "tram"
    ],
    "notices": [
      {
        "severity": "info",
        "code": "loadedDataScope",
        "message": "string",
        "action": "string",
        "modes": [
          "tram"
        ],
        "walk": true
      }
    ]
  },
  "decision": {
    "strategy": "balanced",
    "recommendedOptionId": "string",
    "primaryFactors": [
      {
        "kind": "arrivalTime",
        "effect": "advantage",
        "magnitude": "small",
        "deltaSecs": 1,
        "deltaCount": 1,
        "deltaAmount": 1
      }
    ],
    "tradeoffs": [
      {
        "kind": "arrivalTime",
        "effect": "advantage",
        "magnitude": "small",
        "deltaSecs": 1,
        "deltaCount": 1,
        "deltaAmount": 1
      }
    ]
  },
  "options": [
    {
      "id": "string",
      "rank": 1,
      "score": 1,
      "recommended": true,
      "selectedFor": "balanced",
      "confidence": "high",
      "metrics": {
        "durationSecs": 1,
        "transitSecs": 1,
        "walkSecs": 1,
        "waitSecs": 1,
        "transferCount": 1,
        "headwayLegCount": 1,
        "fare": {
          "currency": "string",
          "ticket": 1,
          "ic": 1
        }
      },
      "load": {
        "overall": "low",
        "walking": "low",
        "waiting": "low",
        "transfer": "low",
        "uncertainty": "low"
      },
      "decisionFactors": [
        {
          "kind": "arrivalTime",
          "effect": "advantage",
          "magnitude": "small",
          "deltaSecs": 1,
          "deltaCount": 1,
          "deltaAmount": 1
        }
      ],
      "nextAction": {
        "kind": "walk",
        "from": {
          "id": "string",
          "name": "string",
          "platformCode": "string"
        },
        "to": {
          "id": "string",
          "name": "string",
          "platformCode": "string"
        },
        "departureSecs": 1,
        "timeBudgetSecs": 1,
        "routeName": "string"
      },
      "map": {
        "bounds": {
          "minLat": 1,
          "minLon": 1,
          "maxLat": 1,
          "maxLon": 1
        },
        "points": [
          {
            "id": "string",
            "name": "string",
            "lat": 1,
            "lon": 1,
            "role": "origin"
          }
        ],
        "segments": [
          {
            "kind": "walk",
            "fromPointId": "string",
            "toPointId": "string",
            "routeName": "string",
            "color": "string",
            "geometrySource": "osmWalk",
            "fallbackReason": "noWalkingGraph",
            "polyline": [
              {
                "lat": 1,
                "lon": 1
              }
            ]
          }
        ]
      },
      "journey": {
        "departureSecs": 1,
        "arrivalSecs": 1,
        "durationSecs": 1,
        "transferCount": 1,
        "fare": {
          "currency": "string",
          "ticket": 1,
          "ic": 1
        },
        "accessWalkSecs": 1,
        "egressWalkSecs": 1,
        "legs": [
          {
            "kind": "transit",
            "routeName": "string",
            "mode": "string",
            "color": "string",
            "headsign": "string",
            "tripId": "string",
            "from": {
              "id": "string",
              "name": "string",
              "platformCode": "string"
            },
            "to": {
              "id": "string",
              "name": "string",
              "platformCode": "string"
            },
            "departureSecs": 1,
            "arrivalSecs": 1,
            "headwayBased": true
          }
        ]
      }
    }
  ]
}

search (Collapsed)

Station, place and reverse-geocoding autocomplete.

stations (Collapsed)

Station detail and departure boards.

catalog (Collapsed)

Ingested feeds and operator branding/license metadata.

map (Collapsed)

Map scene assets for guidance rendering.

system (Collapsed)

Operational probes.

system Operations

Models