UNPKG

19.7 kBJSONView Raw
1{"openapi":"3.0.0","info":{"description":"The Socrata OpenDataNetwork (ODN) REST API exposes public data, often continuosly updated and enhanced, from many thousands of public\ngovernment and non profit agencies.\n\nMuch of this data originating from independent sources is fused together to create new, and often\npowerful, entity level data. The API, in addition to search and autosuggest capabilities for finding datasets,\nenables data based comparisons across geographical regions such as states, counties, metropolitan areas,\ncities and zip codes using highly vetted data providers such as US Census, BEA, HUD and others. Comparison data\nis preformatted for easy and efficient display on a chart, graph or interactive map.\n\nThe API also exposes data organized by narrative style questions a human might ask. The questions can\nbe rapidly found using an autosuggest style index, and then used to directly access all data needed to\nthoroughly and authoritatively answer the question. Retrieved data includes time series (temporally aligned),\ntabular, map heavy (includes spatial boundaries), and auto generated unstructured descriptive text.\n\nThe ODN API does not duplicate API endpoints or services provided by public sector agencies, but rather,\nreturns context relevant pre-populated REST URLs, when appropriate, so the caller can access data\ndirectly from the source.\n\nThe [open source](http://github.com/socrata/odn-backend) API powers [OpenDataNetwork.com](http://OpenDataNetwork.com), an [open source](http://github.com/socrata/opendatanetwork.com)\nsite; the site highlights myriad uses and provides API badges with contextually relevant API example\nREST endpoints and documentation pointers.\n\nFinally, we continuously add new dat sources which appear automatically in the API, so if your favorite data\nsource is not available, check back soon. You can also join us [HERE](http://www.opendatanetwork.com/join-open-data-network)\nand receive updates or let us know which data sources you are most interested in.\n\n## App Tokens\n\nRegistering for and including a [Socrata application token](https://dev.socrata.com/docs/app-tokens.html)\nis _required_ for the ODN API. They can be passed either using the `app_token` parameter\nor the `X-App-Token` HTTP header.","title":"ODN","version":"1.0.0","x-apisguru-categories":["open_data"],"x-origin":[{"converter":{"url":"https://github.com/lucybot/api-spec-converter","version":"2.7.18"},"format":"apiBlueprint","url":"https://raw.githubusercontent.com/socrata/odn-backend/master/opendatanetwork-apiary.apib","version":"1A"}],"x-providerName":"opendatanetwork.com"},"tags":[],"paths":{"/data/v1/availability/":{"get":{"description":"","parameters":[{"description":"Comma separated list of entity IDs.","in":"query","name":"entity_id","required":true,"example":"0100000US,0400000US53","schema":{"type":"string"}},{"description":"The [Socrata App Token](https://dev.socrata.com/docs/app-tokens.html) to be\nused with your request. The `app_token` parameter is required if an app token is not passed via the `X-App-Token` HTTP header. Clients must [register for their own app tokens](https://dev.socrata.com/docs/app-tokens.html).","in":"query","name":"app_token","required":false,"example":"cQovpGcdUT1CSzgYk0KPYdAI0","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{},"content":{"application/json":{"examples":{"response":{"value":{"topics":{"demographics":{"datasets":{"population":{"constraints":["year"],"description":"","domain":"odn.data.socrata.com","fxf":"9jg8-ki9x","id":"demographics.population","name":"Population","searchTerms":["population","household","demographics","ethnicity","minority"],"sources":[{"name":"U.S. Census American Community Survey","url":"https://www.census.gov/programs-surveys/acs/"}],"url":"https://odn.data.socrata.com/resource/9jg8-ki9x.json","variables":{"change":{"description":"Percent change from the previous year","id":"demographics.population.change","name":"Population Change"},"count":{"id":"demographics.population.count","name":"Population Count"}}}},"id":"demographics","name":"Demographics"}}}}}}}}},"summary":"Find all available data for some entities","tags":[]}},"/data/v1/constraint/{variable}":{"get":{"description":"","parameters":[{"description":"Full ID of the variable to retrieve.","in":"path","name":"variable","required":true,"example":"demographics.population.count","schema":{"type":"string"}},{"description":"Comma separated list of entity IDs.","in":"query","name":"entity_id","required":true,"example":"0100000US,0400000US53","schema":{"type":"string"}},{"description":"Constraint to use.","in":"query","name":"constraint","required":true,"example":"year","schema":{"type":"string"}},{"description":"The [Socrata App Token](https://dev.socrata.com/docs/app-tokens.html) to be\nused with your request. The `app_token` parameter is required if an app token is not passed via the `X-App-Token` HTTP header. Clients must [register for their own app tokens](https://dev.socrata.com/docs/app-tokens.html).","in":"query","name":"app_token","required":false,"example":"cQovpGcdUT1CSzgYk0KPYdAI0","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{},"content":{"application/json":{"examples":{"response":{"value":{"permutations":[{"constraint_value":"2009"},{"constraint_value":"2010"},{"constraint_value":"2011"},{"constraint_value":"2012"},{"constraint_value":"2013"}]}}}}}}},"summary":"Get constraint permutations for entities","tags":[]}},"/data/v1/map/new":{"get":{"description":"","parameters":[{"description":"A single variable ID.","in":"query","name":"variable","required":true,"example":"demographics.population.count","schema":{"type":"string"}},{"description":"A comma separated list of entity IDs.\nEntities must have the same type and represent geographical regions.","in":"query","name":"entity_id","required":true,"example":"0400000US53,0400000US08","schema":{"type":"string"}},{"description":"Values must be specified for each constraint in the dataset.\nFor example, to generate map data for `demographics.population.count`,\nyou must specify a value for `year` by passing `year=2013`.","in":"query","name":"constraint","required":false,"schema":{"type":"string"}},{"description":"The [Socrata App Token](https://dev.socrata.com/docs/app-tokens.html) to be\nused with your request. The `app_token` parameter is required if an app token is not passed via the `X-App-Token` HTTP header. Clients must [register for their own app tokens](https://dev.socrata.com/docs/app-tokens.html).","in":"query","name":"app_token","required":false,"example":"cQovpGcdUT1CSzgYk0KPYdAI0","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{},"content":{"application/json":{"examples":{"response":{"value":{"bounds":[[40.712,-74.227],[40.774,-74.125]],"session_id":"rhzpyxdvq56cc9cbg3ssb57b9","summary_statistics":{"names":["minimum","average","maximum"],"values":[570134,6061914.615384615,37659181],"values_formatted":["570,134","6,061,914","37,659,181"]}}}}}}}},"summary":"Create a map","tags":[]}},"/data/v1/values":{"get":{"description":"","parameters":[{"description":"Comma separated list of variable IDs.\nDefaults to retrieving all variables.\nIt is also possible to pass in a topic such as\n`demographics`, or a dataset such as `demographics.population`,\nwhich would both be equivalent to specifying\n`demographics.population.count` and `demographics.population.change`.\nNote that only variables in the same dataset are allowed.","in":"query","name":"variable","required":true,"example":"demographics.population.count","schema":{"type":"string"}},{"description":"Comma separated list of entity IDs.\nDefaults to retrieving all entities.\nNote that since there is currently no results pagination,\nretrieving values for all entities may produce incomplete results.","in":"query","name":"entity_id","required":false,"example":"0100000US,0400000US53","schema":{"type":"string"}},{"description":"Number of steps to forecast.\nMust be an integer between 0 and 20.\nForecasts are produced using linear extrapolation\non the data. They are only available when retrieving\ndata for a single variable across many numerical\nconstraint options.\n\n+ Default `0`","in":"query","name":"forecast","required":false,"example":"3","schema":{"type":"number"}},{"description":"Whether or not to produce a description of the data.\nSet to `true` to produce a description.\nDescriptions are not available if no entities are specified.\n\n+ Default `false`","in":"query","name":"describe","required":false,"example":"false","schema":{"type":"boolean"}},{"description":"If format is set to `google`, the data frame will be formatted\nas a [Google Visualizations data table](https://developers.google.com/chart/interactive/docs/reference#datatable-class).\nIf the format is not provided or invalid, then the frame\nwill be formatted normally.","in":"query","name":"format","required":false,"schema":{"type":"string","enum":["google"]}},{"description":"The [Socrata App Token](https://dev.socrata.com/docs/app-tokens.html) to be\nused with your request. The `app_token` parameter is required if an app token is not passed via the `X-App-Token` HTTP header. Clients must [register for their own app tokens](https://dev.socrata.com/docs/app-tokens.html).","in":"query","name":"app_token","required":false,"example":"cQovpGcdUT1CSzgYk0KPYdAI0","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{},"content":{"application/json":{"examples":{"response":{"value":{"data":[["year","0100000US","forecast","0400000US53","forecast"],[2009,301461533,false,6465755,false],[2010,303965272,false,6561297,false],[2011,306603772,false,6652845,false],[2012,309138711,false,6738714,false],[2013,311536594,false,6819579,false],[2014,314055359.25,true,6908035,true],[2015,316574124.5,true,6996491,true],[2016,319092889.75,true,7084947,true]],"forecast_info":{"algorithm_name":"linear","algorithm_url":"https://en.wikipedia.org/wiki/Extrapolation#Linear_extrapolation"}}}}}}}},"summary":"Get values for variables","tags":[]}},"/entity/v1":{"get":{"description":"","parameters":[{"description":"ID of the entity.","in":"query","name":"entity_id","required":false,"example":"0400000US53","schema":{"type":"string"}},{"description":"Name of the entity.","in":"query","name":"entity_name","required":false,"example":"washington","schema":{"type":"string"}},{"description":"Type of the entity.","in":"query","name":"entity_type","required":false,"example":"region.state","schema":{"type":"string"}},{"description":"The [Socrata App Token](https://dev.socrata.com/docs/app-tokens.html) to be\nused with your request. The `app_token` parameter is required if an app token is not passed via the `X-App-Token` HTTP header. Clients must [register for their own app tokens](https://dev.socrata.com/docs/app-tokens.html).","in":"query","name":"app_token","required":false,"example":"cQovpGcdUT1CSzgYk0KPYdAI0","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{},"content":{"application/json":{"examples":{"response":{"value":{"entities":[{"id":"0400000US53","name":"Washington","type":"region.state"}]}}}}}}},"summary":"Get Entities","tags":[]}},"/entity/v1/{relation}":{"get":{"description":"","parameters":[{"description":"The type of relation to find.","in":"path","name":"relation","required":true,"example":"parent","schema":{"type":"string","enum":["parent","child","sibling","peer"]}},{"description":"ID of the target entity.","in":"query","name":"entity_id","required":true,"example":"0400000US53","schema":{"type":"string"}},{"description":"If this parameter is included, only entities with data for the given\nvariable will be returned. Note that this may cause the number of\nentities returned to be less than the specified `limit`.","in":"query","name":"variable_id","required":false,"example":"demographics.population.seattle","schema":{"type":"string"}},{"description":"Maximum number of entities in each group.\nMust be an integer from 1 to 1000.","in":"query","name":"limit","required":false,"schema":{"type":"number","default":10}},{"description":"The [Socrata App Token](https://dev.socrata.com/docs/app-tokens.html) to be\nused with your request. The `app_token` parameter is required if an app token is not passed via the `X-App-Token` HTTP header. Clients must [register for their own app tokens](https://dev.socrata.com/docs/app-tokens.html).","in":"query","name":"app_token","required":false,"example":"cQovpGcdUT1CSzgYk0KPYdAI0","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{},"content":{"application/json":{"examples":{"response":{"value":{"relatives":[{"entities":[{"id":"0300000US9","name":"Pacific Division","type":"region.division"}],"type":"region.division"}]}}}}}}},"summary":"Find the relatives of an entity","tags":[]}},"/search/v1/dataset":{"get":{"description":"","parameters":[{"description":"Entities to use in formulating the query.","in":"query","name":"entity_id","required":false,"example":"0100000US","schema":{"type":"string"}},{"description":"If included, the search terms of the dataset\nwill be used in the query.","in":"query","name":"dataset_id","required":false,"example":"demographics.population","schema":{"type":"string"}},{"description":"Maximum number of results to return.\nMust be an integer from 0 to 50000.","in":"query","name":"limit","required":false,"schema":{"type":"number","default":10}},{"description":"Number of results to skip.\nUsed for pagination.","in":"query","name":"offset","required":false,"schema":{"type":"number"}},{"description":"The [Socrata App Token](https://dev.socrata.com/docs/app-tokens.html) to be\nused with your request. The `app_token` parameter is required if an app token is not passed via the `X-App-Token` HTTP header. Clients must [register for their own app tokens](https://dev.socrata.com/docs/app-tokens.html).","in":"query","name":"app_token","required":false,"example":"cQovpGcdUT1CSzgYk0KPYdAI0","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{},"content":{"application/json":{"examples":{"response":{"value":{"datasets":[{"attribution":"The Big Cities Health Coalition","categories":["education","health"],"created_at":"2015-09-01T19:23:15.000Z","dataset_url":"https://bchi.bigcitieshealth.org/d/rwyf-6cby","description":"This dataset illustrates health status of 26 of the nation’s largest and most urban cities as captured by 34 health (and six demographics-related) indicators. These indicators represent some of the leading causes of morbidity and mortality in the United States and leading priorities of national, state, and local health agencies. Public health data were captured in nine overarching categories: HIV/AIDS, cancer, nutrition/physical activity/obesity, food safety, infectious disease, maternal and child health, tobacco, injury/violence, and behavioral health/substance abuse.","dev_docs_url":"https://dev.socrata.com/foundry/bchi.bigcitieshealth.org/ffnx-yiyc","domain":"bchi.bigcitieshealth.org","domain_url":"http://bchi.bigcitieshealth.org","name":"Big Cities Health Data Inventory","updated_at":"2016-06-27T19:10:04.000Z"},{"attribution":"Public Health - Seattle & King County","categories":["health"],"created_at":"2014-03-06T23:17:51.000Z","dataset_url":"https://data.kingcounty.gov/d/ajpg-dges","description":"Health reporting area (HRA) and zip code-level indicators for monitoring the impact of the Affordable Care Act in King County, WA. Topic areas range from access to care to population health. Imported to Socrata to allow data to be pulled as JSON from SODA to feed into Leaflet.js-based maps on an external site.","dev_docs_url":"https://dev.socrata.com/foundry/data.kingcounty.gov/t34p-gkbv","domain":"data.kingcounty.gov","domain_url":"http://data.kingcounty.gov","name":"King County Health Reform Indicators","updated_at":"2014-12-17T00:09:12.000Z"}]}}}}}}},"summary":"Get datasets","tags":[]}},"/search/v1/question":{"get":{"description":"","parameters":[{"description":"String to search against.","in":"query","name":"query","required":true,"example":"seattle","schema":{"type":"string"}},{"description":"Maximum number of results to return.\nMust be an integer from 0 to 50000.","in":"query","name":"limit","required":false,"schema":{"type":"number","default":10}},{"description":"Number of results to skip.\nUsed for pagination.","in":"query","name":"offset","required":false,"schema":{"type":"number"}},{"description":"The [Socrata App Token](https://dev.socrata.com/docs/app-tokens.html) to be\nused with your request. The `app_token` parameter is required if an app token is not passed via the `X-App-Token` HTTP header. Clients must [register for their own app tokens](https://dev.socrata.com/docs/app-tokens.html).","in":"query","name":"app_token","required":false,"example":"cQovpGcdUT1CSzgYk0KPYdAI0","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{},"content":{"application/json":{"examples":{"response":{"value":{"questions":[{"entity":{"id":"310M200US42660","name":"Seattle Metro Area (WA)"},"metric":"population","text":"What is the population count of Seattle Metro Area (WA)?","variable_name":"population count","vector":"population"},{"entity":{"id":"310M200US42660","name":"Seattle Metro Area (WA)"},"metric":"business_and_finance","text":"What is the business and finance employment rate of Seattle Metro Area (WA)?","variable_name":"business and finance employment rate","vector":"occupations"}]}}}}}}},"summary":"Get questions","tags":[]}},"/suggest/v1/{type}":{"get":{"description":"","parameters":[{"description":"Type of the object to find.","in":"path","name":"type","required":true,"example":"entity","schema":{"type":"string","enum":["entity","category","publisher","dataset","question"]}},{"description":"Query to match.","in":"query","name":"query","required":true,"example":"seattl","schema":{"type":"string"}},{"description":"Maximum number of results to return.\nMust be an integer from 0 to 100.","in":"query","name":"limit","required":false,"schema":{"type":"number","default":5}},{"description":"This parameter is only available when suggesting entities with `type=entity`.\nIf it is provided, suggestions will be filtered to include\nonly entities that have data for the given variable.\n\nIf the variable provided is invalid, no entities will be returned.\n\nNote that this filtering will increase response time significantly,\nso it should only be used when necessary.","in":"query","name":"variable_id","required":false,"example":"demographics.population.count","schema":{"type":"string"}},{"description":"The [Socrata App Token](https://dev.socrata.com/docs/app-tokens.html) to be\nused with your request. The `app_token` parameter is required if an app token is not passed via the `X-App-Token` HTTP header. Clients must [register for their own app tokens](https://dev.socrata.com/docs/app-tokens.html).","in":"query","name":"app_token","required":false,"example":"cQovpGcdUT1CSzgYk0KPYdAI0","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{},"content":{"application/json":{"examples":{"response":{"value":{"options":[{"id":"310M200US42660","name":"Seattle Metro Area (WA)","type":"regions.msa"},{"id":"1600000US5363000","name":"Seattle, WA","type":"regions.place"}]}}}}}}},"summary":"Get suggestions","tags":[]}}},"servers":[{"url":"http://api.opendatanetwork.com/"}],"components":{"schemas":{"Data_Availability":{},"Data_Constraints":{},"Data_Values":{},"Entity_Lookup":{},"Entity_Relationships":{},"Map_Creation":{},"Search_Datasets":{},"Search_Questions":{},"Suggestions":{}}}}
\No newline at end of file