Is there an API that gives the highway mile marker for a GPS location?
Yes. Most of what you will find covers one state or one county at a time. The MileCheck API takes a latitude and longitude anywhere in the 50 states and returns the route, mile marker and direction of the nearest marker in one call.
What you find when you search
- State and county GIS layers. Many DOTs and counties publish mile marker points as ArcGIS services, for example Massachusetts and Virginia. Each one has its own fields, route names and coordinate system, and each stops at its own border.
- A state API. Utah's UGRC milepost endpoint returns coordinates for a Utah route and milepost.
- Routing and mileage APIs. Truck routing services return distances and directions. They do not return the number on the nearest marker.
To answer "what highway and mile is this truck at" across state lines, you would have to collect and clean all of those layers yourself. That is the work the MileCheck API has already done.
How the lookup works
Send a GPS position and get back the closest marker on the closest highway, with its distance from your point.
curl "https://api.milecheckapp.com/v1/locate?apikey=YOUR_KEY&lat=47.869&lon=-121.760"
{
"milepost": 25,
"route": "SR 2",
"route_class": "S",
"state": "WA",
"direction": null,
"distance_mi": 0.04,
"coordinates": { "lat": 47.869404, "lon": -121.760126 },
"query": { "lat": 47.869, "lon": -121.76 }
}
- Coverage: all 50 US states, plus British Columbia, Alberta and Manitoba in kilometres.
- Add
state=WAto limit the search to one state. - The same key also returns live closures, crashes and construction from state DOT feeds through
/v1/alerts.
What it costs
A 14-day test key at 100 calls a day is free. Business is $299 a month for 100,000 calls a day. Bigger plans are quoted. If you would rather keep every marker on your own servers with no call limits, the mile marker dataset is a flat yearly license from $5,000.
Mile marker positions are approximate and may not match the sign exactly. In some states the point is surveyed at the sign. In others it is placed along the state's route line at that mile.
Questions people ask
Is there a free mile marker API?
Some states publish their own mile marker layers for free, such as Utah's UGRC milepost endpoint, but each covers one state. The MileCheck API covers all 50 states and has a free 14-day test key at 100 calls a day.
Does Google Maps have a mile marker API?
Google's geocoding returns addresses and place names. It does not return the number on the nearest highway mile marker.
How accurate is the nearest mile marker?
The response includes distance_mi, the distance from your point to the marker. Marker positions come from state DOT data and are approximate. Some states survey each sign and others place points along the route line at each mile.
Can I get the mile markers as a file instead?
Yes. The MileCheck mile marker dataset has 396,842 marker positions in CSV and GeoJSON, refreshed monthly, on a flat yearly license.