{
  "openapi": "3.0.3",
  "info": {
    "title": "PTV Flows Realtime Traffic API",
    "description": "The PTV Flows Realtime Traffic API provides the realtime traffic data of your product instance.",
    "version": "1.0.0-SNAPSHOT"
  },
  "tags": [
    {
      "name": "Traffic"
    }
  ],
  "paths": {
    "/realtime/traffic": {
      "get": {
        "tags": [
          "Traffic"
        ],
        "summary": "Realtime traffic data",
        "description": "get realtime traffic data of the product instance in protobuf format, gzipped.",
        "operationId": "getTrafficData",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/gzip": {
                "schema": {
                  "$ref": "#/components/schemas/ForecastDataMessageProto"
                }
              }
            }
          },
          "304": {
            "description": "Not modified. There are no updated data.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access rights. Traffic data API must be purchased.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Traffic data are not available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "required": [
          "description",
          "errorCode",
          "traceId"
        ],
        "type": "object",
        "properties": {
          "description": {
            "description": "A human readable message that describes the error.",
            "type": "string"
          },
          "errorCode": {
            "description": "A constant string that can be used to identify this error class programmatically. An errorCode can have **details** to provide information in additional properties which are described with the code they apply to. They are of type string unless otherwise specified.  \n\nNote that additional errorCodes as well as the **details** of existing errorCodes may be added at any time. Furthermore, the **description** may change at any time.  \n\n**HTTP status code: 400**  \n* `GENERAL_VALIDATION_ERROR` - The validation of the request failed. Details can be found in **causes**.  \n* `GENERAL_PARSING_ERROR` - The JSON syntax is invalid.  \n\n**HTTP status code: 401**  \n* `GENERAL_UNAUTHENTICATED` - Invalid or missing authentication credentials.  \n  * `message` - An additional error message.  \n\n**HTTP status code: 403**  \n* `GENERAL_FORBIDDEN` - Insufficient access rights.  \n* `GENERAL_QUOTA_EXCEEDED` - The transaction limit is exceeded.  \n  * `message` - An additional error message.  \n\n**HTTP status code: 404**  \n* `GENERAL_RESOURCE_NOT_FOUND` - A requested resource does not exist.  \n  * `message` - An additional error message.  \n\n**HTTP status code: 429**  \n* `GENERAL_RATE_LIMIT_EXCEEDED` - The rate limit is exceeded.  \n\n**HTTP status code: 500**  \n* `GENERAL_INTERNAL_SERVER_ERROR` - The request could not be processed due to an internal error.  \n  * `message` - An additional error message.  \n  * `hint` - A hint how to solve the problem.  \n\n**HTTP status code: 503**  \n* `GENERAL_SERVICE_UNAVAILABLE` - The service is temporarily unavailable.",
            "type": "string"
          },
          "traceId": {
            "description": "A unique identifier of the corresponding trace forest. It can be used to trace errors by the support.",
            "type": "string"
          },
          "errorId": {
            "description": "A unique identifier specific to this error instance. It can be used to trace errors by the support.",
            "type": "string"
          },
          "causes": {
            "description": "A list of affected parameters and/or properties that caused this error.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CausingError"
            }
          },
          "details": {
            "description": "Additional properties specific to this error class.",
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CausingError": {
        "required": [
          "description",
          "errorCode"
        ],
        "type": "object",
        "properties": {
          "description": {
            "description": "A human readable message that describes the error.",
            "type": "string"
          },
          "errorCode": {
            "description": "A constant string that can be used to identify this error class programmatically. An errorCode can have **details** to provide information in additional properties which are described with the code they apply to. They are of type string unless otherwise specified.  \n\nNote that additional errorCodes as well as the **details** of existing errorCodes may be added at any time. Furthermore, the **description** may change at any time.  \n\n**Error codes for** `GENERAL_VALIDATION_ERROR`  \n* `GENERAL_INVALID_VALUE` - A parameter is set to an invalid value.  \n  * `value` - The invalid value.  \n* `GENERAL_UNRECOGNIZED_PARAMETER` - A parameter is unknown.  \n* `GENERAL_MISSING_PARAMETER` - A required parameter is missing.  \n* `GENERAL_MINIMUM_LENGTH_VIOLATED` - The minimum length is violated.  \n  * `minimumLength` - The minimum length (integer).  \n* `GENERAL_MAXIMUM_LENGTH_VIOLATED` - The maximum length is violated.  \n  * `maximumLength` - The maximum length (integer).  \n* `GENERAL_DUPLICATE_ID` - Two or more objects of the same type have the same ID.  \n  * `value` - The duplicated value.  \n  * `indexes` - The list indexes of the objects with the same ID.  \n* `GENERAL_INVALID_INTERVAL` - A time interval is invalid, i.e. start is greater than end.  \n* `GENERAL_MINIMUM_VALUE_VIOLATED` - The minimum value restriction is violated.  \n  * `minimumValue` - The minimum value (integer or double).  \n* `GENERAL_MAXIMUM_VALUE_VIOLATED` - The maximum value restriction is violated.  \n  * `maximumValue` - The maximum value (integer or double).  \n* `GENERAL_DUPLICATE_PARAMETER` - A parameter is duplicated.  \n* `GENERAL_INVALID_LIST` - A list has an invalid format such as duplicate commas.  \n  * `value` - The invalid list.",
            "type": "string"
          },
          "parameter": {
            "description": "The name of the affected query or path parameter or a JSONPath to the affected property of the request.",
            "type": "string"
          },
          "details": {
            "description": "Additional properties specific to this error class.",
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "ForecastDataMessageProto": {
        "description": "```\nsyntax = \"proto3\";\n\nimport \"google/protobuf/timestamp.proto\";\n\npackage com.ptvgroup.archimedes.dataprv.protobuf.traffic.realtime.output.v1;<br>\n\noption java_package = \"com.ptvgroup.archimedes.dataprv.protobuf.traffic.realtime.output.v1\";\noption java_outer_classname = \"DataprvTrafficRealtimeData\";\noption java_multiple_files = false;\n\noption csharp_namespace = \"PTVGroup.Flows.Protos.DataPrv.Traffic.Realtime.Output.V1\";\n\nmessage DataprvTrafficRealtimeDataProto {\n  string timezone = 1;\n  google.protobuf.Timestamp snapshot_date_time = 2;\n  repeated StreetTraffic street_traffic = 3;\n\n  message StreetTraffic {\n    reserved 4;\n\n    int32 id = 1;\n    int32 from_node_id = 2;\n    double speed_kmh = 3;\n    int32 probe_count = 5;  // reserved for internal purposes and not reliable.\n    string olr_code = 6;\n  }\n}\n",
        "type": "string"
      }
    },
    "headers": {
      "ETag": {
        "description": "An Etag is an identifier for a specific version of data. You should retain the latest ETag value you receive. The next time you call the same API to get data, you should use the If-None-Match request header along with the retained ETag value, so that the API will send back a full response if and only if the data changes.",
        "schema": {
          "type": "string"
        }
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "apiKey"
      }
    }
  },
  "security": [
    {
      "apiKeyAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://api.ptvgroup.tech/flows/realtime-traffic/v1"
    }
  ]
}