Rest API url format for routing api in open source Graphhopper

Hello.

I a trying to use the routing api in open source graphhopper locally. I know from other posts that the route endpoint is http://localhost:8989/route?, but when I try the request http://localhost:8989/route?point=12.896971�.227141&point=12.903026�.227989&vehicle=bike, it returns
{
“hints” : [ {
“details” : “java.lang.IllegalArgumentException”,
“message” : “You have to pass at least one point”
} ],
“message” : “You have to pass at least one point”
}

What am I doing wrong here?

Hi,

my first idea would be that your points look weird (why did you separate them with an % and not ,), try the following url:
http://localhost:8989/route?point=12.896971,80.227141&point=12.903026,80.227989&vehicle=bike

Thanks, this did the trick. I got the idea of using % from https://graphhopper.com/api/1/docs/routing/

Ah, that “%2C” is the URL encoded comma. I think we can easily change this in the examples for clarity.

(updated it)

1 Like