Skip to main content

This site provides documentation, examples, and guides focused on using the Census Data API in frontend and backend Javascript applications by unitizing CitySDK, which streamlines, and enhances the usability and access to the data.

Browser Quick start

You can download citysdk.js here or build it using browserify.

<script src="./citysdk.js"></script>
<script>
//Web developers in the US 2017
census(
  {
  vintage: '2017',
  geoHierarchy: {
    us: '*',
  },
  sourcePath: ['acs','acs5',],
  values: ['B24121_065E'],
  }
  (err, res) => console.log(res) // [{"B24121_065E": 62792,"us": "1"}]
)
</script>

Node.js quick start

npm install citysdk

const census = require("citysdk")

//get the ACS5 2017 population for all counties in the California
census(
  {
    vintage: '2017',
    geoHierarchy: {
      state: "06",
      county: '*',
    },
    sourcePath: ['acs','acs5'],
    values: ['B00001_001E'],
  },
  (err, res) => console.log(res) // [{"B00001_001E": 889,"state": "06","county": "049"}, ...
)

Sections

Interactive Example

Try it section

Documentation

The documentation section contains quick API reference, section to try out CitySDK, and frequency asked questions.

For the main Census API Docs click here.

Guides

The guides section contains quick start guides to start developing using CitySDK.

Examples

The examples section contains examples built with CitySDK and various other javascript libraries.

Few examples:

Community

The community section contains links to community resources such as contacts and help channels, other community libraries, and showcases to applications and tools built with the Census Data API.