Search for content

Quick Start - Street Forecast API

With the Street Forecast service you can get forecast measurements of different dimensions of the traffic network.

Follow the steps on this page to get started with Street Forecast API.

API endpoint

You can use this endpoint to get the speed forecast associated to a specific street.

https://api.myptv.com/mlf/v1/forecast/street/realtime

 

Request

https://api.myptv.com/mlf/v1/forecast/street/realtime?street=123&fromnode=123

The street is identified by the couple (street, fromnode).

Alternatively, you can choose one of the following options to send your request.

cURL

curl --location --request GET "https://api.myptv.com/mlf/v1/forecast/street/realtime?street=123&fromnode=123"

PowerShell

$headers = @{"apiKey" = "YOUR_API_KEY"} 
$Uri = "https://api.myptv.com/mlf/v1/forecast/street/realtime?street=123&fromnode=123" 
$response = Invoke-RestMethod -Uri $uri -Method Get -Headers $headers 
$response | ConvertTo-Json

Response

Below you can find a possible result associated to street (123, 123).

{
"forecastStreet": {
  "streetIdno": 123,
  "fromNode": 123,
  "openLrCode": "4587"
},
"forecastResults": [
  {
    "totime": "2023-12-28T16:16:46.260Z",
    "fromtime": "2023-12-28T16:16:46.260Z",
    "creationtime": "2023-12-28T16:16:46.260Z",
    "flow": 0,
    "speed": 0
  }
]
}

You need to get a Demo or Real instance of PTV Flows before using the API Key.

In order to get a PTV Flows instance, please use the contact form.

Once you have access to the instance, click the API Key button.

Get your free API access Key