If you are not yet familiar with GraphQL and GraphiQL it is highly recommended to review those pages at first.
| Term | Explanation | 
|---|---|
| Route | A public transport service shown to customers under a single name, usually from point A to B and back. For example: trams 1 and 1A, buses 18 and 102T, or train A. Commonly used synonym: line  | 
| Pattern | A sequence of stops as used by a specific direction (i.e. inbound or outbound journey) and variant of a route. For example, a variant of a route could be a tram entering service from the depot and joining at the middle of the route or a route might have a short term diversion without changing the route name (longer diversions are usually marked as different routes).  | 
| Trip | A specific occurance of a pattern, usually identified by the route and exact departure time from the first stop. For example: tram 15 leaving from Keilaniemi on 2024-12-18 at 13:13, or more generally leaving from Keilaniemi at 13:13 on specified days.  | 
Note: For more details about the query types routes and pattern and their parameters you can use the Documentation Explorer provided in GraphiQL.
Note: If the examples provided with an id or other parameter do not return what is expected then the value in question may not be in use any more and you should try again with an existing value.
{
  routes(name: "10") {
    gtfsId
    shortName
    longName
    mode
  }
}{
  routes(name: "58", transportModes: BUS) {
    gtfsId
    shortName
    longName
    mode
  }
}{
  routes(name: "1", transportModes: TRAM) {
    gtfsId
    shortName
    longName
    mode
  }
}{
  routes(name: "59", transportModes: BUS) {
    shortName
    longName
    patterns {
      code
      directionId
      name
      headsign
    }
  }
}Example response:
{
  "data": {
    "routes": [
      {
        "shortName": "59",
        "longName": "Sompasaari-Kalasatama(M)-Pasila-Pajamäki",
        "patterns": [
          {
            "code": "HSL:1059:0:01",
            "directionId": 0,
            "name": "59 to Pajamäki (HSL:1461110)",
            "headsign": "Pajamäki"
          },
          {
            "code": "HSL:1059:1:01",
            "directionId": 1,
            "name": "59 to Polariksenkatu (HSL:1100128)",
            "headsign": "Sompasaari"
          }
        ]
      }
    ]
  }
}See previous example on how to find pattern IDs for a route
code in a pattern object{
  pattern(id: "HSL:1059:0:01") {
    name
    stops {
      name
    }
  }
}{
  pattern(id: "HSL:1059:0:01") {
    code
    directionId
    name
    headsign
    trips {
      gtfsId
      tripHeadsign
      routeShortName
      directionId
    }
  }
}{
  trip(id: "HSL:1020_20240314_Pe_1_0933") {
    tripHeadsign
    occupancy {
      occupancyStatus
    }
  }
}Example response:
{
  "data": {
    "trip": {
      "tripHeadsign": "Munkkivuori",
      "occupancy": {
        "occupancyStatus": "FEW_SEATS_AVAILABLE"
      }
    }
  }
}