Google Places autocomplete API not returning postal codes - api

I have been googling this for hours and I have not found a solution. When I call:
"https://maps.googleapis.com/maps/api/place/autocomplete/json?input="+WebUtility.UrlEncode(MYADDRESSSPEC)+"&key="+MYAPIKEY;
I get things like:
123 Main St, Somewhere, Ohio United States
123 Main St, Somewhere Else, Indiana, United States
I've looked at the optional arguments and I cannot find one for ZIP/postal code. I noticed the textsearch API does return ZIP codes. I could run it through autocomplete as someone is typing the address and THEN run each result through the textsearch API but I want to accomplish this in just ONE web service call. Does anyone know how?
Thanks in advance!

I don't think the autocomplete API supports returning postcodes in the predictions array. Your best bet (albeit cumbersome) is to do the autocomplete query and run a details query for each of the place_id entries returned.

You can add the type=(regions) filter to the url (as query param) and then you can search on postal codes. It is not completely fine because it still can't find all the postal codes I think. But this might be what you need.

Related

api that gives all needed pieces for a car from its vin number

I'm developing an application and I'm looking for an api that gives all car parts from its vin number
I know it's not going to be for free and it's ok
any suggestions please ? thank you
Don't know if you still need it but in my project I used the United States Department of Transportation's API. It gives informations about the car and it's free to use.
It's more centered around American's Specifications, but there is also a call for Canadian Specifications.
You can also choose the data format you want between XML, CSV and JSON !

Google Geocoding API Returning Wrong Zip/City

The address I am attempting to geocode is 1030 Pops Way, Bogart, GA 30622. Google seems to think this address is located in Watkinsville, GA 30677 and so returns Watkinsville and 30677. This is incorrect. Literally every other site listing addresses, including USPS, locates this address in Bogart 30622.
This is not the only instance of Google returning incorrect zip codes I have come across.
https://maps.googleapis.com/maps/api/geocode/json?address=1030+pops+way+30622+bogart+ga&key=API-KEY
It seems to be a data issue on Google side.
Let's check the 'Pops Way, Bogart, GA 30622' request in Geocoder tool:
https://developers-dot-devsite-v2-prod.appspot.com/maps/documentation/utils/geocoder/#q%3DPops%2520Way%252C%2520Bogart%252C%2520GA%252030622
As you can see the result is a route with a postal code 30622 as shown in my screenshot
However if I click the building with number 1030 on this street the postal code changes to 30677
https://developers-dot-devsite-v2-prod.appspot.com/maps/documentation/utils/geocoder/#q%3D33.901296%252C-83.559744
as shown in the following screenshot
I can suggest reporting a wrong postal code in address to Google data team as explained in the documentation
https://support.google.com/maps/answer/3094088
You can use this direct link
https://www.google.com/maps/#33.9017628,-83.5603702,18z/data=!10m1!1e1!12b1?rapsrc=apiv3
I hope this helps!

Openweathermap don't work for some countries?

I'm using json API data from openweathermap to get info about specific city.
It was working fine few days ago, and now for some reason every city marked with country code "RS" which is for Serbia, can't work.
http://api.openweathermap.org/data/2.5/weather?q=Belgrade,rs&APPID=MYAPI&units=metric&lang=hr
If I'm using cities in other countries, for example this, it's working:
http://api.openweathermap.org/data/2.5/weather?q=Zagreb,hr&APPID=MYAPI&units=metric&lang=hr
Not really sure what's the difference here, and why "RS" country code isn't working?
Any suggestions?
This is the bug in their API, I got response from their support that they're working on it.

Geocoding with rails search

I've been running into some location based searches using the Google Maps API (more of a structural issue on my end than any criticism of the mapping api)
For example, if a user searches for "Victoria, Canada" it will bring up results for "Victoria, Canada" as expected. However, if a user searches for "Canada," google returns a longitude and latitude for the middle of the country, which is essential for correctly centering the map. However, it will not display any results since the nearest location is too far away from the location returned by google. I'm filtering out results that are about 20 miles away.
Can the Google Maps API return anything that I could use to tell if a user has entered a state or country name? If not, has anyone developed a work around solution?
Ideally, I would like to avoid just ordering the results by nearest location. I don't want items for "Spain" showing up at the bottom of a list when a user searches for "United States." I would try to determine if the query is a state or country prior to the search, but this seems very daunting task given the different possible spelling of country and region names. If I was only expecting english spellings, it would be a much easier approach.
Assuming this is a form on a site that has a controller parse the form and send the request to Google's API, you could break the form out into address, city, state, and country (if needed) form elements then make the address and city required fields.
I'm doing a similar approach with a site I'm building using Google Places API and it seems to work for me.

How to find city name with respect to the zip code through iphone applications

Can any one help me in finding the city name in the map when I give zipcode through iPhone application.
As Deepak suggested, a Geocoding API is almost certainly the way to go. Google and Yahoo both provide good ones that can convert zipcodes into city names.
Here's a sample Google query for zipcode: http://maps.googleapis.com/maps/api/geocode/json?address=77048&sensor=true
And a sample Yahoo query for zipcode: http://where.yahooapis.com/geocode?q=77048&appid=0
I don't think there is any feature built-in that will help you find the city name like this. You can look at Geocoding options such a Google's Geocoding API but then you might need a bit more info than zip code.
Created a little native tool that looks up city, state, and lat/long without using the network connection. Has a rather large (1.9MB) SQLite database to pull from, so don't include this if you can just query Google or another online API.
https://github.com/ocrickard/OCZipLookup