TrueWay Routing API

Finding the optimal route between two or more locations

The routing service can be used to find the best route to get from one location to another or to visit several locations. The best route can be the fastest route for a given time of day considering the traffic conditions applicable during that time. If you have more than two stops to visit, the routing service can determine the best order in which to visit the locations (the traveling salesman problem).

Features and capabilities:

  • Global road network coverage.
  • Find the best route between two or more locations.
  • Optimize routes.
  • Use both historical traffic conditions and live traffic.
  • Can avoid toll roads, highways or ferries.
  • Return distance and duration information.
  • Return route geometry.
  • Return multi-part directions using a series of stops.
  • Return turn-by-turn information.

Finding optimal route to visit several locations (FindDrivingRoute)

Required parameters:

  • stops - Specify two or more semicolon-delimited locations(Lat/Lng) between which the route is to be found. Max: 25.

Optional parameters:

  • avoid_highways - The route should avoid highways.
  • avoid_tolls - The route should avoid toll roads.
  • avoid_ferries - The route should avoid ferries.
  • avoid_highways - The route should avoid highways.
  • geometry_format - The format of the returned route geometry: latlng or lnglat. Default: latlng
  • optimize - Instructs the API to reorder stops to find the optimized route. The route first stop and last stop order is not changed, their position is considered fixed.

Finding optimal route from a origin to a destination (FindDrivingPath)

Required parameters:

  • origin - The location from which you wish to calculate directions.
  • destination - The location to which you wish to calculate directions.

Optional parameters:

  • avoid_highways - The route should avoid highways.
  • avoid_tolls - The route should avoid toll roads.
  • avoid_ferries - The route should avoid ferries.
  • avoid_highways - The route should avoid highways.
  • geometry_format - The format of the returned route geometry: latlng or lnglat. Default: latlng
  • start_time - Time when travel is expected to start. This time is used to take into account traffic conditions. You can specify the time as an integer in seconds since midnight, January 1, 1970 UTC or you can use “now” to specify the current time.

The main difference between FindDrivingRoute and FindDrivingPath is that FindDrivingRoute is optimized for a route with multiple stops and can optimize the route (reorder stops) with parameter optimize=true. FindDrivingPath does not change the order of visiting points, but is optimized for a route between two points. Also FindDrivingPath can take traffic conditions into account.

Response

The service returns a optimal route with detailed information:

  • distance (length of route)
  • duration (time of route)
  • route geometry
  • bounds of route geometry
  • turn-by-turn directions

Route contains the following fields:

  • distance contains the length of route (meters).
  • duration contains the time of route (seconds).
  • geometry contains the geometry of route. By default, geometry contains a single coordinates object, which is a two-dimensional array of points (Latitude/Longitude).
  • bounds contains the bounds of geometry.
  • legs contains an array which contains information about a leg of the route, between two locations within the route. A route with no intermediate waypoints will contain exactly one leg within the legs array. Each leg consists of a series of steps.

Leg contains the following fields:

  • distance contains the length of leg (meters).
  • duration contains the time of leg (seconds).
  • start_point_index contains the index of point (within geometry.coordinates array) at which the leg starts.
  • start_point contains the coordinate of point (within geometry.coordinates array) at which the leg starts.
  • end_point_index contains the index of point (within geometry.coordinates array) at which the leg ends.
  • end_point contains the coordinate of point (within geometry.coordinates array) at which the leg ends.
  • bounds contains the bounds of leg geometry.
  • steps contains an array which contains information about a step of the leg.

Step contains the following fields:

  • distance contains the length of step (meters).
  • duration contains the time of step (seconds).
  • start_point_index contains the index of point (within geometry.coordinates array) at which the step starts.
  • start_point contains the coordinate of point (within geometry.coordinates array) at which the step starts.
  • end_point_index contains the index of point (within geometry.coordinates array) at which the step ends.
  • end_point contains the coordinate of point (within geometry.coordinates array) at which the step ends.
  • bounds contains the bounds of step geometry.
  • maneuver contains the action to take for the step (“turn left”, “turn right”, etc.).

Please note that for FindDrivingPath, the route does not contain the field legs but directly contains the field steps.

API Documentation

Endpoints


