-
Notifications
You must be signed in to change notification settings - Fork 2
data_adapter API
This function will break your formula to parts. If formula = "P0120018+P0120019", then parser to [P0120018, P0120019]. LOOP [part1, part2....partn] to get_api_data(self, part, geo_record) return val
This function will build the API calls such as url, api_key, params Example such as url = http://api.census.gov/data/2010/sf1? params = {'key':your API key, 'get':table, 'for':'county+subdivision:003', 'in':'state:02+county:29'} call get(self, url, params={}) return val
make this call http://api.census.gov/data/2010/sf1?get=P0010001&for=county+subdivision:003&in=state:02+county:29 return val
About the Quick Stats API http://quickstats.nass.usda.gov/api
The QuickStats API has three resources, but we only used one. GET /api/api_GET: accepts a combination of "WHAT" and/or "WHERE and/or "WHEN" parameters and return maximum of 50K records http://quickstats.nass.usda.gov/api/api_GET/?key=api key&{parameter ... parameter}&format={json | csv | xml}&callback={function name}
- Note: callback parameter needs only for using JSONP
- Example: http://quickstats.nass.usda.gov/api/api_GET/?key=api_key&source_desc=CENSUS§or_desc=DEMOGRAPHICS&group_desc=OPERATORS&commodity_desc=OPERATORS&statisticcat_desc=OPERATORS&short_desc=OPERATORS,%20(ALL)%20-%20NUMBER%20OF%20OPERATORS&domain_desc=TOTAL&agg_level_desc=STATE&state_fips_code=44&year=2012&freq_desc=ANNUAL&reference_period_desc=YEAR
- Note: agg_level_desc=STATE&state_fips_code=44&year=2012 can be find from shape file, other will comes from formula. Your formula may looks like: {"source_desc":"CENSUS", "sector_desc":"DEMOGRAPHICS", "group_desc":"OPERATORS", "commodity_desc":"OPERATORS", "statisticcat_desc":"OPERATORS", "short_desc":"OPERATORS, (ALL) - NUMBER OF OPERATORS", "domain_desc":"TOTAL", "agg_level_desc":"STATE", "state_fips_code":"44", "year":"2012", "freq_desc":"ANNUAL", "reference_period_desc":"YEAR"}
- PS. If you have "&" symbol, please use %26
About the Bureau of Labor Statistics API http://www.bls.gov/developers/
The BLS Public Data API is currently available in two versions. We only use V2 to access data. Seriesid will be used as formula.
HTTP Type: POST URL: http://api.bls.gov/publicAPI/v2/timeseries/data/ Payload: JSON Payload: {"seriesid":["Series1",..., "SeriesN"], "startyear":"yearX", "endyear":"yearY", "catalog":true|false, "calculations":true|false, "annualaverage":true|false, "registrationKey":"995f4e779f204473aa565256e8afe73e" } Example Payload: {"seriesid":["LAUCN040010000000005", "LAUCN040010000000006"], "startyear":"2010", "endyear":"2012", "catalog":false, "calculaltions":true, "annualaverage":true, "registrationKey":"995f4e779f204473aa565256e8afe73e" }
Daily query limit for BLS are 500