API reference/Core Maps, Search & Routing
GETstatelesslegacy-source evidence

Distance Matrix API

/{rest-key}/{resources}/{profile}/{geopositions}

This REST API computes the distance and durations in a matrix of routes between a set of source/primary positions (geographical coordinates) and a set of all supplied secondary positions. Please note that maximum number of points are limited to 100 only including source and secondary positions. Live Demo | Download Sample Code

Legacy contract evidence

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

GEThttps://apis.mapmyindia.com/advancedmaps/v1/YOUR_REST_KEY/distance_matrix_eta/driving/28.612964%2C77.229463
Base URLhttps://apis.mapmyindia.com/advancedmaps/v1
Authenticationnot declared
Journey rolerequest response
Content typesNo request body

Parameters

NameLocationTypeDescriptionExample
rest-keyrequired
pathstring

The REST API licence key allocated to you by signing into our services and registering yourself as a developer.

YOUR_REST_KEY
resourcesrequired
pathstring

The different resources available within MapmyIndia Distance Matrix API. These resources have their own individual allocations and not all are allocated for evalulations be default. For allocating particular resource on your API credentials, please contact apisupport@mapmyindia.com Table 1. Resources Element Value Description Resources distancematrix to calculate a route & its duration without considering traffic conditions. distancematrixeta to get the updated duration of a route considering live traffic; Applicable for India only “region=ind” and “rtype=1” is not supported. This is different from distancematrixtraffic ; this resource balances between a preferred path and aggressive trafficAllowed: distance_matrix · distance_matrix_eta · distance_matrix_traffic

distance_matrix_eta
profilerequired
pathstring

The different profiles available within MapmyIndia Distance Matrix API. These profiles have their own individual transport modes and not all are allocated for evalulations be default. For allocating particular profiles on your API credentials, please contact apisupport@mapmyindia.com Table 2. Profiles Element Value Description Profiles driving Meant for 4-wheeler/passenger car routing. biking Meant for two-wheeler routing. Routing with this profile is restricted to distancematrix only. region & rtype request parameters are not supported in two-wheeler routing. walking Meant for pedestrian routing. Routing with this profile is restricted to distancematrix only. region & rtype request parameteAllowed: driving · biking · walking · trucking

driving
geopositionsrequired
pathstring

geopositions(part of URL) are either: pair of comma separated longitude & latitude values OR eLoc(s). First geoposition will be considered as origin point (mandatory); and rest of the geopositions will be considered as destination points (mandatory). Example: 77.983936,28.255904;77.05993,28.487555 OR mmi000 . Geoposition separator is a semicolon ; .

28.612964,77.229463
sources
querystring

To specify which of the coordinates supplied in the URL are to be treated as source position for many to many distance matrix calculation, indicate that coordinate pair's index. E.g. 0;1 means that 0th and 1st coordinate pairs are source points. Default value is 0 . The indexes must be semi-colon separated. e.g: 0;1;2;...

0;1;2
rtype
queryinteger

type of route (integer) required for navigation, where values mean: 0 optimal (default) 1 shortest (it will calculate route by excluding access penalties like private roads, etc.)Allowed: 0 · 1

0
destinations
querystring

To specify which of the coordinates supplied in the URL are to be treated as destination position for many to many distance matrix calculation, indicate that coordinate pair's index. E.g. 2;3 means that 0th and 1st coordinate pairs are destination points. Default value is all . The indexes must be semi-colon separated. e.g: 3;4;5;...

3;4;5
region
querystring

This 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

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.

Local request composerCode stays local · fixtures are explicit
GETRequest inputs
7 editable · 1 protected
Generated in eight languages
Environment-backed credentials
GEThttps://apis.mapmyindia.com/advancedmaps/v1/${MAPPLS_REST_KEY}/distance_matrix_eta/driving/28.612964%2C77.229463?sources=0%3B1%3B2&rtype=0&destinations=3%3B4%3B5&region=IND
Credential-free sandboxExecute this contract without a provider call
How fixtures work
Generated from your inputs
curl --request GET \
  --url "https://apis.mapmyindia.com/advancedmaps/v1/${MAPPLS_REST_KEY}/distance_matrix_eta/driving/28.612964%2C77.229463?sources=0%3B1%3B2&rtype=0&destinations=3%3B4%3B5&region=IND" \
  --header "Accept: application/json"

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.

GET /{rest-key}/{resources}/{profile}/{geopositions}
curl --request GET \
  --url 'https://apis.mapmyindia.com/advancedmaps/v1/YOUR_REST_KEY/distance_matrix_eta/driving/28.612964%2C77.229463'

Responses

200

OK

204

DB Connection error.

400

Bad request

401

API access denied

403

Forbidden

404

Not found

412

Precondition Failed, i.e. Some existing pre-condition in formulating a valid API request was not fulfilled.

500

Something went wrong

503

Internal server error

200 response fields

FieldTypeDescriptionExample
Serverrequired
string

Gives Information on active service's server.

ETA-5100
versionrequired
string

API’s version information.

250.19.5222
responseCoderequired
integer

See the service dependent and general status codes

200
resultsrequired
object

No field description in the source contract.

example
results.coderequired
string

if request is successful, response is ‘ok’. Else, see the service dependent and general status codes as available in the enum. In case of error, “NoRoute” code is supported (in addition to the general ones) which means “no route found”. Ok : Request could be processed as expected. InvalidUrl : URL string is invalid. InvalidService: Service name is invalid. InvalidVersion : Version is not found. InvalidOptions : Options are invalid. InvalidQuery : The query string is synctactically malformed. Inv

Ok
results.distancesrequired
array<unknown>

array of float distances in metres.

example
results.durationsrequired
array<unknown>

array of float durations in seconds.

example
Response example
{
  "Server": "ETA-5100",
  "version": "250.19.5222",
  "responseCode": 200,
  "results": {
    "code": "Ok",
    "distances": [
      [
        14076.1,
        30927.6
      ]
    ],
    "durations": [
      [
        1884.9,
        2644.1
      ]
    ]
  }
}

Operate it safely

request-response

This operation is evaluated independently from the request. Cache and retry according to its documented semantics.

Keep credentials and raw tokens out of source, client bundles, prompts, and logs.Record the operation ID, status, latency, retry count, and source contract version in traces.Classify 4xx responses before retrying; back off and add jitter for retryable 5xx or transport failures.Cache only when request inputs, authorization scope, and freshness requirements permit it.

Contract provenance

Source file
contenthub/dochub/mapmyindia-rest-api/docs/custom/distanceMatrix.yml
SHA-256
bc3f5585c2351e756400d1280beeb69393a98e5b607c26cde62248e2deb6743d
Normalization
Fields are parsed from OpenAPI. Operational guidance and language samples are generated and labeled separately.