E-Mobility API

Online solution kit to extend existing product with E-Mobility features. We are providing mapping, routing and navigation solutions with more than 15 years of E-Bike navigation software experience. Detailed customizable maps, including large list of POIs, optimal route detection, precise turn-by-turn navigation, and much more.

API Functions

Call this api endpoint to get an access token. With this token you can call further api functions.
It is designed to plan a route for electric bikes (E-Bikes) between two geographical points, considering several optional waypoints, and based on various route planning and vehicle parameters.
It calculates the potential range of an E-Bike based on the provided parameters and returns a polygon shape that represents this range.
It allows you to define a route by drawing a shape on the map, then attempts to plan the optimal route for an E-Bike within the shape you've drawn.
Hourly forecast for 4 days.

Member Documentation

Get Token

Call this api endpoint to get an access token. With this token you can call further api functions.

Method
GET
Parameter
client_id
Clientid
client_secret
Client secret
grant_type
Grant type
Response

{
    "access_token": "64bUO16JnaaFk1A6QkbQE9vTdoaKaYEXaoLdstRf",
    "token_type": "Bearer",
    "expires_in": 86400,
    "refresh_token": "pjXjgakfBduI6yaGfsn4BiHW2bBapZGQaG1PZuQV"
}
                    
Example
https://api.gpstuner.com/oauth/token?client_id=CLIENT_ID&client_secret=CLIENT_SECRET&grant_type=GRANT_TYPE

Plan Route

It is designed to plan a route for electric bikes (E-Bikes) between two geographical points, considering several optional waypoints, and based on various route planning and vehicle parameters.

Headers
Authorization: Bearer <access_token>
Method
GET
Parameter
wps
list of waypoints in the following format: lat1,lon1|lat2,lon2|...|latn,lonn
vehicletype

0 = BICYCLE

1 = MTB

2 = SPEED

3 = PEDESTRIAN

4 = KICKSCOOTER

routeplanmode

-1 = SUGGESTED, EASIEST and SHORTEST

0 = SUGGESTED

1 = EASIEST

2 = SHORTEST

Optional parameter, default is -1

majorroadweight

0 = TRYTOAVOID

1 = ROADTYPEWEIGHT_ALLOW

2 = ROADTYPEWEIGHT_PREFER

unpavedroadweight

0 = TRYTOAVOID

1 = ROADTYPEWEIGHT_ALLOW

2 = ROADTYPEWEIGHT_PREFER

cycleroadweight

0 = TRYTOAVOID

1 = ROADTYPEWEIGHT_ALLOW

2 = ROADTYPEWEIGHT_PREFER

ferriesweight

0 = TRYTOAVOID

1 = ROADTYPEWEIGHT_ALLOW

2 = ROADTYPEWEIGHT_PREFER

useoneway
If true, routeplanner will ignore oneway restriction in low level road classes
bearing
The angle of the user from north. If this is not zero, route planner will use your direction to start the route.
vendor
name of the manufacturer
vehiclemodel
name of the vehicle model
batterycapacity
Battery capacity in Ah
batteryvoltage
Battery voltage in V
maxmotorpower
max motor power in Watt
assistfactor
factor of the assist level in percent
avgcyclistpower
average cyclist power (set to 150 by default)
vehicleweight
Vehicle weight in kg
userweight
User weight in kg
soc
current SOC
deviceuniqueid
Uniqueid of the E-bike
lng

turns, street names language in the response

available languages: bra, chn, cze, dan, dut, eng, fin, fre, ger, gre, hun, ita, jpn, nor, pol, por, rom, slk, slv, spa, swe

Optional parameter, default is eng

Response

