4

I am trying to fetch zip code, city name and population in a single file from this api, But can't get it right.

Below one gives me population per city, but no zipcode

https://api.census.gov/data/2015/acs5?get=NAME,B01001_001E&for=place

Below one gives population with zipcode, but no city name.

https://api.census.gov/data/2015/acs5?get=NAME,B01001_001E&for=zip+code+tabulation+area

Basically what I want is to combine this two file, but couldn't manage it from the API doc

2 Answers 2

4

First a note. The US Census API provides data on zip code tabulation areas, not zip codes:

ZIP Code Tabulation Areas (ZCTAs) are statistical entities developed by the United States Census Bureau for tabulating summary statistics. [...] ZCTAs are generalized area representations of the United States Postal Service (USPS) ZIP code service areas, but are not the same as ZIP codes. Individual USPS ZIP codes can cross state, place, county, census tract, census block group and census block boundaries, so the Census Bureau asserts that "there is no correlation between ZIP codes and Census Bureau geography".

Source

That said - is there any way to find out which zip code tabulation area belongs to which city? Yes.

You can download the relationship file here: https://www2.census.gov/geo/docs/maps-data/data/rel/zcta_place_rel_10.txt and then map on the response from the API.

An overview of available relationships can be found here: https://www.census.gov/geo/maps-data/data/zcta_rel_overview.html.

1
  • Honestly, you're right, several years ago when I was dealing with zip codes deeply I remember that one facet about them making it extra confusing by having ZCTAs. Upvoting.
    – Taal
    Jan 9, 2019 at 4:15
0

Looking at your question - zip codes and cities can overlap. Generally, in the US at least, zip codes are dictated and practically used by ups/fedex/usps.

I don't know how city borders are defined....and actually they are likely defined in many different ways (ie. a river or something), but I'm nearly positive zip codes and city borders are independent sets with correlational properties, but not identical properties. That's why you're seeing what you see.

Also keep in mind zip codes will change and modulate due to practicality for the post office. As the population density of areas for them to deliver stuff at changes, they will adapt to that, because zip codes have a true, practical, geospatial, purpose - city borders...not so much except for when certain applicable local city or county (which creates more overlap) has "noise level limits at x times" for instance.

1
  • 1
    Zip code tabulation areas are not the same as zip codes. Jan 8, 2019 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.