API – line trajectories

Information on the geographic routes of public transport lines.

Data is returned only for lines that operate services on the given day – and only for the route variants in force that day. Data is reset each day at 04:00.

  • Endpoint: GET https://www.zditm.szczecin.pl/api/v1/trajectories/{lineId} (the {lineId} parameter can be obtained via the Lines API – the id field)
  • Data type: application/json (GeoJSON)
  • Update frequency: once a day

Data structure

{
  "type": "FeatureCollection",
  "attributes": {
    "line_id": 1,
    "line_number": "1",
    "line_type": "day",
    "line_subtype": "normal",
    "vehicle_type": "tram",
    "updated_at": "2023-06-02T19:29:07.463152Z"
  },
  "features": [
    {
      "type": "Feature",
      "properties": {
        "route_variant_number": 11,
        "route_variant_type": "default"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            14.4884117153,
            53.4571634728
          ],

          ...

        ]
      }
    },

    ...

  ]
}
  • string type – always FeatureCollection
  • object attributes – object containing information about the line
    • int line_id – line identifier (immutable)
    • string line_number – line designation (number) (may change)
    • string line_type – line type:
      • day – day service
      • night – night service
    • string line_subtype – line subtype:
      • normal – regular service
      • semi-fast – semi-fast service
      • fast – fast service
      • replacement – replacement service
      • additional – additional service
      • special – special service
      • tourist – tourist service
    • string vehicle_type – vehicle type:
      • skm – SKM train
      • tram – tram
      • bus – bus
    • string updated_at – timestamp of the last data update
  • array features – array containing each route variant’s geometry
    • string type – always Feature
    • object properties – object with details of this variant:
      • int route_variant_number – variant number (odd = outbound, even = return)
      • string route_variant_type – variant type:
        • default – default (primary) route
        • normal – regular route
        • other – other route (depot access or diversion)
    • object geometry – object containing the route’s coordinates:
      • string type – always LineString
      • array coordinates – array of [longitude, latitude] pairs for each point along the route

General information

  1. The data are provided free of charge under the CC0 1.0 licence, for use in any context, with no prior notification required.
  2. Zarząd Dróg i Transportu Miejskiego w Szczecinie (Roads and Public Transport Authority in Szczecin) does not guarantee the accuracy or completeness of the data and accepts no liability for any loss or decisions made on the basis of this information.
  3. In any product using the data (application, website, publication, etc.), please cite the data source as Zarząd Dróg i Transportu Miejskiego w Szczecinie, or in abbreviated form, ZDiTM Szczecin; although not legally required, this is appreciated.
  4. Where possible, please include a link to this page or to the ZDiTM Szczecin homepage in any product using the data; this is also not a legal obligation.
  5. Clients should recognise and honour the HTTP headers Cache-Control and ETag.
  6. API requests are rate‑limited: 100 requests per minute per IP address across all endpoints. The X-RateLimit-Remaining header shows the number of remaining requests. Once the limit is reached, an HTTP 429 response is returned. The X-RateLimit-Reset header then contains a Unix timestamp for when the limit resets, and the Retry-After header shows the number of seconds until reset.
  7. If possible, please include in your User-Agent header information identifying the entity using the data (e.g. the name of your application, website, or its URL).
  8. In the event of excessive server load, ZDiTM Szczecin reserves the right to partially or fully block access to the API.