β πΊοΈ Trueway Routing API
Finding the optimal route between two or more locations.
Trueway Routing API: Your Affordable Navigation Solution
Welcome to Trueway Routing API, the cost-effective alternative to the Google Maps API. Designed to deliver the most efficient routes, our API ensures you get from point A to point B quickly, while avoiding obstacles like traffic, tolls, and highways. Whether you're a developer creating the next big app or a business optimizing logistics, Trueway Routing API is your go-to solution for seamless navigation.
Developer Portal : https://api.market/store/trueway/routing
Why Choose Trueway Routing API?
Global Coverage: Access a vast network of roads across the globe, ensuring reliable routing anywhere in the world.
Optimal Routing: Determine the best route for multiple stops, solving complex logistics challenges like the traveling salesman problem.
Traffic-Aware Navigation: Utilize both historical and live traffic data to find the fastest route for any time of day.
Customizable Routes: Easily avoid toll roads, highways, or ferries with simple parameters.
Detailed Route Information: Receive comprehensive details, including distance, duration, route geometry, and turn-by-turn directions.
Affordable Pricing: Enjoy all these features at a fraction of the cost of the Google Maps API.
Powerful Features to Enhance Your Application
FindDrivingRoute:
Calculate the best route for multiple locations with up to 25 stops.
Optimize the order of stops for efficiency.
Avoid specific road types with customizable parameters.
Use historical and live traffic data for accurate travel times.
FindDrivingPath:
Ideal for routes between two points with optional intermediate stops.
Avoid highways, tolls, and ferries.
Traffic-aware routing for precise travel estimates.
API Parameters
Required:
stops: Specify two or more semicolon-delimited locations (Lat/Lng).
origin & destination: Define the starting and ending points for your route.
Optional:
avoid_highways, avoid_tolls, avoid_ferries: Customize your route preferences.
geometry_format: Choose your preferred route geometry format: latlng, lnglat, or geojson.
optimize: Optimize the order of stops for efficiency.
waypoints: Add intermediate locations for detailed routing.
start_time: Account for traffic conditions based on travel start time.
Comprehensive Response Data
Receive a detailed route response with the following fields:
Distance: Total length of the route.
Duration: Estimated travel time.
Geometry: Precise route geometry in your chosen format.
Bounds: Geographic bounds of the route.
Legs & Steps: Breakdown of the route into manageable segments with specific instructions and maneuvers.
Real-World Examples
FindDrivingRoute Request:
curl -X 'GET' \
'https://api.magicapi.dev/api/v1/trueway/routing/DirectionsService/FindDrivingRoute?stops=40.629041%2C-74.025606%3B40.630099%2C-73.993521%3B40.644895%2C-74.013818%3B40.627177%2C-73.980853&avoid_tolls=false&avoid_highways=false&avoid_ferries=false&optimize=false' \
-H 'accept: application/json' \
-H 'x-magicapi-key: API_KEY'
const fetch = require('node-fetch');
let url = 'https://api.magicapi.dev/api/v1/trueway/routing/DirectionsService/FindDrivingRoute?stops=40.629041%2C-74.025606%3B40.630099%2C-73.993521%3B40.644895%2C-74.013818%3B40.627177%2C-73.980853&avoid_tolls=SOME_BOOLEAN_VALUE&avoid_highways=SOME_BOOLEAN_VALUE&avoid_ferries=SOME_BOOLEAN_VALUE&optimize=SOME_BOOLEAN_VALUE';
let options = {method: 'GET', headers: {'x-magicapi-key': 'SOME_STRING_VALUE'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
import http.client
conn = http.client.HTTPSConnection("api.magicapi.dev")
headers = { 'x-magicapi-key': "SOME_STRING_VALUE" }
conn.request("GET", "/api/v1/trueway/routing/DirectionsService/FindDrivingRoute?stops=40.629041%2C-74.025606%3B40.630099%2C-73.993521%3B40.644895%2C-74.013818%3B40.627177%2C-73.980853&avoid_tolls=SOME_BOOLEAN_VALUE&avoid_highways=SOME_BOOLEAN_VALUE&avoid_ferries=SOME_BOOLEAN_VALUE&optimize=SOME_BOOLEAN_VALUE", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.magicapi.dev/api/v1/trueway/routing/DirectionsService/FindDrivingRoute?stops=40.629041%2C-74.025606%3B40.630099%2C-73.993521%3B40.644895%2C-74.013818%3B40.627177%2C-73.980853&avoid_tolls=SOME_BOOLEAN_VALUE&avoid_highways=SOME_BOOLEAN_VALUE&avoid_ferries=SOME_BOOLEAN_VALUE&optimize=SOME_BOOLEAN_VALUE")
.get()
.addHeader("x-magicapi-key", "SOME_STRING_VALUE")
.build();
Response response = client.newCall(request).execute();
FindDrivingRoute Response:
{
"route": {
"distance": 10178,
"duration": 2579,
"bounds": {
"south": 40.618996,
"west": -74.025801,
"north": 40.645342,
"east": -73.98077
},
"geometry": {
"coordinates": [
[
40.629103,
-74.025801
],
[
40.629409,
-74.025679
],
[
40.629389,
-74.025588
],
[
40.629379,
-74.025558
],
[
40.629369,
-74.025548
],
[
40.629369,
-74.025537
],
[
40.628994,
-74.024899
],
[
40.628247,
-74.023633
],
[
40.628177,
-74.023523
],
[
40.628137,
-74.023452
],
[
40.628097,
-74.023402
],
[
40.628057,
-74.023341
],
[
40.628007,
-74.023241
],
[
40.627916,
-74.0231
],
[
40.627443,
-74.02231
],
[
40.626753,
-74.0212
],
[
40.626662,
-74.021042
],
[
40.62656,
-74.020904
],
[
40.627301,
-74.020599
],
[
40.627513,
-74.02052
],
[
40.628057,
-74.020303
],
[
40.627946,
-74.020106
],
[
40.627876,
-74.020007
],
[
40.627765,
-74.01981
],
[
40.627624,
-74.019582
],
[
40.627493,
-74.019385
],
[
40.627443,
-74.019286
],
[
40.627382,
-74.019196
],
[
40.627271,
-74.019018
],
[
40.627068,
-74.01868
],
[
40.626977,
-74.01852
],
[
40.626967,
-74.0185
],
[
40.626946,
-74.01848
],
[
40.626896,
-74.01838
],
[
40.626865,
-74.01834
],
[
40.626845,
-74.0183
],
[
40.626804,
-74.01823
],
[
40.626774,
-74.01819
],
[
40.626733,
-74.01812
],
[
40.626682,
-74.01803
],
[
40.626631,
-74.01795
],
[
40.626611,
-74.01793
],
[
40.626601,
-74.01791
],
[
40.62657,
-74.01788
],
[
40.626499,
-74.017769
],
[
40.626316,
-74.017467
],
[
40.626204,
-74.017286
],
[
40.626143,
-74.017185
],
[
40.626102,
-74.017114
],
[
40.626041,
-74.017003
],
[
40.62601,
-74.016953
],
[
40.62598,
-74.016912
],
[
40.625868,
-74.01671
],
[
40.625766,
-74.016537
],
[
40.625643,
-74.016345
],
[
40.625593,
-74.016254
],
[
40.62546,
-74.01603
],
[
40.625369,
-74.015858
],
[
40.625359,
-74.015828
],
[
40.625348,
-74.015787
],
[
40.625287,
-74.015675
],
[
40.625206,
-74.015554
],
[
40.62476,
-74.014815
],
[
40.624285,
-74.01404
],
[
40.623593,
-74.012893
],
[
40.623483,
-74.012695
],
[
40.623444,
-74.012645
],
[
40.622947,
-74.011815
],
[
40.622621,
-74.011273
],
[
40.621961,
-74.010176
],
[
40.621647,
-74.00965
],
[
40.621372,
-74.0092
],
[
40.621304,
-74.00908
],
[
40.620823,
-74.008276
],
[
40.620636,
-74.007973
],
[
40.62032,
-74.007446
],
[
40.620004,
-74.006899
],
[
40.619547,
-74.006128
],
[
40.619337,
-74.005765
],
[
40.619277,
-74.005664
],
[
40.618996,
-74.005211
],
[
40.619606,
-74.00458
],
[
40.620162,
-74.004002
],
[
40.62035,
-74.003804
],
[
40.620714,
-74.003427
],
[
40.62099,
-74.003131
],
[
40.621265,
-74.002855
],
[
40.621539,
-74.002559
],
[
40.621814,
-74.002283
],
[
40.622364,
-74.001701
],
[
40.622818,
-74.001216
],
[
40.622917,
-74.001117
],
[
40.623175,
-74.000839
],
[
40.623463,
-74.00054
],
[
40.623533,
-74.00048
],
[
40.623773,
-74.00024
],
[
40.623963,
-74.00006
],
[
40.624034,
-73.99998
],
[
40.624557,
-73.999437
],
[
40.624638,
-73.999346
],
[
40.624912,
-73.999064
],
[
40.625247,
-73.99872
],
[
40.625531,
-73.998416
],
[
40.625817,
-73.998112
],
[
40.625868,
-73.998061
],
[
40.626387,
-73.997523
],
[
40.626489,
-73.997422
],
[
40.626591,
-73.997311
],
[
40.626733,
-73.997159
],
[
40.626855,
-73.997027
],
[
40.626906,
-73.996977
],
[
40.626946,
-73.996926
],
[
40.627078,
-73.996795
],
[
40.627169,
-73.996694
],
[
40.62718,
-73.996684
],
[
40.627261,
-73.996603
],
[
40.627352,
-73.996512
],
[
40.627533,
-73.996331
],
[
40.627634,
-73.996221
],
[
40.627675,
-73.996181
],
[
40.627946,
-73.9959
],
[
40.628127,
-73.99571
],
[
40.628447,
-73.99538
],
[
40.628586,
-73.995221
],
[
40.628676,
-73.995131
],
[
40.628736,
-73.995072
],
[
40.629132,
-73.994675
],
[
40.629162,
-73.994645
],
[
40.629241,
-73.994566
],
[
40.629793,
-73.993993
],
[
40.630157,
-73.993608
],
[
40.630343,
-73.993411
],
[
40.630539,
-73.993746
],
[
40.630981,
-73.994467
],
[
40.631119,
-73.994685
],
[
40.631207,
-73.994843
],
[
40.631355,
-73.995101
],
[
40.631473,
-73.99529
],
[
40.631542,
-73.99542
],
[
40.63165,
-73.9956
],
[
40.631967,
-73.99611
],
[
40.632304,
-73.996694
],
[
40.632973,
-73.997817
],
[
40.633205,
-73.998193
],
[
40.63381,
-73.999195
],
[
40.634023,
-73.999548
],
[
40.634104,
-73.999669
],
[
40.634328,
-74.00004
],
[
40.635234,
-74.001523
],
[
40.635489,
-74.001918
],
[
40.63555,
-74.002007
],
[
40.637017,
-74.0044
],
[
40.637477,
-74.00515
],
[
40.637895,
-74.005866
],
[
40.638004,
-74.006047
],
[
40.6383,
-74.006544
],
[
40.63834,
-74.006615
],
[
40.638448,
-74.006797
],
[
40.638655,
-74.007152
],
[
40.638999,
-74.00774
],
[
40.639206,
-74.008084
],
[
40.639647,
-74.00884
],
[
40.64003,
-74.00948
],
[
40.640246,
-74.009849
],
[
40.640739,
-74.010671
],
[
40.640927,
-74.010977
],
[
40.640957,
-74.011037
],
[
40.641284,
-74.011569
],
[
40.641723,
-74.012299
],
[
40.641943,
-74.012665
],
[
40.641953,
-74.012665
],
[
40.642285,
-74.013221
],
[
40.642477,
-74.01354
],
[
40.642628,
-74.01378
],
[
40.643308,
-74.014896
],
[
40.643633,
-74.015422
],
[
40.644194,
-74.014835
],
[
40.64458,
-74.014432
],
[
40.644774,
-74.014241
],
[
40.645027,
-74.01398
],
[
40.645342,
-74.01366
],
[
40.64522,
-74.01347
],
[
40.645109,
-74.01329
],
[
40.644997,
-74.013101
],
[
40.644885,
-74.012923
],
[
40.644316,
-74.012003
],
[
40.644082,
-74.011638
],
[
40.64399,
-74.01148
],
[
40.643878,
-74.011303
],
[
40.643806,
-74.011185
],
[
40.643654,
-74.010938
],
[
40.643297,
-74.010375
],
[
40.642973,
-74.009839
],
[
40.642871,
-74.00968
],
[
40.642679,
-74.00936
],
[
40.642648,
-74.0093
],
[
40.642305,
-74.008749
],
[
40.642034,
-74.008296
],
[
40.641743,
-74.007811
],
[
40.641633,
-74.007629
],
[
40.641404,
-74.007243
],
[
40.641334,
-74.007132
],
[
40.641304,
-74.007081
],
[
40.640977,
-74.006513
],
[
40.64064,
-74.005946
],
[
40.640591,
-74.005866
],
[
40.640305,
-74.005382
],
[
40.640217,
-74.005221
],
[
40.639991,
-74.00485
],
[
40.639951,
-74.00478
],
[
40.639461,
-74.003962
],
[
40.639431,
-74.003923
],
[
40.639019,
-74.00322
],
[
40.638695,
-74.002668
],
[
40.638271,
-74.001977
],
[
40.637716,
-74.001067
],
[
40.637377,
-74.00049
],
[
40.637137,
-74.00011
],
[
40.637017,
-73.99992
],
[
40.636986,
-73.99987
],
[
40.636936,
-73.999769
],
[
40.636906,
-73.999709
],
[
40.636402,
-73.998892
],
[
40.636038,
-73.998274
],
[
40.63557,
-73.997503
],
[
40.635,
-73.996563
],
[
40.634674,
-73.99604
],
[
40.634125,
-73.995161
],
[
40.634064,
-73.995052
],
[
40.633325,
-73.993855
],
[
40.632215,
-73.992038
],
[
40.631996,
-73.99167
],
[
40.631947,
-73.99159
],
[
40.631789,
-73.99134
],
[
40.631779,
-73.99131
],
[
40.631591,
-73.991
],
[
40.630686,
-73.989466
],
[
40.629921,
-73.988159
],
[
40.629389,
-73.987241
],
[
40.628825,
-73.98631
],
[
40.628626,
-73.985982
],
[
40.627906,
-73.984796
],
[
40.628467,
-73.984224
],
[
40.629023,
-73.983652
],
[
40.628527,
-73.982829
],
[
40.628097,
-73.98213
],
[
40.627775,
-73.981588
],
[
40.627554,
-73.981225
],
[
40.627321,
-73.980831
],
[
40.627281,
-73.98077
]
]
},
"legs": [
{
"distance": 3938,
"duration": 832,
"start_point_index": 0,
"start_point": {
"lat": 40.629103,
"lng": -74.025801