Location:

Bus Routing

Service Introduction

Plan a qualified bus interchange route plan based on the start and end coordinates.

Interface address

https://lbs.navinfo.com/open-api/gtp/v1/bus

Request method

GET

Request parameters

The bus calculations are described in the table below:

ParameterTypeMeaningRequiredDefaultRemarks

ak

string

Developer Key

Yes

If there is no key, please apply

guid

string

device id

No

orig

string

starting latitude and longitude

Yes

Example: 116.30815, 40.056878

dest

string

End point latitude and longitude

Yes

Example: 116.30815, 40.056878

city

string

city name

Yes

inGb

string

original coordinate system

No

g02

Default g02
g02: National Survey Bureau (gcj02) coordinates
g84: coordinates acquired by the GPS device
gbd: Baidu coordinates

outGb

string

target coordinate system

No

g02

Default g02
g02: National Bureau of Surveying (gcj02) Coordinates
gbd: Baidu Coordinates

policy

int

Public Exchange Strategy

No

1

Default: 1
1: fastest arrival
2: least transfer
3: least walk
4: only take bus
5: only take the subway

stime

string

Departure Time

No

Current time

Time format: HH:mm (24-hour clock) , for example: 12:00

Response data

Return ValueTypeMeaningRemarks

status

int

Return status

See status code table for details

msg

string

Back to status description

See status code table for details

data

object

return results

orig

string

starting point coordinates

dest

string

Endpoint coordinates

total

int

scheme Number

routes

array

Communication Scheme Set

rid

string

The first public transfer scheme

wdis

int

Total walking distance

Unit: m

detail

string

Overall description

dis

int

distance

unit: m

dur

int

Expected line time

Unit: second

transfer

int

The number of line transfers

total

int

The total number of stations in the line

steps

array

This route is segmented

sid

string

Several subsections

dis

int

The distance of this section

Unit: m

dur

int

This time interval

unit: second

lonlats

string

This road segment coordinate point string

Format is a coordinate string, such as:
116.481247,39.990704;116.481270,39.990726

type

string

Traffic Mode

Current support: walking, bus, subway

detail

object

Specific field information for transportation methods

Walk: detail field format when type=1 (walking)

Return ValueTypeMeaningRemarks

rinfo

string

Walk Description

Example: Go west along the North Fourth Ring Road East Road; reach the destination

dir

string

Walking Direction

Example: West

Broadway or subway: detail field format when type=2 or 3 (bus or subway)

Return ValueTypeMeaningRemarks

nm

string

route name

Example: Go west along the North Fourth Ring Road East Road; reach the destination

sstation

string

Name of the station on the route

Example: Life Science Park Station Entry: B3

estation

string

Name of the station under the route

Example: Exit of North Shaotong Station:

wtime

int

waiting time

isnight

string

whether It is a night shift

isdri

string

is running

dtime

int

The first and last time of the line

mline

string

Merge line names

separation separated

stations

int

Number of sites on this line

Snames

string

The name of the site passed

Service example

Parameter Value Type Meaning Required Remarks

ak

your ak

string

developer key

Yes

Click to apply

guid

string

device id

No

orig

string

Starting latitude and longitude

Yes

Example: 116.30815, 40.056878

dest

string

end point latitude and longitude

Yes

Example: 116.30815,40.126878

city

string

City Name

Yes

policy

int

Public Exchange Strategy

No

Default: 1
1: Fastest arrival
2: Minimum transfer
3: Minimum walking
4: only take the bus
5: only take the subway

stime

string

departure time

No

Time format: HH:mm (24-hour clock), Example: 12:00

Run

TOP