'Restrict google autocomplete to one country when using no libraries

I am making the autocomplete API request like this.

https://maps.googleapis.com/maps/api/place/queryautocomplete/json&key=mykey&input=ko

This is working fine. But how can we restrict the results to one country?

I tried to pass in country restriction using components as mentioned in docs like below.
https://maps.googleapis.com/maps/api/place/queryautocomplete/json&key=mykey&input=ko&components=country:fr . But it's still returning all countries. Could someone tell me the correct way to do this?



Solution 1:[1]

Components are available for the Place Autocomplete method (https://developers.google.com/maps/documentation/places/web-service/autocomplete) but not for the Query Autocomplete method (https://developers.google.com/maps/documentation/places/web-service/query).

The parameter you are providing is getting ignored.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vpriesner