Getting Started
To use CitySDK include the script in your page’s head. Download citysdk.js here.
<script src="./citysdk.js"></script>
Alternatively you can install CitySDK via NPM, and then import it
npm install citysdk
import census from "citysdk"
If you would like to just run small queries, you can use the try it out app
To call CitySDK you need to use census function, with the first argument being the object query, and second a callback function with the return error and response (result).
census(
{
vintage: "2017",
geoHierarchy: {
tract: {
lat: 41.878787,
lng: -87.63588
}
}
},
function(error, response) {
console.log(response);
//result
// {
// "vintage": "2017",
// "geoHierarchy": {
// "state": "17",
// "county": "031",
// "tract": "839100"
// }
// }
}
);