1

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

1

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.

  • 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 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
    Zip code tabulation areas are not the same as zip codes. – user3471881 Jan 8 at 14:04

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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