Finding the optimal route for visiting multiple locations



                                                                            
GET https://zylalabs.com/api/3932/trueway+routing+api/4659/finddrivingroute
                                                                            
                                                                        

FindDrivingRoute - Endpoint Features

Object Description
stops [Required] Specify two or more semicolon-delimited locations(Lat/Lng) between which the route is to be found. Max: 25. For Example: 40.629041,-74.025606;40.630099,-73.993521;40.644895,-74.013818;40.627177,-73.980853
optimize [Optional] true for reorder stops to find the optimized route. The route first stop and last stop order is not changed, their position is considered fixed.
avoid_ferries [Optional] true for avoid ferries. Default: false
avoid_highways [Optional] true for avoid highways. Default: false
avoid_tolls [Optional] true for avoid toll roads. Default: false
Test Endpoint

API EXAMPLE RESPONSE

       
                                                                                                        
                                                                                                                                                                                                                            {
  "route": {
    "distance": 10148,
    "duration": 2654,
    "bounds": {
      "south": 40.618996,
      "west": -74.025801,
      "north": 40.645331,
      "east": -73.98078
    },
    "geometry": {
      "coordinates": [
        [
          40.629103,
          -74.025801
        ],
        [
          40.629409,
          -74.025679
        ],
        [
          40.630117,
          -74.025375
        ],
        [
          40.630245,
          -74.025325
        ],
        [
          40.630726,
          -74.025122
        ],
        [
          40.630804,
          -74.025081
        ],
        [
          40.630814,
          -74.02499
        ],
        [
          40.630804,
          -74.024939
        ],
        [
          40.630794,
          -74.024899
        ],
        [
          40.630785,
          -74.024858
        ],
        [
          40.630726,
          -74.024726
        ],
        [
          40.630677,
          -74.024635
        ],
        [
          40.630667,
          -74.024625
        ],
        [
          40.630402,
          -74.024169
        ],
        [
          40.62996,
          -74.023422
        ],
        [
          40.629901,
          -74.023321
        ],
        [
          40.629773,
          -74.02312
        ],
        [
          40.629695,
          -74.02297
        ],
        [
          40.629478,
          -74.02264
        ],
        [
          40.628726,
          -74.021398
        ],
        [
          40.628057,
          -74.020293
        ],
        [
          40.627946,
          -74.020106
        ],
        [
          40.627876,
          -74.020007
        ],
        [
          40.627755,
          -74.01981
        ],
        [
          40.627624,
          -74.019592
        ],
        [
          40.627493,
          -74.019385
        ],
        [
          40.627432,
          -74.019286
        ],
        [
          40.627382,
          -74.019196
        ],
        [
          40.627271,
          -74.019018
        ],
        [
          40.627068,
          -74.01868
        ],
        [
          40.626977,
          -74.01851
        ],
        [
          40.626967,
          -74.0185
        ]
      ]
    },
    "legs": [
      {
        "distance": 3919,
        "duration": 816,
        "start_point_index": 0,
        "start_point": {
          "lat": 40.629103,
          "lng": -74.025801
        },
        "end_point_index": 120,
        "end_point": {
          "lat": 40.630157,
          "lng": -73.993608
        },
        "bounds": {
          "south": 40.618996,
          "west": -74.025801,
          "north": 40.630814,
          "east": -73.993608
        },
        "steps": [
          {
            "distance": 199,
            "duration": 40,
            "start_point_index": 0,
            "start_point": {
              "lat": 40.629103,
              "lng": -74.025801
            },
            "end_point_index": 5,
            "end_point": {
              "lat": 40.630804,
              "lng": -74.025081
            },
            "bounds": {
              "south": 40.629103,
              "west": -74.025801,
              "north": 40.630804,
              "east": -74.025081
            }
          },
          {
            "distance": 2137,
            "duration": 367,
            "start_point_index": 5,
            "start_point": {
              "lat": 40.630804,
              "lng": -74.025081
            },
            "end_point_index": 77,
            "end_point": {
              "lat": 40.618996,
              "lng": -74.005211
            },
            "bounds": {
              "south": 40.618996,
              "west": -74.025081,
              "north": 40.630814,
              "east": -74.005211
            },
            "maneuver": "turn right"
          },
          {
            "distance": 1583,
            "duration": 409,
            "start_point_index": 77,
            "start_point": {
              "lat": 40.618996,
              "lng": -74.005211
            },
            "end_point_index": 120,
            "end_point": {
              "lat": 40.630157,
              "lng": -73.993608
            },
            "bounds": {
              "south": 40.618996,
              "west": -74.005211,
              "north": 40.630157,
              "east": -73.993608
            },
            "maneuver": "turn left"
          }
        ]
      },
      {
        "distance": 2600,
        "duration": 747,
        "start_point_index": 120,
        "start_point": {
          "lat": 40.630157,
          "lng": -73.993608
        },
        "end_point_index": 155,
        "end_point": {
          "lat": 40.645027,
          "lng": -74.01398
        },
        "bounds": {
          "south": 40.630157,
          "west": -74.015422,
          "north": 40.645027,
          "east": -73.993411
        },
        "steps": [
          {
            "distance": 27,
            "duration": 6,
            "start_point_index": 120,
            "start_point": {
              "lat": 40.630157,
              "lng": -73.993608
            },
            "end_point_index": 121,
            "end_point": {
              "lat": 40.630343,
              "lng": -73.993411
            },
            "bounds": {
              "south": 40.630157,
              "west": -73.993608,
              "north": 40.630343,
              "east": -73.993411
            }
          },
          {
            "distance": 2376,
            "duration": 675,
            "start_point_index": 121,
            "start_point": {
              "lat": 40.630343,
              "lng": -73.993411
            },
            "end_point_index": 151,
            "end_point": {
              "lat": 40.643633,
              "lng": -74.015422
            },
            "bounds": {
              "south": 40.630343,
              "west": -74.015422,
              "north": 40.643633,
              "east": -73.993411
            },
            "maneuver": "turn left"
          },
          {
            "distance": 197,
            "duration": 66,
            "start_point_index": 151,
            "start_point": {
              "lat": 40.643633,
              "lng": -74.015422
            },
            "end_point_index": 155,
            "end_point": {
              "lat": 40.645027,
              "lng": -74.01398
            },
            "bounds": {
              "south": 40.643633,
              "west": -74.015422,
              "north": 40.645027,
              "east": -74.01398
            },
            "maneuver": "turn right"
          }
        ]
      },
      {
        "distance": 3629,
        "duration": 1091,
        "start_point_index": 155,
        "start_point": {
          "lat": 40.645027,
          "lng": -74.01398
        },
        "end_point_index": 210,
        "end_point": {
          "lat": 40.627281,
          "lng": -73.98078
        },
        "bounds": {
          "south": 40.627281,
          "west": -74.01398,
          "north": 40.645331,
          "east": -73.98078
        },
        "steps": [
          {
            "distance": 43,
            "duration": 9,
            "start_point_index": 155,
            "start_point": {
              "lat": 40.645027,
              "lng": -74.01398
            },
            "end_point_index": 156,
            "end_point": {
              "lat": 40.645331,
              "lng": -74.01366
            },
            "bounds": {
              "south": 40.645027,
              "west": -74.01398,
              "north": 40.645331,
              "east": -74.01366
            }
          },
          {
            "distance": 3117,
            "duration": 933,
            "start_point_index": 156,
            "start_point": {
              "lat": 40.645331,
              "lng": -74.01366
            },
            "end_point_index": 202,
            "end_point": {
              "lat": 40.627896,
              "lng": -73.984796
            },
            "bounds": {
              "south": 40.627896,
              "west": -74.01366,
              "north": 40.645331,
              "east": -73.984796
            },
            "maneuver": "turn right"
          },
          {
            "distance": 158,
            "duration": 58,
            "start_point_index": 202,
            "start_point": {
              "lat": 40.627896,
              "lng": -73.984796
            },
            "end_point_index": 204,
            "end_point": {
              "lat": 40.629023,
              "lng": -73.983661
            },
            "bounds": {
              "south": 40.627896,
              "west": -73.984796,
              "north": 40.629023,
              "east": -73.983661
            },
            "maneuver": "turn left"
          },
          {
            "distance": 311,
            "duration": 91,
            "start_point_index": 204,
            "start_point": {
              "lat": 40.629023,
              "lng": -73.983661
            },
            "end_point_index": 210,
            "end_point": {
              "lat": 40.627281,
              "lng": -73.98078
            },
            "bounds": {
              "south": 40.627281,
              "west": -73.983661,
              "north": 40.629023,
              "east": -73.98078
            },
            "maneuver": "turn right"
          }
        ]
      }
    ]
  }
}
                                                                                                                                                                                                                    
                                                                                                    

