Authorization and Usages

curl --location --request GET 'https://thezipcodes.com/api/v1/usages' --header 'apikey: <apiKey>'
curl --location --request GET 'https://thezipcodes.com/api/v1/usages?apiKey=<apiKey>'
{
 "success": true,
 "result": {
	"used": 988,
	"total": 10000
  }
}

Get zip code address GET /api/v1/search

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)

Params

zipCode Required Zip code value
countryCode 2 digit country code
apiKey Required Your Api Key

Response

{
  "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."
}

Get distance between locations GET /api/v1/distance

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)

Params

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

Response

{
  "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."
}

Get states by country GET /api/v1/states

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)

Params

countryCode Required 2 digit country code
apiKey Required Your Api Key

Response

{
    "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."
}