Transit Route

GET
https://api.woosmap.com/transit/route

Rate limit: 10/1s

Ratelimit: 10/1s

Authorization

key
apiKey query

Public key of the project usually starts with woos-

private_key
apiKey query

Private key with or without write permission.

X-Api-Key
apiKey header

Private key with or without write permission.

Query Parameters

DateTime with or without timezone, if not set the default datetime is the current one

Example: 2024-01-01T12:00:00%2B01:00

DateTime with or without timezone, if departure_time is defined this parameter is ignored

Example: 2024-01-01T14:00:00%2B01:00
origin
string required

WGS84 coordinates as format lat,lng

Example: lat,lng
destination
string required

WGS84 coordinates as format lat,lng

Example: lat,lng
modes
string

Transit mode filter used to determine which modes of transit to include in the response. By default, all supported transit modes are permitted. Supported modes: highSpeedTrain intercityTrain interRegionalTrain regionalTrain cityTrain bus ferry subway lightRail privateBus inclined aerial busRapid monorail flight spaceship This parameter also support an exclusion list: It's sufficient to specify each mode to exclude by prefixing it with -.
Mixing of inclusive and exclusive transit modes is not allowed.

Example: subway,bus

Response

200 application/json

Successful Response

status
string required
routes
object[]
Show 3 propertiesHide 3 properties
routes. notice
string Defaults to ""
routes. duration
integer required
routes. legs
object[]
Show 8 propertiesHide 8 properties
routes.legs. travel_mode
string required
routes.legs. duration
integer required
routes.legs. distance
number required
routes.legs. polyline
string required
routes.legs. start_location
object required
Show 3 propertiesHide 3 properties
routes.legs.start_location. name
string
routes.legs.start_location. type
string required
routes.legs.start_location. location
object required
Show 2 propertiesHide 2 properties
routes.legs.start_location.location. lat
number | string required
routes.legs.start_location.location. lng
number | string required
routes.legs. end_location
object required
Show 3 propertiesHide 3 properties
routes.legs.end_location. name
string
routes.legs.end_location. type
string required
routes.legs.end_location. location
object required
Show 2 propertiesHide 2 properties
routes.legs.end_location.location. lat
number | string required
routes.legs.end_location.location. lng
number | string required
routes.legs. transport
TransitTransport
routes.legs. attributions
array

Errors

401

Unable to locate credentials.

application/json
detail
string required
402

Out of free quota.

application/json
detail
string required
403

Credentials found, but not matching.

application/json
detail
string required
422

Validation Error

application/json
detail
object[]
Show 3 propertiesHide 3 properties
detail. loc
any[] required
detail. msg
string required
detail. type
string required
429

Rate limit reached

application/json
details
string required
        curl -L -X GET 'https://api.woosmap.com/transit/route?origin=48.73534,2.368308&destination=48.83534,2.368308&key=YOUR_PUBLIC_API_KEY' \
-H 'Referer: http://localhost'

    
        import requests

url = "https://api.woosmap.com/transit/route?origin=48.73534,2.368308&destination=48.83534,2.368308&key=YOUR_PUBLIC_API_KEY"

payload={}
headers = {
    'Referer': 'http://localhost'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)


    
        var requestOptions = {
  method: 'GET',
  redirect: 'follow'
};

fetch("https://api.woosmap.com/transit/route?origin=48.73534,2.368308&destination=48.83534,2.368308&key=YOUR_PUBLIC_API_KEY", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

    
Was this helpful?