-1

how can i get JSON list of all countries (autocomplet) in select for example With AngularJS (http://ngmap.github.io/)?

Mohammed Akdim
  • 2,223
  • 1
  • 13
  • 21

1 Answers1

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

  • 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