{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"d5fb8837-e3f6-4146-9067-a8e358b16fc1","name":"CovidCountyData","description":"\n# Rest API\n\nThe REST API does not require any software to be installed on your computer, it allows you to\ninteract with our data through standard web protocols.\n\nOur API is build using [PostgREST](http://postgrest.org/en/v7.0.0/). For more information on the\ndifferent features of this API, please see their [documentation](http://postgrest.org/en/v7.0.0/api.html).\n\n## API Key\n\nOur data is free and open for anyone to use (and always will be). Our team agreed that this was central to our mission when we agreed to begin this project. However, we do find it useful to have information about our users and to see how they use the data for two reasons:\n\n1. It helps us focus and improve the datasets that are seeing the most use.\n2. The number of users, as measured by active API keys, is one metric that we use to show that the\nproject is useful when we are discussing additional grant funding.\n\nWe are grateful to everyone who is willing to register for and use their API key when interacting\nwith our data.\n\nTo register for an API key, see the registration form [on our home page](https://covidcountydata.org#register).\n\nAfter obtaining an API key, please attach it as either the `apikey` header or query parameter in future requests\n\nFor example, if my API key were `abc123` and I was getting data from `https://api.covidcountydata.org/covid_us?fips=eq.6`, I\nwould adjust the url to be `https://api.covidcountydata.org/covid_us?fips=eq.6&apikey=abc123`\n\n\n## Request structure\n\nIn order to be able to request data, you will need to know which endpoint the data comes from and,\noptionally, which filters you would like to apply to the data before it's delivered:\n\n\n**API Endpoints**\n\nThe data in our database is broken into tables of related information with a separate endpoint for\neach table. For example, all of the U.S. COVID-19 related data is stored in the `covid_us` table\nand it has a corresponding endpoint of `https://api.covid.valorum.ai/covid_us`. For a complete\nlist of the available endpoints, see the interactive playground near the bottom of the page.\n\n\n**Filters**\n\nThere are a two types of parameters that can be included as filters:\n\n* _Data parameters_: Data parameters are used to select subsets of the data by performing some\n  type of comparison between the parameter argument and the data.\n* _Keyword parameters_: Keyword parameters interact with how the data is returned. For example,\n  `select` can modify which columns are returned, `order` changes how the data is ordered when it\n  is returned, and `limit` changes the number of observations returned.\n\nThe data parameters that you are able to apply will depend on what columns are available in a\nparticular dataset. Many of the tables will have the columns `dt` (date of the obervation),\n`location` (a geographical identifier, for the U.S. this is often the fips code), `variable` (name\nof the variable being observed), and `value` (the value of the variable in that location at that\ntime).\n\nFor example, if you wanted to request 5 observations of the `tests_total` variable from after\nAugust 1, 2020 then you would use the following query:\n\n`https://api.covid.valorum.ai/covid_us?dt=gt.2020-08-01&variable=eq.tests_total&limit=5`\n\nOf course, rather than input this address into your browser, you could query the API for this\ninformation using a more generic tool such as `curl` or `javascript`.\n\nWe make two additional observations:\n\n1. Rather than use `>`, `<`, `=`, etc..., the REST API expects you to use `gt.`, `lt.`, `eq.`,\n   etc... For a complete list of comparisons, see [PostgREST documentation](http://postgrest.org/en/v7.0.0/api.html#operators)\n2. Much of the data is stored in _long form_ rather than _wide form_. In long form each data\n  observation, or value, is associated with its unique identifiers. For example, in many of our\n  datasets the identifiers are `dt`, `location`, and `variable`, and the value of the observation\n  is stored in `value`. This can be seen in the example section below.\n\n\n### Examples\n\nWe will do some examples to illustrate these points using the example table below. We will demonstrate\nthe example api requests using the `covid_us` endpoint (at https://api.covidcountydata.org/covid_us),\nbut the same concepts apply to all endpoints. Note that we will add `limit=20` to most of the requests\nbelow to prevent unnecessary data transfer, but removing this query parameter will allow you to fetch the\nwhole dataset. Finally, note also that we'll use the same `apikey=abc123` argument as shown in the\nexample above, but the `abc123` should be replaced by your API key.\n\nBelow is an example table showing the structure of the data returned by the `covid_us` endpoint:\n\n\n| dt         | fips | variable             | value  |\n| ---------- | ---- | -------------------- | ------ |\n| 2020-06-01 | 6    | deaths_total         | 4251   |\n| 2020-06-01 | 12   | deaths_total         | 2543   |\n| 2020-06-01 | 48   | deaths_total         | 1678   |\n| 2020-06-02 | 6    | deaths_total         | 4286   |\n| 2020-06-02 | 12   | deaths_total         | 2613   |\n| 2020-06-02 | 48   | deaths_total         | 1698   |\n| 2020-06-01 | 6    | positive_tests_total | 113006 |\n| 2020-06-01 | 12   | positive_tests_total | 56830  |\n| 2020-06-01 | 48   | positive_tests_total | 64880  |\n| 2020-06-02 | 6    | positive_tests_total | 115310 |\n| 2020-06-02 | 12   | positive_tests_total | 57447  |\n| 2020-06-02 | 48   | positive_tests_total | 66568  |\n\n\n### Only data from CA\n\nIn order to select data from only California (fips code 06) we filter the parameter `location` to\nonly be 6\n\n`https://api.covid.valorum.ai/covid_us?fips=eq.06&limit=20&apikey=abc123`\n\n\n### Only observations with more than 100,000 tests\n\nIn order to only select observations with more than 100,000 tests, we would want to use the following parameters\n\n`https://api.covid.valorum.ai/covid_us?variable=eq.positive_tests_total&value=gt.100000&limit=20&apikey=abc123`\n\n\n### Only observations after June 1, 2020\n\nIn order to only select the data from after June 1, 2020, we would use the following parameter\n\n`https://api.covid.valorum.ai/covid_us?dt=gt.2020-06-01&limit=20&apikey=abc123`\n\n\n### Select total deaths for Texas ordered by date\n\nIn order to select only the total deaths variable for Texas and have the results be ordered by date, we would use the following parameters\n\n`https://api.covid.valorum.ai/covid_us?location=eq.48&variable=eq.positive_tests_total&order=dt&limit=20&apikey=abc123`\n\n\n## Software\n\nWe use the following open source technologies to build this API.\n\n* The data is hosted in a [PostgreSQL database](https://www.postgresql.org/)\n* The API is built using [PostgREST](http://postgrest.org/en/v7.0.0/)\n* The documentation is generated using [RapiDoc](https://mrin9.github.io/RapiDoc/).\n\nWe are grateful to all of these projects for simplifying the task of building, deploying, and\ndocumenting our API. We are also grateful to Google Cloud for helping us host and distribute our\ndata.\n\n\n## API Endpoints\n\n","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":true,"owner":"10122604","collectionId":"d5fb8837-e3f6-4146-9067-a8e358b16fc1","publishedId":"TVCe29D4","public":true,"publicUrl":"https://documenter-api.postman.tech/view/10122604/TVCe29D4","privateUrl":"https://go.postman.co/documentation/10122604-d5fb8837-e3f6-4146-9067-a8e358b16fc1","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2020-09-01T12:45:00.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/768118b36f06c94b0306958b980558e6915839447e859fe16906e29d683976f0","favicon":""},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/TVCe29D4"}