TomTom Traffic Incidents API

Real-time traffic incident data

OpenAPI Specification

tomtom-traffic-incidents-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  contact:
    x-twitter: TomTom
  description: "The Maps API web services suite offers the following APIs:\n  - Raster\n  The Maps Raster API renders map data that is divided into gridded sections called tiles. Tiles are square images (png or jpg format) in various sizes which are available at 19 different zoom levels, ranging from 0 to 20. For zoom level 0, the entire earth is displayed on one single tile, while at zoom level 20, the world is divided into 2<sup>40</sup> tiles.\n  - Vector\n  Similar to Maps Raster API, the Maps Vector API serves data on different zoom level ranging from 0 to 22. For zoom level 0, the entire earth is displayed on one single tile, while at zoom level 22, the world is divided into 2<sup>44</sup> tiles.\n  The Maps Vector Service delivers geographic map data packaged in a vector representation of squared sections called vector tiles. Each tile includes pre-defined collections of map features (points, lines, road shapes, water polygons, building footprints, ect.) delivered in one of the specified vector formats. Format of the tile is formally described using protobuf schema."
  title: Maps Additional Data Traffic Incidents API
  version: 1.0.0
  x-apisguru-categories:
  - location
  x-logo:
    url: https://twitter.com/TomTom/profile_image?size=original
  x-origin:
  - converter:
      url: https://github.com/lucybot/api-spec-converter
      version: 2.7.31
    format: openapi
    url: https://developer.tomtom.com/system/files/swagger_models/maps_api_0.yaml
    version: '3.0'
  x-providerName: tomtom.com
  x-serviceName: maps
servers:
- url: https://api.tomtom.com
security:
- api_key: []
tags:
- name: Traffic Incidents
  description: Real-time traffic incident data
paths:
  /traffic/services/{versionNumber}/incidentDetails:
    get:
      operationId: getIncidentDetails
      summary: Get Incident Details
      description: Returns detailed information about traffic incidents within a bounding box or around specific coordinates. Includes incident type, delay, description, and affected road segments.
      tags:
      - Traffic Incidents
      parameters:
      - name: versionNumber
        in: path
        required: true
        schema:
          type: integer
          enum:
          - 5
      - name: key
        in: query
        required: true
        schema:
          type: string
        description: TomTom API key
      - name: bbox
        in: query
        schema:
          type: string
        description: Bounding box (minLon,minLat,maxLon,maxLat)
        example: -8.671875,36.173357,3.076171,57.040730
      - name: fields
        in: query
        schema:
          type: string
        description: Fields to include in response (JSON path filter)
      - name: language
        in: query
        schema:
          type: string
        description: Language for incident descriptions (IETF BCP 47)
        example: en-GB
      - name: categoryFilter
        in: query
        schema:
          type: integer
        description: 'Bitmask for incident categories: 0=Unknown, 1=Accident, 2=Fog, 4=Dangerous conditions, 8=Rain, 16=Ice, 32=Jam, 64=Lane closed, 128=Road closed, 256=Road works, 512=Wind, 1024=Flooding, 2048=Broken down vehicle'
      - name: timeValidityFilter
        in: query
        schema:
          type: string
          enum:
          - present
          - future
        description: Filter by incident time validity
      - name: t
        in: query
        schema:
          type: string
        description: Traffic model ID from traffic model endpoint
      responses:
        '200':
          description: Traffic incident details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IncidentDetailsResponse'
  /traffic/services/{versionNumber}/incidentViewport/{boundingBox}/{overview}/{copyright}/{zoom}/{format}:
    get:
      operationId: getIncidentViewport
      summary: Get Incident Viewport
      description: Returns a viewport of traffic incidents for a given map area.
      tags:
      - Traffic Incidents
      parameters:
      - name: versionNumber
        in: path
        required: true
        schema:
          type: integer
          enum:
          - 4
      - name: boundingBox
        in: path
        required: true
        schema:
          type: string
        description: Bounding box coordinates
      - name: overview
        in: path
        required: true
        schema:
          type: string
      - name: copyright
        in: path
        required: true
        schema:
          type: string
      - name: zoom
        in: path
        required: true
        schema:
          type: integer
      - name: format
        in: path
        required: true
        schema:
          type: string
          enum:
          - json
          - jsonp
          - xml
      - name: key
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Incident viewport data
          content:
            application/json:
              schema:
                type: object
components:
  schemas:
    IncidentDetailsResponse:
      type: object
      properties:
        incidents:
          type: array
          items:
            $ref: '#/components/schemas/Incident'
    IncidentProperties:
      type: object
      properties:
        id:
          type: string
        iconCategory:
          type: integer
        magnitudeOfDelay:
          type: integer
          description: 0=Unknown, 1=Minor, 2=Moderate, 3=Major, 4=Undefined
        startTime:
          type: string
          format: date-time
        endTime:
          type: string
          format: date-time
        from:
          type: string
        to:
          type: string
        length:
          type: number
        delay:
          type: integer
          description: Delay in seconds
        roadNumbers:
          type: array
          items:
            type: string
        timeValidity:
          type: string
          enum:
          - present
          - future
        probabilityOfOccurrence:
          type: string
        numberOfReports:
          type: integer
        lastReportTime:
          type: string
          format: date-time
        events:
          type: array
          items:
            type: object
            properties:
              description:
                type: string
              code:
                type: integer
              iconCategory:
                type: integer
    Incident:
      type: object
      properties:
        type:
          type: string
        geometry:
          type: object
          properties:
            type:
              type: string
            coordinates:
              type: array
        properties:
          $ref: '#/components/schemas/IncidentProperties'
  securitySchemes:
    api_key:
      in: query
      name: key
      type: apiKey