Map Matching API to snap geo coordinates to roads

Map Matching API

Snap GPS data to road networks and get detailed route analysis

Map Matching API processes raw GPS data and aligns it with a road network, considering factors such as the direction of travel, road speed limits, and other contextual information.

Furthermore, the Map Matching API provides detailed information about the route, including road class, surface type, speed limit, number of lanes, and estimated drive time.

The Map Matching API can be useful in a variety of applications, such as fleet management, logistics, transportation, and location-based services. By aligning raw GPS data with road networks and providing detailed information about the route, the API enables more accurate and efficient route planning, improved safety, and enhanced navigation experiences.

Try Map Matching API

Try out the Geoapify Map Matching API below. Choose your track from the dropdown then click “match to roads”. See the GPS route on a map, and hover over individual steps to see details for each.

Visit our Map Matching API Playground to try different tracks or upload your own.

Use Cases

Map matching has lots of benefits for your business:

  • Route analysis to understand driving times and conditions
  • Comparing routes to see which are faster, safer, or easier to drive
  • Carrying out risk assessments
  • Keeping an eye out for dangerous driving styles

By using map matching algorithms for GPS data you can get detailed statistics. Those statistics help you make better decisions for your drivers and fleet. The vehicle tracking market is growing with an expected CAGR of 20% by 2025. More and more companies are seeing the benefits of technology like our Map Matching API to keep their drivers and customers safe, and provide a better service.

Route visualization, South Anston, UK

Reconstruct and visualize routes

Our API analyzes GPS information and maps it to existing streets and roads. The API returns the route the vehicle took, and lets you see that route on a map.

Maybe you have a fleet of delivery trucks dropping off parcels around Edinburgh, Scotland. You know some of the city center streets are narrow and difficult to navigate, so you've constructed routes that you know are safe for your delivery trucks. Use Map Matching API to see the routes for yourself and help decide which ones are more convenient for your fleet.

Motorway route details

Analyze routes

Map matching API returns lots of information about a route, including road class and surface, number of lanes, travel time and speed limit.

Say you have a home cleaning service located on the outskirts of Hamburg, Germany. You can use Map Matching API to analyze the routes your team is using. Now you can see which ones give them quickest access to different parts of the city, which ones have low speed limits that could slow them down, and which roads have the best surfaces.

Detect going over speed limits

Detect dangerous driving styles

Map Matching API provides timestamps for each GPS position so you can see the actual speed for each road segment. You can combine that information with the speed limit and road restrictions information returned by the API. Now you can see if any of your fleet might be driving dangerously or not observing traffic rules.

This makes a big difference, with 42% of companies seeing fewer safety accidents after monitoring driver behavior.

Features and Capabilities

Easy-to-use and solid

The API works via HTTP Post request, so you can input large volumes of data in one request. This lets you process a large number of GPS coordinates and visualize the corresponding routes.

Travel modes

Use our API to analyze different travel modes. Our map matching algorithm for GPS data accepts GPS tracks for driving, walking and cycling. The API constructs the route based on the restrictions and limits for the travel mode provided.

For example, for a driving route it will only show driving roads. For a bicycle route it will add in bicycle roads, and block areas where bicycles cannot go.

Go deeper by specifying the vehicle type. For example, light, medium, or heavy trucks, or those carrying dangerous goods. Specify bicycle, road bicycle, mountain bike, or a scooter or motorcycle. Search for public transport routes only, or those with bus lanes.

Get detailed route information

The API returns detailed route information including road type, surface, time, speed limits and restrictions. Use the information to make your existing routes better, or to adjust routes to get more drivable options.

Getting started

Step 1. Register and get an API Key

You'll need an API key to use our Map Matching API. Register on MyProjects Geoapify and get an API key.

Step 2. Generate HTTP Post request

Generate HTTP Post request. Generate an HTTP Post request with input data and make the call. Visit the Playground and Documentationto learn about Map Matching API request/response structure.

Here is an example of generating a request from GPX-track:

const data = {
      mode: 'drive', // or 'walk' or 'bicycle'
      waypoints: gpxTrackToWaypoints(gpxJSONObject)

fetch('', {
  method: 'post',
  headers: {
    'Content-Type': 'application/json'
  body: JSON.stringify(data)
  .then(result => console.log(result));
Step 3. Process or visualize results

The API will return a FeatureCollection GeoJSON object. As GeoJSON is natively supported by map client libraries the result can be easily visualized on the map. Find code samples of Map Matching API data processing and GeoJSON visualization on Geoapify APIDocs.


Our pricing model is simple and easy to understand. We use a credit-based system to unify the cost for different APIs.

For every 100 waypoints processed by the Map Matching API, one credit is used. So, 100 waypoints = 1 credit.

You can get started with the API right away with our free plan, which provides you with 3,000 credits per day. If you need more credits, you can easily upgrade your plan to accommodate your needs.

Not sure which plan is right for you? Get in touch and we'll help you figure out which solution you need. You can learn more about pricing on the Pricing Details page.


Which data sources do you use to get road details?

We use OpenStreetMap data to give the API results, which contains the most up-to-date road network information. This ensures that you have access to accurate and reliable data to process your GPS coordinates and align them with the road network.

How detailed a GPS track do I need to put in to get satisfactory results?

It depends on the accuracy of the GPS track and travel mode. You can upload custom GPX tracks on our Playground. Try it out and see what the optimal input quality is for your use case.

Can I get route information tailored to different types of vehicle?

Of course. Our API can return route information for driving, walking, or cycling.

What does snap to road mean?

In the context of GPS data processing, "snap to road" means aligning a GPS point to the nearest point on a road network. This process involves matching the GPS point to the most likely road segment based on various factors such as the direction of travel, speed limits, and other contextual information. By snapping the GPS point to the nearest road segment, it becomes easier to analyze and visualize the corresponding route and estimate factors such as travel time, distance, and speed. This process is typically done using a map-matching algorithm, such as the one used by the Geoapify Map Matching API.

How to create GPS route from GPX file?

If you already have GPS data in the form of a GPX file, you can use the Map Matching API to align the raw GPS data with the road network and get more accurate information about the route, including road class, surface type, speed limit, number of lanes, and estimated drive time.

World map

Try Map Matching API now!

Get accurate and detailed route information from GPS inputs.

Register an API key and get started for free today. Got questions? Get in touch and we'll help you get started.