Get U.S. ZIP Code demographics covering population, income, housing, and more.
Request Details
Example Request Url
https://geodata.cdxtech.com/api/geodemographics?key={key}&zipcode={zipcode}&format={format}
Description | Required | Default Value | Example | |
key | Authentication Key | key=dd76pxfi4feydh4bz_dtrjyf6flu4-987asdjhajkd555usds28ad984yhz | ||
zipcode | Zip Code Reference | zipcode=07869 | ||
format | Output Formatting | json | format=json (supported formats: json, xml, csv) |
Coding Examples
Here are some coding examples to get you started. Please feel free to contact support if you need additional assistance.
string key = "{your-key}";
string zipcode = "07869";
string format = "json";
HttpResponseMessage message = null;
using (HttpClient client = new HttpClient())
{
client.BaseAddress = new Uri("https://geodata.cdxtech.com");
StringBuilder url = new StringBuilder("/api/geodemographics?");
url.Append("key=").Append(key);
url.Append("&zipcode=").Append(zipCode);
url.Append("&format=").Append(format);
message = client.GetAsync(url.ToString()).Result;
}
import requests
def get_geodemographics(api_key, zipcode, response_format="json"):
"""Fetch demographic data by ZIP code using the API."""
base_url = "https://geodata.cdxtech.com"
endpoint = "/api/geodemographics"
url = f"{base_url}{endpoint}"
params = {
"key": api_key,
"zipcode": zipcode,
"format": response_format,
}
response = requests.get(url, params=params)
response.raise_for_status()
try:
return response.json()
except ValueError:
return response.text
if __name__ == "__main__":
key = "{your-key}"
zipcode = "07869"
format = "json"
data = get_geodemographics(key, zipcode, format)
import json
if isinstance(data, (dict, list)):
print(json.dumps(data, indent=2))
else:
print(data)
// Cargo.toml
// [dependencies]
// reqwest = { version = "0.11", features = ["blocking", "json"] }
// serde = { version = "1.0", features = ["derive"] }
// serde_json = "1.0"
use std::error::Error;
fn get_geodemographics(
api_key: &str,
zipcode: &str,
response_format: &str,
) -> Result> {
let client = reqwest::blocking::Client::new();
let resp = client
.get("https://geodata.cdxtech.com/api/geodemographics")
.query(&[
("key", api_key),
("zipcode", zipcode),
("format", response_format),
])
.send()?
.error_for_status()?;
let json: serde_json::Value = resp.json()?;
Ok(json)
}
fn main() -> Result<(), Box> {
let api_key = "{your-key}";
let zipcode = "07869";
let format = "json";
match get_geodemographics(api_key, zipcode, format) {
Ok(data) => println!("Response JSON:\n{}", serde_json::to_string_pretty(&data)?),
Err(err) => eprintln!("Error fetching data: {}", err),
}
Ok(())
}
async function getGeodemographics({ key, zipcode, format = "json" }) {
const baseUrl = "https://geodata.cdxtech.com";
const endpoint = "/api/geodemographics";
const params = new URLSearchParams({ key, zipcode, format });
const url = `${baseUrl}${endpoint}?${params.toString()}`;
const response = await fetch(url);
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
const text = await response.text();
try {
return JSON.parse(text);
} catch {
return text;
}
}
// Example usage:
(async () => {
const key = "{your-key}";
const zipcode = "07869";
const format = "json";
try {
const data = await getGeodemographics({ key, zipcode, format });
console.log("Response:", data);
} catch (err) {
console.error("Error fetching data:", err);
}
})();
Dim key As String = "{your-key}"
Dim zipcode As String = "07869"
Dim format As String = "json"
Dim message As HttpResponseMessage = Nothing
Using client As New HttpClient()
client.BaseAddress = New Uri("https://geodata.cdxtech.com")
Dim url As New StringBuilder("/api/geodemographics?")
url.Append("key=").Append(key)
url.Append("&zipcode=").Append(zipCode)
url.Append("&format=").Append(format)
message = client.GetAsync(url.ToString()).Result
End Using
The following is for the VBA-WEB Excel template available at http://vba-tools.github.io/VBA-Web/
Dim Client As New WebClient
Dim Request As New WebRequest
Dim key As String
Dim zipcode As String
Dim format As String
key = "{your-key}"
zipcode = "07869"
format = "json"
Client.BaseUrl = "https://geodata.cdxtech.com/api/"
Request.Method = WebMethod.HttpGet
Request.ResponseFormat = WebFormat.Json
Request.Resource = "geodemographics?key={key}&zipcode={zipCode}&format={format}"
Request.AddUrlSegment "key", key
Request.AddUrlSegment "zipCode", zipcode
Request.AddUrlSegment "format", format
Set Response = Client.Execute(Request)
Output Examples
Here are some output data examples. You can also use the Report Generator tab to export specific data files.
{
"service": "GeoDemographics",
"url": "https://geodata.cdxtech.com/api/geodemographics?key={your-key}&zipcode=07869&format=json",
"status": "Success",
"tokenCharge": 1,
"message": null,
"totalResults": 1,
"results": {
"zipCode": "07869",
"city": "RANDOLPH",
"state": "NJ",
"population": "25291",
"deliveryBusiness": "596",
"populationEstimate": "26078",
"deliveryResidential": "9215",
"businessAnnualPayroll": "284463",
"deliveryTotal": "11386",
"businessFirstQuarterPayroll": "63778",
"averageHouseValue": "504000",
"medianAge": "40.1",
"growingCountiesA": "0",
"medianAgeFemale": "40.4",
"growingCountiesB": "0",
"medianAgeMale": "39.9",
"growthIncreaseNumber": "0",
"householdsPerZipcode": "8917",
"growthIncreasePercentage": "0",
"personsPerHousehold": "2.83",
"growthRank": "0",
"incomePerHousehold": "115424",
"cbsaPopulation": "18897109",
"numberOfBusinesses": "703",
"cbsaDivisionPopulation": "2471171",
"numberOfEmployees": "6012",
"cbsaName": "New York-Newark-Jersey City, NY-NJ-PA",
"acsAgeMedian": "47.9",
"acsAgeMedianFemale": "49.4",
"acsAgeMedianMale": "46.3",
"acsHouseholdsTotal": "10327",
"acsHouseholdIncomeMedian": "82346",
"acsHouseholdSizeAverage": "2.52",
"acsHousingValueMedian": "233600",
"acsPopulation": "26344",
"acsPopulationFemale": "13843",
"acsPopulationMale": "12501",
"acsRaceAsian": "1412",
"acsRaceBlack": "1533",
"acsRaceHawaiian": "0",
"acsRaceIndian": "172",
"acsRaceOther": "439",
"acsRaceWhite": "21936"
},
"usage": {
"used": 100,
"remaining": 1000
},
"duration": 0.048391699999999996,
"timeStamp": "2017-02-02T15:47:23.9235664-05:00"
}
<Root>
<Service>GeoDemographics</Service>
<Url>https://geodata.cdxtech.com/api/geodemographics?key={your-key}&zipcode=07869&format=xml</Url>
<Status>Success</Status>
<TokenCharge>1</TokenCharge>
<Message />
<TotalResults>1</TotalResults>
<Results>
<ZipCode>07869</ZipCode>
<City>RANDOLPH</City>
<State>NJ</State>
<Population>25291</Population>
<DeliveryBusiness>596</DeliveryBusiness>
<PopulationEstimate>26078</PopulationEstimate>
<DeliveryResidential>9215</DeliveryResidential>
<BusinessAnnualPayroll>284463</BusinessAnnualPayroll>
<DeliveryTotal>11386</DeliveryTotal>
<BusinessFirstQuarterPayroll>63778</BusinessFirstQuarterPayroll>
<AverageHouseValue>504000</AverageHouseValue>
<MedianAge>40.1</MedianAge>
<GrowingCountiesA>0</GrowingCountiesA>
<MedianAgeFemale>40.4</MedianAgeFemale>
<GrowingCountiesB>0</GrowingCountiesB>
<MedianAgeMale>39.9</MedianAgeMale>
<GrowthIncreaseNumber>0</GrowthIncreaseNumber>
<HouseholdsPerZipcode>8917</HouseholdsPerZipcode>
<GrowthIncreasePercentage>0</GrowthIncreasePercentage>
<PersonsPerHousehold>2.83</PersonsPerHousehold>
<GrowthRank>0</GrowthRank>
<IncomePerHousehold>115424</IncomePerHousehold>
<CBSAPopulation>18897109</CBSAPopulation>
<NumberOfBusinesses>703</NumberOfBusinesses>
<CBSADivisionPopulation>2471171</CBSADivisionPopulation>
<NumberOfEmployees>6012</NumberOfEmployees>
<CBSAName>New York-Newark-Jersey City, NY-NJ-PA</CBSAName>
<ACSAgeMedian>47.9</ACSAgeMedian>
<ACSAgeMedianFemale>49.4</ACSAgeMedianFemale>
<ACSAgeMedianMale>46.3</ACSAgeMedianMale>
<ACSHouseholdsTotal>10327</ACSHouseholdsTotal>
<ACSHouseholdIncomeMedian>82346</ACSHouseholdIncomeMedian>
<ACSHouseholdSizeAverage>2.52</ACSHouseholdSizeAverage>
<ACSHousingValueMedian>233600</ACSHousingValueMedian>
<ACSPopulation>26344</ACSPopulation>
<ACSPopulationFemale>13843</ACSPopulationFemale>
<ACSPopulationMale>12501</ACSPopulationMale>
<ACSRaceAsian>1412</ACSRaceAsian>
<ACSRaceBlack>1533</ACSRaceBlack>
<ACSRaceHawaiian>0</ACSRaceHawaiian>
<ACSRaceIndian>172</ACSRaceIndian>
<ACSRaceOther>439</ACSRaceOther>
<ACSRaceWhite>21936</ACSRaceWhite>
</Results>
<Usage>
<Used>100</Used>
<Remaining>1000</Remaining>
</Usage>
<Duration>0.0361345</Duration>
<TimeStamp>2017-02-02T15:47:28.6826037-05:00</TimeStamp>
</Root>