Reputation: 103
I make a request: curl -s "https://maps.googleapis.com/maps/api/place/autocomplete/json?input=штат+нью+йорк&key=< key >"
Get result: { "predictions" : [], "status" : "ZERO_RESULTS" }
But when I pass the link in the browser - I get correct result :(
P.S. "штат+нью+йорк" = "state+new+york" ;)
UPDATE
Problem in word "штат" [ukrainian\russian] ("state" - on english) and only in curl request
Upvotes: 0
Views: 1173
Reputation: 372
you need to encode the input string because of the spaces(or for any characters) used in the input as browser automatically encode those spaces
it should be like this
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=state%20new%20york&key=
as you can see the input is state new york
for language related query and results you should also add language parameter in your query
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=штат+нью+йорк&language=ru&key=
After adding language you will get required results
Upvotes: 3