FindDrivingRoute - CODE SNIPPETS


curl --location --request GET 'https://zylalabs.com/api/3932/trueway+routing+api/4659/finddrivingroute?stops=40.629041,-74.025606;40.630099,-73.993521;40.644895,-74.013818;40.627177,-73.980853' --header 'Authorization: Bearer YOUR_API_KEY' 


    

Finding the best route between an origin and a destination



                                                                            
GET https://zylalabs.com/api/3932/trueway+routing+api/4660/finddrivingpath
                                                                            
                                                                        

FindDrivingPath - Endpoint Features

Object Description
origin [Required] The location from which you wish to calculate directions. For Example: 40.629041,-74.025606
destination [Required] The location to which you wish to calculate directions. For Example: 40.627177,-73.980853
start_time [Optional] Time when travel is expected to start. You can specify the time as an integer in seconds since midnight, January 1, 1970 UTC or you can use "now" to specify the current time.
avoid_ferries [Optional] true for avoid ferries. Default: false
avoid_highways [Optional] true for avoid highways. Default: false
avoid_tolls [Optional] true for avoid toll roads. Default: false
Test Endpoint

API EXAMPLE RESPONSE

       
                                                                                                        
                                                                                                                                                                                                                            {
  "route": {
    "distance": 5395,
    "duration": 1094,
    "bounds": {
      "south": 40.620537,
      "west": -74.025801,
      "north": 40.630814,
      "east": -73.98078
    },
    "geometry": {
      "coordinates": [
        [
          40.629103,
          -74.025801
        ],
        [
          40.629409,
          -74.025679
        ],
        [
          40.630117,
          -74.025375
        ],
        [
          40.630245,
          -74.025325
        ],
        [
          40.630726,
          -74.025122
        ],
        [
          40.630804,
          -74.025081
        ],
        [
          40.630814,
          -74.02499
        ],
        [
          40.630804,
          -74.024939
        ],
        [
          40.630794,
          -74.024899
        ],
        [
          40.630785,
          -74.024858
        ],
        [
          40.630726,
          -74.024726
        ],
        [
          40.630677,
          -74.024635
        ],
        [
          40.630667,
          -74.024625
        ],
        [
          40.630402,
          -74.024169
        ],
        [
          40.62996,
          -74.023422
        ],
        [
          40.629901,
          -74.023321
        ],
        [
          40.629773,
          -74.02312
        ],
        [
          40.629695,
          -74.02297
        ],
        [
          40.629478,
          -74.02264
        ],
        [
          40.628726,
          -74.021398
        ],
        [
          40.628057,
          -74.020293
        ],
        [
          40.627946,
          -74.020106
        ],
        [
          40.627876,
          -74.020007
        ],
        [
          40.627755,
          -74.01981
        ],
        [
          40.627624,
          -74.019592
        ],
        [
          40.627493,
          -74.019385
        ],
        [
          40.627432,
          -74.019286
        ],
        [
          40.627382,
          -74.019196
        ],
        [
          40.627271,
          -74.019018
        ],
        [
          40.627068,
          -74.01868
        ],
        [
          40.626977,
          -74.01851
        ]

      ]
    },
    "steps": [
      {
        "distance": 199,
        "duration": 40,
        "start_point_index": 0,
        "start_point": {
          "lat": 40.629103,
          "lng": -74.025801
        },
        "end_point_index": 5,
        "end_point": {
          "lat": 40.630804,
          "lng": -74.025081
        },
        "bounds": {
          "south": 40.629103,
          "west": -74.025801,
          "north": 40.630804,
          "east": -74.025081
        }
      },
      {
        "distance": 1661,
        "duration": 285,
        "start_point_index": 5,
        "start_point": {
          "lat": 40.630804,
          "lng": -74.025081
        },
        "end_point_index": 68,
        "end_point": {
          "lat": 40.621637,
          "lng": -74.00964
        },
        "bounds": {
          "south": 40.621637,
          "west": -74.025081,
          "north": 40.630814,
          "east": -74.00964
        },
        "maneuver": "turn right"
      },
      {
        "distance": 808,
        "duration": 173,
        "start_point_index": 68,
        "start_point": {
          "lat": 40.621637,
          "lng": -74.00964
        },
        "end_point_index": 85,
        "end_point": {
          "lat": 40.627331,
          "lng": -74.003705
        },
        "bounds": {
          "south": 40.621637,
          "west": -74.00964,
          "north": 40.627331,
          "east": -74.003705
        },
        "maneuver": "turn left"
      },
      {
        "distance": 1213,
        "duration": 211,
        "start_point_index": 85,
        "start_point": {
          "lat": 40.627331,
          "lng": -74.003705
        },
        "end_point_index": 107,
        "end_point": {
          "lat": 40.620537,
          "lng": -73.992483
        },
        "bounds": {
          "south": 40.620537,
          "west": -74.003705,
          "north": 40.627331,
          "east": -73.992483
        },
        "maneuver": "turn right"
      },
      {
        "distance": 1203,
        "duration": 294,
        "start_point_index": 107,
        "start_point": {
          "lat": 40.620537,
          "lng": -73.992483
        },
        "end_point_index": 132,
        "end_point": {
          "lat": 40.629023,
          "lng": -73.983661
        },
        "bounds": {
          "south": 40.620537,
          "west": -73.992483,
          "north": 40.629023,
          "east": -73.983661
        },
        "maneuver": "turn left"
      },
      {
        "distance": 311,
        "duration": 91,
        "start_point_index": 132,
        "start_point": {
          "lat": 40.629023,
          "lng": -73.983661
        },
        "end_point_index": 138,
        "end_point": {
          "lat": 40.627281,
          "lng": -73.98078
        },
        "bounds": {
          "south": 40.627281,
          "west": -73.983661,
          "north": 40.629023,
          "east": -73.98078
        },
        "maneuver": "turn right"
      }
    ]
  }
}
                                                                                                                                                                                                                    
                                                                                                    