{
    "result": [{
            "routeplanmode": 0,
            "points": [{
                    "lat": 49.467626,
                    "lon": 11.082157,
                    "alt": 322.108398,
                    "soc": 55.000000
                }, {
                    "lat": 49.467314,
                    "lon": 11.082157,
                    "alt": 322.560547,
                    "turn": "TURN_COMB_RIGHT_SLIGHT_RIGHT",
                    "turnstr": "Turn right then turn slight right",
                    "soc": 54.965351
                }, {
                    "lat": 49.467316,
                    "lon": 11.081618,
                    "alt": 321.775391,
                    "turn": "TURN_SLIGHT_RIGHT",
                    "turnstr": "Slight right",
                    "street": "High Street"
                    "soc": 54.965351
                }, {
                    "lat": 49.467642,
                    "lon": 11.081577,
                    "alt": 321.242188,
                    "soc": 54.965351
                }, {
                    "lat": 49.467640,
                    "lon": 11.081438,
                    "alt": 321.041016,
                    "soc": 54.965351
                ....
            ]
        }, {
            "routeplanmode": 1,
            "points": [...]
        }, {
            "routeplanmode": 2,
            "points": [...]
        }
    ]
}
                    
Example
https://api.gpstuner.com/api/planroute?wps=35.7022834,139.7194348|35.6979532,139.6748275|35.7026370,139.6054391|35.7261658,139.5417552&vehicletype=0&routeplanmode=0&majorroadweight=0&unpavedroadweight=0&cycleroadweight=0&ferriesweight=0&useoneway=false&bearing=0&deviceuniqueid=device0001&vendor=MANUFACTURER&vehiclemodel=MODEL_01&batterycapacity=9.6&batteryvoltage=48&vehicleweight=25&userweight=75&maxmotorpower=250&assistfactor=100&avgcyclistpower=150&soc=80&lng=eng

Calculate Range Polygon

It calculates the potential range of an E-Bike based on the provided parameters and returns a polygon shape that represents this range.

Headers
Authorization: Bearer <access_token>
Method
GET
Parameter
lat
latitude of start point
lon
longitude of start point
vendor
name of the manufacturer
vehiclemodel
name of the vehicle model
batterycapacity
Battery capacity in Ah
batteryvoltage
Battery voltage in V
maxmotorpower
max motor power in Watt
assistfactor
factor of the assist level in percent
avgcyclistpower
average cyclist power (set to 150 by default)
vehicleweight
vehicle weight in kg
userweight
User weight in kg
soc
current SOC
deviceuniqueid
uniqueid of the E-Bike
Response

{
    "outerline": [
        [
            [49.103394, 10.689697], [49.108887, 10.618286],
            [49.139099, 10.480957], [49.213257, 10.417786],
            [49.452209, 11.835022], [49.394531, 11.777344],
            [49.342346, 11.744385], [49.320374, 11.722412],
            ...,
            [49.106140, 10.708923], [49.106140, 10.692444]
        ]
    ],
    "innerline": [
        [
            [49.850464, 10.942383], [49.847717, 10.923157],
            [49.850464, 10.928650], [49.886169, 10.909424],
            [49.875183, 11.008301], [49.866943, 11.011047],
            ...,
            [49.828491, 10.953369], [49.831238, 10.964355]
        ]
    ]
}
                    
Example
https://api.gpstuner.com/api/calculaterange?lat=35.73962&lon=139.63748&deviceuniqueid=device0001&vendor=MANUFACTURER&vehiclemodel=MODEL_01&batterycapacity=9.6&batteryvoltage=48&vehicleweight=25&userweight=75&maxmotorpower=250&assistfactor=100&avgcyclistpower=150&soc=80

Draw and Plan

It allows you to define a route by drawing a shape on the map, then attempts to plan the optimal route for an E-Bike within the shape you've drawn.

Headers
Authorization: Bearer <access_token>
Method

POST

(See working example on https://rangecalculator.gpstuner.com/ )

Parameter
deviceuniqueid
uniqueid of the E-Bike
Body
Json data with routeplanning parameters, see below
Response

{
    "route": [
        [
            47.772340,
            9.331859
        ],
        [
            47.772494,
            9.332533
        ]...[
            47.835000,
            9.470020
        ],
        [
            47.835887,
            9.469875
        ]
    ],
    "sections": [
        0,
        208,
        363
    ],
    "routeNodes": [],
    "alternateRouteClickedCount": 0
}
                    
Example
https://api.gpstuner.com/api/draw_and_plan?deviceuniqueid=device0001
POST DATA

POST DATA - DRAW

{"route":[[47.77234,9.331859],...[47.797524,9.428655],[47.797713,9.428505]],

Previously planned route points. Set to empty array on init.

"sections":[0,209],

Previously planned route sections. Set to empty array on init.

"draw":[[848,400],[848,396]...[1083,69],[1084,67]],

Screen coordinates of drawn route.

"corners":[[47.84361438123927,9.283794350769881,0,0],[47.735317820710954,9.283794350769881,0,939],[47.84361438123927,9.572185464051131,1680,0]],

Corners in geo and screen coordinates. Upper left, Bottom left, Upper right

"alternateRouteClickedCount":0}

Count of alternate route option used.

POST DATA - POINT

{"route":[[47.77234,9.331859],...[47.797524,9.428655],[47.797713,9.428505]],

Previously planned route points. Set to empty array on init.

"sections":[0,209],

Previously planned route sections. Set to empty array on init.

"point":[47.81277017204049,9.712097481640626],"alternateRouteClickedCount":0}

Count of alternate route option used.

POST DATA – ALTERNATE ROUTE

{"route":[[47.77234,9.331859],...[47.797524,9.428655],[47.797713,9.428505]],

Previously planned route points. For alternate route calculation there must be point in the route.

"sections":[0,209],

Previously planned route sections.

"alternateRoute":1

Set to 1 to calculate alternate route for last segment

"alternateRouteClickedCount":0}

Count of alternate route option used.

POST DATA – FULL REQUEST


{
    "route": [
        [47.77234, 9.331859], [47.772494, 9.332533], [47.772613, 9.332506], [47.773285, 9.332147],
        [47.773809, 9.332119], [47.774379, 9.331703], [47.774677, 9.331291], [47.775169, 9.330084],
        [47.775771, 9.329672], [47.77605, 9.329241], [47.77605, 9.329241], [47.77605, 9.329241], 
        [47.77605, 9.329241], [47.77605, 9.329241], [47.77605, 9.329241], [47.77605, 9.329241],
        [47.77605, 9.329241], [47.77605, 9.329241], [47.77605, 9.329241], [47.77605, 9.329241]
    ],
    "sections": [0, 209],
    "draw": [
        [848, 400], [848, 396], [848, 394], [848, 391], [851, 385], [853, 374], [855, 363],
        [858, 346], [861, 326], [863, 310],
        [867, 292], [870, 266], [871, 251], [876, 236], [880, 225], [883, 214], [887, 205],
        [892, 197], [899, 188], [903, 179],
        [911, 170], [918, 162], [923, 156], [932, 149], [940, 145], [948, 142], [959, 138],
        [970, 133], [979, 129], [992, 123],
        [999, 122], [1003, 121], [1010, 120], [1013, 119], [1025, 116], [1030, 113], [1038, 111],
        [1042, 108], [1049, 106], [1054, 102],
        [1059, 99], [1064, 94], [1066, 91], [1071, 85], [1071, 84], [1071, 83], [1074, 80],
        [1075, 78], [1077, 76], [1079, 73],
        [1081, 71], [1083, 70], [1083, 69], [1084, 67],
    ],
    "corners": [
        [47.84361438123927, 9.283794350769881, 0, 0], [47.735317820710954, 9.283794350769881, 0, 939],
        [47.84361438123927, 9.572185464051131, 1680, 0]
    ],
    "alternateRouteClickedCount": 0
}

                    

Hourly weather forecast

Hourly forecast for 4 days.

Method
GET
Headers
Authorization: Bearer <access_token>
Parameter
lat
latitude data
lon
longitude data
deviceuniqueid
uniqueid of the E-bike
Response

{
    "cod": "200",
    "message": 0,
    "cnt": 96,
    "list": [
        {
            "dt_txt": "2021-02-15 18:00:00",
            "temp": 271.04000000000002,
            "weather": {
                "id": 601,
                "main": "Snow",
                "description": "snow",
                "icon": "weather_icon_snow"
            },
            "clouds": {
                "all": 100
            },
            "wind": {
                "speed": 2.3599999999999999,
                "deg": 146
            }
        }, … ,
    ]
}
                    
Example
https://api.gpstuner.com/api/hourly_forecast?lat=49.23&lon=12.32&deviceuniqueid=device0001
Measures

Temperature: Kelvin

Wind speed: meter/sec

Weather Conditions

Weather icons

How to get icon

https://api.gpstuner.com/assets/https://gpstuner.com/wp-content/themes/gpstuner/assets/img/api/[ICON]

Icon list
Day iconNight iconDescription
weather_icon_clear_sky_day.svgweather_icon_clear_sky_night.svgclear sky
weather_icon_few_clouds_day.svgweather_icon_few_clouds_night.svgfew clouds
weather_icon_scattered_clouds.svgweather_icon_scattered_clouds.svgscattered clouds
weather_icon_broken_clouds.svgweather_icon_broken_clouds.svgbroken clouds
weather_icon_shower_rain.svgweather_icon_shower_rain.svgshower rain
weather_icon_rain.svgweather_icon_rain.svgrain
weather_icon_thunderstorm.svgweather_icon_thunderstorm.svgthunderstorm
weather_icon_snow.svgweather_icon_snow.svgsnow
weather_icon_mist.svgweather_icon_mist.svgmist
IDMainDescriptionIcon
200Thunderstormthunderstorm with light rainweather_icon_thunderstorm
201Thunderstormthunderstorm with rainweather_icon_thunderstorm
202Thunderstormthunderstorm with heavy rainweather_icon_thunderstorm
210Thunderstormlight thunderstormweather_icon_thunderstorm
211Thunderstormthunderstormweather_icon_thunderstorm
212Thunderstormheavy thunderstormweather_icon_thunderstorm
221Thunderstormragged thunderstormweather_icon_thunderstorm
230Thunderstormthunderstorm with light drizzleweather_icon_thunderstorm
231Thunderstormthunderstorm with drizzleweather_icon_thunderstorm
232Thunderstormthunderstorm with heavy drizzleweather_icon_thunderstorm

Group 3xx: Drizzle

IDMainDescriptionIcon
300Drizzlelight intensity drizzleweather_icon_shower_rain
301Drizzledrizzleweather_icon_shower_rain
302Drizzleheavy intensity drizzleweather_icon_shower_rain
310Drizzlelight intensity drizzle rainweather_icon_shower_rain
311Drizzledrizzle rainweather_icon_shower_rain
312Drizzleheavy intensity drizzle rainweather_icon_shower_rain
313Drizzleshower rain and drizzleweather_icon_shower_rain
314Drizzleheavy shower rain and drizzleweather_icon_shower_rain
321Drizzleshower drizzleweather_icon_shower_rain

Group 5xx: Rain

IDMainDescriptionIcon
500Rainlight rainweather_icon_rain
501Rainmoderate rainweather_icon_rain
502Rainheavy intensity rainweather_icon_rain
503Rainvery heavy rainweather_icon_rain
504Rainextreme rainweather_icon_rain
511Rainfreezing rainweather_icon_snow
520Rainlight intensity shower rainweather_icon_rain
521Rainshower rainweather_icon_rain
522Rainheavy intensity shower rainweather_icon_rain
531Rainragged shower rainweather_icon_rain

Group 6xx: Snow

IDMainDescriptionIcon
600Snowlight snowweather_icon_snow
601SnowSnowweather_icon_snow
602SnowHeavy snowweather_icon_snow
611SnowSleetweather_icon_snow
612SnowLight shower sleetweather_icon_snow
613SnowShower sleetweather_icon_snow
615SnowLight rain and snowweather_icon_snow
616SnowRain and snowweather_icon_snow
620SnowLight shower snowweather_icon_snow
621SnowShower snowweather_icon_snow
622SnowHeavy shower snowweather_icon_snow

Group 7xx: Atmosphere

IDMainDescriptionIcon
701MistMistweather_icon_mist
711SmokeSmokeweather_icon_mist
721HazeHazeweather_icon_mist
731Dustsand/ dust whirlsweather_icon_mist
741Fogfogweather_icon_mist
751SandSandweather_icon_mist
761DustDustweather_icon_mist
762Ashvolcanic ashweather_icon_mist
771SquallSquallweather_icon_mist
781TornadoTornadoweather_icon_mist

Group 800: Clear

IDMainDescriptionIcon
800Clearclear sky
weather_icon_clear_sky_day
weather_icon_clear_sky_night

Group 80x: Clouds

IDMainDescriptionIcon
801Cloudsfew clouds: 11-25%
weather_icon_few_clouds_day
weather_icon_few_clouds_night
802Cloudsscattered clouds: 25-50%
weather_icon_scattered_clouds
803Cloudsbroken clouds: 51-84%
weather_icon_broken_clouds
804Cloudsovercast clouds: 85-100%
weather_icon_broken_clouds