Home

Introduction

Distance & Time API

version 2

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://sirius.searates.com

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

Distance and transit time calculator

get/api/distanceandtime

Get the best route and estimated time delivery.

Headers

Content-Typeapplication/json

Query Parameters
  • keyREQUIREDstring

    API key

  • lat_fromREQUIREDnumber

    The latitude value specifying the location for which you wish to obtain the closest point of loading.

  • lng_fromREQUIREDnumber

    The longitude value specifying the location for which you wish to obtain the closest point of loading.

  • lat_toREQUIREDnumber

    The latitude value specifying the location for which you wish to obtain the closest point of discharge.

  • lng_toREQUIREDnumber

    The longitude value specifying the location for which you wish to obtain the closest point of discharge.

  • typeREQUIREDstring

    Type of transportation.

    Allowed values:seaairroadrail

  • speedOptionalnumber

    Speed for the selected type of transport. If speed is not set, it will be defaulted depending on the type (sea - 13 knots, air - 800 km/h, road - 35 km/h, rail - 35 km/h).

  • road_speedOptionalnumber

    Transport speed to ports. Used for types sea, air. By default 35 km/h.

    Default:35

Response example
OK
1{
2  "transit_time_chart": {
3    "pay": true
4  },
5  "road_from": {
6    "path": [
7      [
8        31.230343,
9        121.473732
10      ],
11      [
12        31.32358,
13        121.480942
14      ],
15      [
16        31.399626,
17        121.496124
18      ]
19    ],
20    "dist": 18.99948,
21    "distance": 18.99948,
22    "transit_time_seconds": 1955,
23    "transit_time_days": "0 days",
24    "name": "Shanghai, China",
25    "speed": "35 km/h",
26    "lat": 31.2303904,
27    "lng": 121.4737021
28  },
29  "sea": {
30    "path": [
31      [
32        31.4000905769357,
33        121.497112503479
34      ],
35      [
36        31.339943640395344,
37        122.87287477795712
38      ],
39      [
40        31.059257936540355,
41        129.29309872552187
42      ],
43      [
44        30.999111,
45        130.668861
46      ],
47      [
48        31.41003135136701,
49        147.33953344782196
50      ],
51      [
52        33.32765965774639,
53        -134.86399512900897
54      ],
55      [
56        33.7385800091134,
57        -118.193322681187
58      ]
59    ],
60    "dist": 11127.877585,
61    "distance": 11127.877585,
62    "transit_time_seconds": 1663913,
63    "transit_time_days": "19 days",
64    "from_name": "Shanghai",
65    "to_name": "Long Beach",
66    "speed": "13 knots",
67    "from_lat": 31.400090576935703,
68    "from_lng": 121.49711250347931,
69    "to_lat": 33.738580009113406,
70    "to_lng": -118.19332268118747
71  },
72  "road_to": {
73    "path": [
74      [
75        33.738785,
76        -118.192902
77      ],
78      [
79        33.77005,
80        -118.193649
81      ]
82    ],
83    "dist": 3.49939,
84    "distance": 3.49939,
85    "transit_time_seconds": 360,
86    "transit_time_days": "0 days",
87    "name": "Red Lion Inn, 249-299 Pacific Ave, Long Beach, CA 90802, USA",
88    "speed": "35 km/h",
89    "lat": 33.7700504,
90    "lng": -118.1937395
91  }
92}