Zip code validation to match City and State - javascript

Hi I have a registration form, and on the address details we require the user to input it's State, City and Zipcode.
My problem is I need to verify the Zipcode if it is the correct Zipcode on the Users State and City.
Example.
If user put's Minnesota (State), Bloomington (City) so if user puts 55437 it should be a valid zipcode. But the tricky part is that some City have multiple Zipcodes so I need to have a data for all of the Zipcode available on that City.
I tried google api geocoding but the return from the API is not consistent. Can anyone suggest on what API or package that is best for this? or Some data where I can store on my DB so that I'll have reference for all the City and Zipcodes.

You can use this data or maybe search for another free zipcode resource. Hope this helps.
https://github.com/midwire/free_zipcode_data

You could use https://www.zipcodeapi.com/. This call https://www.zipcodeapi.com/API#locToZips gives you possible zip codes for a city. There is a free version and a low cost version.

Related

API to get District, State and Country name from City name

I want to implement drop down what have auto complete facility for city name . and other drop down value automatically fill for district, state and country.
Is there is any api available for it?
I've been using Google Maps Api, Well it definitely works try looking at this link
Did you try Google Maps Place Details API ?
All you have to do is google "API for places" and find it !

How to get Country, State, City, Postcode, Country code by using Google Autocomplete in IONIC App

I need to get data(Country, State, City, Postcode, Country code) by using Google Autocomplete where user put there address in app.
For Google api I use:
https://maps.googleapis.com/maps/api/js?libraries=places,geometry&sensor=false
I try lot of AngularJs and Ionic Plugin for IONIC App but not get success like as:
https://github.com/iazi/ngMapAutocomplete
https://github.com/vskosp/vsGoogleAutocomplete
https://github.com/ivanthecrazy/ion-place-autocomplete
https://github.com/israelidanny/ion-google-place
Please help me if Any one work on it or face this type of problem.
I solve my problem my using this Plugin:
https://market.ionic.io/plugins/ion-google-autocomplete

I need php function to get the current user location like street name

I am trying to get the user location using php and mysql
The question is
Arethere any php functions or libraries that can get the current user location like street name and city name
You could refer to this link here: PHP Detect Country and City
This class can get the current user location using codehelper.io API.
It can determine the current user IP address checking the user remote IP address eventually behind a proxy server.
The class can send a HTTP request to the codehelper.io API to get the geographic location details associated to the user IP address.
It returns the continent, country, city, latitude, longitude and other details associated to the location city.
The class caches the locations for the given IP address for one week.

Google geocoder returns wrong coordinates for address

I plot locations of real estate on a map. The address listed below is mapped incorrectly because it is a new build and I assume the street and everything is a new build, which is the reason Google can't find it in it's database.
What I want to happen is Google return "GeocoderStatus.ZERO_RESULTS" and not just pick a location with a related name and give me those coords.
The address I'm plotting is:
14018 Lonecreek Ave
Orlando, Florida 32828
If you submit the request via http, you get the same results i get through the API, see this link: http://maps.googleapis.com/maps/api/geocode/json?address=140
You'll see it comes back with "Lone Hill Drive" which is incorrect location. How can I tell Google return ZERO_RESULTS status in this instance?
Google's geocoding process isn't perfect (none are.)
What you can check for is the result's geometry.location_type property and test if it's value is "APPROXIMATE" to see if you can trust the returned lat/lng. Read more in the Documentation.
If it's way off you can report it directly to google.
You can use the API's Component Filtering to filter the results by a specific postcode. In such cases a non-exact match will have location_type of "APPROXIMATE" rather than the "GEOMETRIC_CENTER" you were seeing before.
http://maps.googleapis.com/maps/api/geocode/json?address=[address]&components=postal_code:[postcode]&sensor=false
Here's your geocoding request WITH component filtering
and WITHOUT component filtering

Phone Number Validation

I want to validate a phone number entered by user according to his/her country which I know.
I am using PHP/Javascript/MYSQL in my site.
OR
have anybody list of mobile number format for all countries i.e. area code,country code, minimum and maximum length??
I've been using a free API called numverify.com - you can request any national or international phone number, and the API will return a simple JSON result containing validation results, country, location, line type infos, and more.
I know about a paid service from data8
I am sure there are others out there do a Google for "mobile phone validation api"

Categories