Search for content

Quick Start - Map Matching API

Quick Start

With the Map Matching service you can assign GPS positions to road segments on a digital map.

Using the Map Matching API is simple. Follow the steps on this page to get started with position matching. For an easy integration you can also use the clients for Java, C# and TypeScript on GitHub.

Please note the individual rate and request limits for each API. You can find all limits in our FAQ.

API Endpoint

To send a position matching request you need to use the following API Endpoint

https://api.myptv.com/mapmatch/v1/positions

 

Request

To match a single position near Dudelange, Luxemburg to a road use the latitude and longitude of the position in the request path.

You can test this by entering the URL into your web browser (be sure to replace YOUR_API_KEY with your actual API key).

https://api.myptv.com/mapmatch/v1/positions/49.480301/6.110667?apiKey=YOUR_API_KEY

Alternatively you can choose one of the following options to send your request. You also have the option to send the API key in the request header.

cURL:

curl --location --request GET "https://api.myptv.com/mapmatch/v1/positions/49.480301/6.110667" --header "ApiKey: YOUR_API_KEY"

PowerShell:

$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("ApiKey", "YOUR_API_KEY")
$response = Invoke-RestMethod "https://api.myptv.com/mapmatch/v1/positions/49.480301/6.110667" -Method GET -Headers $headers
$response | ConvertTo-Json

 

Get your free API Access Key

Response

The call results in a detailed description of the match including the exact match coordinates (latitude/longitude) on the road segment.

{
  "latitude": 49.480319165,
  "longitude": 6.1104342698,
  "matchDistance": 17,
  "angleDifference": 3.16
}