FindDrivingPath - CODE SNIPPETS


curl --location --request GET 'https://zylalabs.com/api/3932/trueway+routing+api/4660/finddrivingpath?origin=40.629041,-74.025606&destination=40.627177,-73.980853' --header 'Authorization: Bearer YOUR_API_KEY' 


    

API Access Key & Authentication

After signing up, every developer is assigned a personal API access key, a unique combination of letters and digits provided to access to our API endpoint. To authenticate with the TrueWay Routing API REST API, simply include your bearer token in the Authorization header.
Headers
Header Description
Authorization [Required] Should be Bearer access_key. See "Your API Access Key" above when you are subscribed.

Simple Transparent Pricing

No long term commitments. One click upgrade/downgrade or cancellation. No questions asked.

πŸš€ Enterprise

Starts at
$ 10,000/Year


  • Custom Volume
  • Specialized Customer Support
  • Real-Time API Monitoring

Customer favorite features

  • βœ”οΈŽ Only Pay for Successful Requests
  • βœ”οΈŽ Free 7-Day Trial
  • βœ”οΈŽ Multi-Language Support
  • βœ”οΈŽ One API Key, All APIs.
  • βœ”οΈŽ Intuitive Dashboard
  • βœ”οΈŽ Comprehensive Error Handling
  • βœ”οΈŽ Developer-Friendly Docs
  • βœ”οΈŽ Postman Integration
  • βœ”οΈŽ Secure HTTPS Connections
  • βœ”οΈŽ Reliable Uptime

