Skip to main content

Use curl and python to grab the U.S. (United States) population from the Census Bureau's data API service in JSON format.

curl --silent 'http://api.census.gov/data/2016/pep/population?get=POP,GEONAME&for=us:*' \
    | python -c 'import json,sys;obj=json.load(sys.stdin);print obj[1][0]'