Home

Introduction

Distance & Time API

version 3

Distance & Time is web application, which allows to calculate distances and transit time between two points using different modes of transport.

OpenAPI Specification

Start designing your API in minutes. The OpenAPI specification file enables you to learn and interact with API elements, including all available endpoints, input and output representations.

General information

Distance & Time API is organized around REST.
Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

API endpoint#

1https://distanceandtime.searates.com

All endpoints are only accessible via HTTPS and are located at distanceandtime.searates.com

Distance and transit time calculator.

get/v3/api

Get the best route and estimated time delivery.

Headers

Content-Typeapplication/json

Query Parameters
  • api_keyREQUIREDstring

    Your api key. If you do not have an api key - contact us to purchase a subscription.

  • fromREQUIREDstring

    Route start location data - coordinates in format latitude,longitude or UN/LOCODE or country code (2 digit code). Also - addresses in any format, company names, city names, country names, landmark names and more. *Please note that we cannot guarantee an accurate location based on the description, and there may be several reasons for this.

    Examples:31.366365,121.61475CNSHGCNDE10115-BerlinDP World, UAEShanghaiUnited Arab EmiratesEiffel Tower, Paris

  • toREQUIREDstring

    Route end location data - coordinates in format latitude,longitude or UN/LOCODE or country code (2 digit code). Also - addresses in any format, company names, city names, country names, landmark names and more. *Please note that we cannot guarantee an accurate location based on the description, and there may be several reasons for this.

    Examples:33.76696,118.18923USLGBUSDE10115-BerlinDP World, UAEShanghaiUnited Arab EmiratesEiffel Tower, Paris

  • transport_modesOptionalstring

    Modes of transportation that are allowed to be used in route finding. Multiple modes of transportation can be specified separated by a comma.

    SEA - by sea

    ROAD - by road

    RAIL - by rail

    AIR - by air

    Examples:SEAAIR,ROAD

  • alternative_routesOptionalboolean

    Whether alternative routes should also be provided in the response.

    Examples:true

  • routing_modeOptionalstring

    This parameter specifies which mode should be used when calculating the route. By default it takes the value short - the shortest route from the point of departure to the point of arrival; it can also take the value safe - a route that is built taking into account the current geopolitical situation in the world.

    Allowed values:shortsafe

    Examples:short

Response example
1{
2  "success": true,
3  "status_code": "OK",
4  "metadata": {
5    "request_parameters": {
6      "from": "Madrid, Spain",
7      "to": "Ibiza, Spain",
8      "transport_modes": "ROAD",
9      "alternative_routes": false,
10      "routing_mode": "short"
11    }
12  },
13  "data": {
14    "route": {
15      "summary": {
16        "duration": 47730,
17        "distance": 530342,
18        "speed": 40
19      },
20      "from": {
21        "description": "Madrid, Comunidad de Madrid, Spain",
22        "name": "Madrid",
23        "state": "Comunidad de Madrid",
24        "country": "Spain",
25        "country_code": "ES",
26        "locode": "ESMAD",
27        "lat": 40.4165,
28        "lng": -3.70256
29      },
30      "to": {
31        "description": "Santa Eularia des Riu, Comunitat Autonoma de les Illes Balears, Spain",
32        "name": "Santa Eularia des Riu",
33        "state": "Comunitat Autonoma de les Illes Balears",
34        "country": "Spain",
35        "country_code": "ES",
36        "locode": "ESSTE",
37        "lat": 38.98457,
38        "lng": 1.53409
39      },
40      "sections": [
41        {
42          "summary": {
43            "duration": 47730,
44            "distance": 530342,
45            "speed": 40
46          },
47          "from": {
48            "description": "Madrid, Comunidad de Madrid, Spain",
49            "name": "Madrid",
50            "state": "Comunidad de Madrid",
51            "country": "Spain",
52            "country_code": "ES",
53            "locode": "ESMAD",
54            "lat": 40.4165,
55            "lng": -3.70256
56          },
57          "to": {
58            "description": "Santa Eularia des Riu, Comunitat Autonoma de les Illes Balears, Spain",
59            "name": "Santa Eularia des Riu",
60            "state": "Comunitat Autonoma de les Illes Balears",
61            "country": "Spain",
62            "country_code": "ES",
63            "locode": "ESSTE",
64            "lat": 38.98457,
65            "lng": 1.53409
66          },
67          "transport_mode": "ROAD",
68          "path": [
69            [
70              40.41674,
71              -3.70233
72            ],
73            [
74              39.7883199999995,
75              -2.42739000000004
76            ],
77            [
78              39.70590999999947,
79              -2.389710000000039
80            ],
81            [
82              39.63814999999948,
83              -2.329050000000039
84            ],
85            [
86              39.565569999999475,
87              -2.275720000000041
88            ],
89            [
90              39.50520999999937,
91              -2.2087400000000463
92            ],
93            [
94              39.452099999999305,
95              -0.5494100000000518
96            ],
97            [
98              39.390839999999294,
99              -0.4822100000000522
100            ],
101            [
102              39.32844999999926,
103              -0.41705000000005255
104            ],
105            [
106              39.23836999999929,
107              -0.4117400000000524
108            ],
109            [
110              39.16478999999931,
111              -0.35941000000005224
112            ],
113            [
114              39.117579999999286,
115              -0.28245000000005227
116            ],
117            [
118              39.04547999999924,
119              -0.2285600000000526
120            ],
121            [
122              38.96028999999921,
123              -0.1989300000000524
124            ],
125            [
126              38.90637999999916,
127              -0.12685000000005262
128            ],
129            [
130              38.87218999999912,
131              -0.04347000000005263
132            ],
133            [
134              38.81785999999918,
135              0.028399999999947367
136            ],
137            [
138              38.98453399999991,
139              1.5340080000000023
140            ]
141          ],
142          "ferry_paths": [
143            [
144              [
145                38.84428,
146                0.11434
147              ],
148              [
149                38.844179999999994,
150                0.11431999999999999
151              ],
152              [
153                38.84260999999999,
154                0.11442
155              ],
156              [
157                38.84188999999999,
158                0.11578999999999999
159              ],
160              [
161                38.84318999999999,
162                0.11973999999999999
163              ],
164              [
165                38.84456999999999,
166                0.12213999999999998
167              ],
168              [
169                38.88312999999999,
170                0.38972999999999997
171              ],
172              [
173                38.90101999999999,
174                0.51393
175              ],
176              [
177                38.907009999999985,
178                0.55898
179              ],
180              [
181                38.91525999999998,
182                0.62099
183              ],
184              [
185                38.921599999999984,
186                0.6686500000000001
187              ],
188              [
189                38.927539999999986,
190                0.7132700000000001
191              ],
192              [
193                38.93598999999999,
194                0.77539
195              ],
196              [
197                38.95538999999999,
198                0.9225300000000001
199              ],
200              [
201                38.95688999999999,
202                0.9339400000000001
203              ],
204              [
205                38.99626999999999,
206                1.2135600000000002
207              ],
208              [
209                38.978509999999986,
210                1.2889500000000003
211              ],
212              [
213                38.97520999999998,
214                1.2966200000000003
215              ],
216              [
217                38.975129999999986,
218                1.2975100000000004
219              ],
220              [
221                38.975749999999984,
222                1.2980300000000005
223              ],
224              [
225                38.97582999999998,
226                1.2980200000000004
227              ]
228            ]
229          ],
230          "stats": []
231        }
232      ]
233    },
234    "alternative_routes": []
235  }
236}