Zyla API Hub is, in other words, an API MarketPlace. An all-in-one solution for your developing needs. You will be accessing our extended list of APIs with only your user. Also, you won't need to worry about storing API keys, only one API key for all our products is needed.

Prices are listed in USD. We accept all major debit and credit cards. Our payment system uses the latest security technology and is powered by Stripe, one of the world’s most reliable payment companies. If you have any trouble with paying by card, just contact us at [email protected]

Sometimes depending on the bank's fraud protection settings, a bank will decline the validation charge we make when we attempt to be sure a card is valid. We recommend first contacting your bank to see if they are blocking our charges. If more help is needed, please contact [email protected] and our team will investigate further

Prices are based on a recurring monthly subscription depending on the plan selected β€” plus overage fees applied when a developer exceeds a plan’s quota limits. In this example, you'll see the base plan amount as well as a quota limit of API requests. Be sure to notice the overage fee because you will be charged for each additional request.

Zyla API Hub works on a recurring monthly subscription system. Your billing cycle will start the day you purchase one of the paid plans, and it will renew the same day of the next month. So be aware to cancel your subscription beforehand if you want to avoid future charges.

Just go to the pricing page of that API and select the plan that you want to upgrade to. You will only be charged the full amount of that plan, but you will be enjoying the features that the plan offers right away.

