curl 'https://thezipcodes.com/api/v1/search?zipCode=13040&countryCode=US&apiKey=<apiKey>'
const request = require('request');
request('https://thezipcodes.com/api/v1/search?zipCode=13040&countryCode=US&apiKey=<apiKey>', { json: true }, (err, res, body) => {
if (err) { return console.log(err); }
console.log(body);
});
import requests
response = requests.get('https://thezipcodes.com/api/v1/search?zipCode=13040&countryCode=US&apiKey=<apiKey>');
print(response.text)
zipCode | Required | Zip code value | ||
countryCode | 2 digit country code | |||
apiKey | Required | Your Api Key |
{
"success": true,
"location": [{
"zipCode": "13040",
"country": "United States",
"countryCode2": "US",
"countryCode3": "USA",
"state": "New York",
"stateCode2": "NY",
"city": "Cincinnatus",
"county": "Cortland",
"latitude": "42.564381",
"longitude": "-75.934792",
"timeZone": "EST — Eastern Standard Time"
}]
}
{
"success": false,
"message": "Unauthorized"
}
{
"success": false,
"message": "Your plan does not allow to hit more requests. Please Upgrade and try again."
}
curl 'https://thezipcodes.com/api/v1/distance?fromZipCode=302019&toZipCode=302020&unit=MI&countryCode=IN&apiKey=<apiKey>'
const request = require('request');
request('https://thezipcodes.com/api/v1/distance?fromZipCode=302019&toZipCode=302020&unit=MI&countryCode=IN&apiKey=<apiKey>', { json: true }, (err, res, body) => {
if (err) { return console.log(err); }
console.log(body);
});
import requests
response = requests.get('https://thezipcodes.com/api/v1/distance?fromZipCode=302019&toZipCode=302020&unit=MI&countryCode=IN&apiKey=<apiKey>');
print(response.text)
fromZipCode | Required | Zip code value | ||
toZipCode | Required | Zip code value | ||
countryCode | Required | 2 digit country code | ||
unit | KM(Kilometer) MI(Miles) |
Default MI | ||
apiKey | Required | Your Api Key |
{
"success": true,
"result": {
"fromZipCode": "302019",
"toZipCode": "302020",
"distance": "12.4063",
"unit": "MI"
}
}
{
"success": false,
"message": "One of the zip codes is not valid or present in database"
}
{
"success": false,
"message": "Unauthorized"
}
{
"success": false,
"message": "Your plan does not allow to hit more requests. Please Upgrade and try again."
}
curl 'https://thezipcodes.com/api/v1/states?countryCode=US&apiKey=<apiKey>'
const request = require('request');
request('https://thezipcodes.com/api/v1/states?countryCode=US&apiKey=<apiKey>', { json: true }, (err, res, body) => {
if (err) { return console.log(err); }
console.log(body);
});
import requests
response = requests.get('https://thezipcodes.com/api/v1/states?countryCode=US&apiKey=<apiKey>');
print(response.text)
countryCode | Required | 2 digit country code | ||
apiKey | Required | Your Api Key |
{
"success": true,
"results": {
"country": "US",
"states": ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "..."]
}
}
{
"success": false,
"message": "Unauthorized"
}
{
"success": false,
"message": "Your plan does not allow to hit more requests. Please Upgrade and try again."
}