how can i get JSON list of all countries (autocomplet) in select for example With AngularJS (http://ngmap.github.io/)?
Asked
Active
Viewed 820 times
-1
-
Some code of what you've tried so far should be included. – Mike Feltman Sep 12 '17 at 14:17
-
But if I do not know how? – Mohammed Akdim Sep 12 '17 at 15:19
-
An example that includes where you want to make use of the list seems to be what most do in those situations. At any rate, I think @Paula Tomasi gave you what you need. – Mike Feltman Sep 12 '17 at 15:24
1 Answers
1
A "place autocomplete" request is a url http with the following format (output can have the values json or xml): https://maps.googleapis.com/maps/api/place/autocomplete/output?parameters
The mandatory parameters are
- input (string with the text you want to research)
- key (the app's api key)
You can also set the location type you want (countries in this case). An example URL would be:
https://maps.googleapis.com/maps/api/place/autocomplete/json?input={TYPED_TEXT}&types=countries&key={YOUR_API_KEY}
You can check a detailed Google documentation for this here: https://developers.google.com/places/web-service/autocomplete

Paula Tomasi
- 51
- 5
-
Given that the original question doesn't include and code to enhance, I think this is a perfectly fine answer. The question is really the problem. – Mike Feltman Sep 12 '17 at 14:17
-
Thank you @Paula for response but I tested this https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Ma&types=countries&key={YOUR_API_KEY} with MY_API_KEY and it does not work !! it returns the following result : { "predictions": [], "status": "INVALID_REQUEST" } – Mohammed Akdim Sep 12 '17 at 15:42