Yes, absolutely. If you want to cancel your plan, simply go to your account and cancel on the Billing page. Upgrades, downgrades, and cancellations are immediate.

You can contact us through our chat channel to receive immediate assistance. We are always online from 9 am to 6 pm (GMT+1). If you reach us after that time, we will be in contact when we are back. Also you can contact us via email to [email protected]

Zyla API Hub is like a big store for APIs, where you can find thousands of them all in one place. We also offer dedicated support and real-time monitoring of all APIs. Once you sign up, you can pick and choose which APIs you want to use. Just remember, each API needs its own subscription. But if you subscribe to multiple ones, you'll use the same key for all of them, making things easier for you.

Prices are listed in USD (United States Dollar), EUR (Euro), CAD (Canadian Dollar), AUD (Australian Dollar), and GBP (British Pound). We accept all major debit and credit cards. Our payment system uses the latest security technology and is powered by Stripe, one of the world’s most reliable payment companies. If you have any trouble paying by card, just contact us at [email protected]

Additionally, if you already have an active subscription in any of these currencies (USD, EUR, CAD, AUD, GBP), that currency will remain for subsequent subscriptions. You can change the currency at any time as long as you don't have any active subscriptions.

The local currency shown on the pricing page is based on the country of your IP address and is provided for reference only. The actual prices are in USD (United States Dollar). When you make a payment, the charge will appear on your card statement in USD, even if you see the equivalent amount in your local currency on our website. This means you cannot pay directly with your local currency.

Occasionally, a bank may decline the charge due to its fraud protection settings. We suggest reaching out to your bank initially to check if they are blocking our charges. Also, you can access the Billing Portal and change the card associated to make the payment. If these does not work and you need further assistance, please contact our team at [email protected]

Prices are determined by a recurring monthly or yearly subscription, depending on the chosen plan.

API calls are deducted from your plan based on successful requests. Each plan comes with a specific number of calls that you can make per month. Only successful calls, indicated by a Status 200 response, will be counted against your total. This ensures that failed or incomplete requests do not impact your monthly quota.

Zyla API Hub works on a recurring monthly subscription system. Your billing cycle will start the day you purchase one of the paid plans, and it will renew the same day of the next month. So be aware to cancel your subscription beforehand if you want to avoid future charges.

To upgrade your current subscription plan, simply go to the pricing page of the API and select the plan you want to upgrade to. The upgrade will be instant, allowing you to immediately enjoy the features of the new plan. Please note that any remaining calls from your previous plan will not be carried over to the new plan, so be aware of this when upgrading. You will be charged the full amount of the new plan.

To check how many API calls you have left for the current month, look at the β€˜X-Zyla-API-Calls-Monthly-Remaining’ header. For example, if your plan allows 1000 requests per month and you've used 100, this header will show 900.

To see the maximum number of API requests your plan allows, check the β€˜X-Zyla-RateLimit-Limit’ header. For instance, if your plan includes 1000 requests per month, this header will display 1000.

The β€˜X-Zyla-RateLimit-Reset’ header shows the number of seconds until your rate limit resets. This tells you when your request count will start fresh. For example, if it displays 3600, it means 3600 seconds are left until the limit resets.

Yes, you can cancel your plan anytime by going to your account and selecting the cancellation option on the Billing page. Please note that upgrades, downgrades, and cancellations take effect immediately. Additionally, upon cancellation, you will no longer have access to the service, even if you have remaining calls left in your quota.

You can contact us through our chat channel to receive immediate assistance. We are always online from 8 am to 5 pm (EST). If you reach us after that time, we will get back to you as soon as possible. Additionally, you can contact us via email at [email protected]

 Service Level
100%
 Response Time
376ms

Category:


Related APIs