This operation was normalized from a MapmyIndia-generation specification. Validate its current Mappls host, path, package entitlement, authentication generation, and commercial availability before production use.
Call the operation
https://apis.mapmyindia.com/advancedmaps/v1/YOUR_REST_KEY/snapToRoadhttps://apis.mapmyindia.com/advancedmaps/v1Parameters
REST_KEYrequiredThe REST API licence key allocated to you by signing into our services and registering yourself as a developer.
YOUR_REST_KEYBody schema
ptsrequiredCoordinate is pair of comma separated longitude & latitude value, First coordinate will be consider as start point; a last coordinate will be as end points and between are via points; like {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...]. At present maximum number of points are limited to 100 in a single request.
78.40573,17.37317;78.40958,17.37314;78.41845,17.37449;78.409992,17.37328;78.420460,17.377443;78.421350,17.380200timestampsTimestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. Values must be integer {timestamp};{timestamp};{timestamp} ...
1700000000000geometriesThis parameter used to change the route geometry format/density (influences overview and per step). Default value is polyline with 5 digit precision; polyline6 for 6digit precision; geojson for geometries as geojson. Please note that “timestamps” parameter is mandatory for enabling geometries.
polylineradiusesStandard deviation of GPS precision used for map matching. If available use GPS accuracy in meters. Default value is 5 metres. Values must be integer {radius};{radius};{radius} ...
50;50;50;50;50;50regionThis parameter is optional for India; for other countries (such as Sri Lanka, Nepal, Bangladesh, Bhutan + many more) this parameter is mandatory. Possible values are listed in a table here.
IND{
"pts": "78.40573,17.37317;78.40958,17.37314;78.41845,17.37449;78.409992,17.37328;78.420460,17.377443;78.421350,17.380200"
}Build your request in eight languages
Change source-backed examples once, validate required inputs, and copy the synchronized cURL, JavaScript, Python, Java, C#, Go, PHP, or Ruby request. Credentials remain environment references, and this page never sends a provider request.
https://apis.mapmyindia.com/advancedmaps/v1/${MAPPLS_REST_KEY}/snapToRoadcurl --request POST \
--url "https://apis.mapmyindia.com/advancedmaps/v1/${MAPPLS_REST_KEY}/snapToRoad" \
--header "Accept: application/json" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-raw '{"pts":"78.40573,17.37317;78.40958,17.37314;78.41845,17.37449;78.409992,17.37328;78.420460,17.377443;78.421350,17.380200"}'Credential-safe by constructionSet MAPPLS_REST_KEY only in your trusted runtime. Code generation stays local. Sandbox execution sends only bounded fixture inputs to this developer platform and never reads a credential or calls Mappls.
Send a production-shaped request
Examples use environment-backed access tokens, explicit timeouts where supported, status checks, and JSON bodies derived from the source schema. Replace sample identifiers and coordinates with values from your application.
curl --request POST \
--url 'https://apis.mapmyindia.com/advancedmaps/v1/YOUR_REST_KEY/snapToRoad' \
--header 'Content-Type: application/json' \
--data '{
"pts": "78.40573,17.37317;78.40958,17.37314;78.41845,17.37449;78.409992,17.37328;78.420460,17.377443;78.421350,17.380200"
}'Responses
OK
DB Connection error.
Bad request
API access denied
Forbidden
Not found
Precondition Failed, i.e. Some existing pre-condition in formulating a valid API request was not fulfilled.
Something went wrong
Internal server error
200 response fields
ServerrequiredGives Information on active service's server.
Adv-5400versionrequiredAPI’s version information.
250.19.5222responseCoderequiredSee the service dependent and general status codes
200resultsrequiredNo field description in the source contract.
exampleresults.snappedPointsrequiredArray of Waypoint objects representing all points of the trace in order. If the trace point was omitted by map matching because it is an outlier, the entry will be null.
exampleresults.snappedPoints[].locationrequiredLocation of Matched point (Longitude, Latitude)
28.612964,77.229463results.snappedPoints[].distancerequiredDistance from the snapped point.
4.014843results.snappedPoints[].waypoint_indexrequiredDistance from the snapped point.
0results.matchingsrequiredAn array of Route objects that assemble the trace.
exampleresults.matchings[].geometryrequiredReturns the whole geometry of the route as per given parameter ‘geometries’ default is encoded ‘polyline’ with 5 digit accuracy for positional coordinates. Geometry information is NOT available in most use-case driven response; and is RESTRICTED.
28.612964,77.229463{
"Server": "Adv-5400",
"version": "250.19.5222",
"responseCode": "200",
"results": {
"snappedPoints": [
{
"location": [
77.113089,
28.544643
],
"distance": 4.014843,
"waypoint_index": 0
}
],
"matchings": [
{
"geometry": "ie`iByrp}MN{HKeMXmOKuGq@}JaBaHaDmIgB{BuDcCuGeBeP{D"
}
]
}
}Operate it safely
This operation is evaluated independently from the request. Cache and retry according to its documented semantics.
Contract provenance
- Source file
contenthub/dochub/mapmyindia-rest-api/docs/custom/snapToRoad.yml- SHA-256
f05e344331821678f3463524df1c2729cabd344a994dd0a3877987cc6eb7b0e1- Normalization
- Fields are parsed from OpenAPI. Operational guidance and language samples are generated and labeled separately.
- Source record
- Open repository audit