Visualize positive and total COVID-19 tests per state

GET https://covid19.richdataservices.com/rds/api/query/us/covidtracking_state/select?where=(us_state_postal=NY OR us_state_postal=CA OR us_state_postal=TX) AND (date_stamp=2020-06-17)&cols=us_state_postal,cnt_tested_pos,cnt_tested&format=amcharts

The COVID Tracking Project API pulls data from different state and national sources. Here, we are comparing the total number of positive COVID-19 tests to the total number of total COVID-19 tests performed. The visualization below is available in the Visualize tab if you're running the collection in the Qodex app. We have also provided an example response in the default MTNA Simple Dataset format, if you are interested in using the data for other purposes.

barChart

Request Params

KeyDatatypeRequiredDescription
wherestringWe can input any U.S. states we want to compare using the us_state_postal code, and will limit the results to one day in time using the date_stamp variable.

We can see the codes for the us_state_postal classification by sending the following request. Note that you will need to use the code's codeValue property and not thename property when querying. http://covid19.richdataservices.com/rds/api/catalog/us/covidtracking_state/classification/us_state_postal/codes | | cols | string | | We are interested in the total number of tests (cnt_tested) and total number of positive tests (cnt_tested_pos) for each state (us_state_postal). | | format | string | | Our desired charting library, used to create the visualization you see in the visualization tab. |

RESPONSES

status: OK

{"info":{"cached":false,"columnCount":3,"columnOffset":0,"end":"2020-06-18T20:16:29.305Z","includeMetadata":true,"moreColumns":false,"moreRows":false,"notes":[],"postQueryTime":0,"preQueryTime":239,"queryTime":48,"rowLimit":20,"rowOffset":0,"start":"2020-06-18T20:16:29.018Z","totalProcessingTime":287},"records":[["CA",157015,2997988],["NY",385142,3111119],["TX",96335,1369638]],"totals":[],"variables":[{"classificationUri":"2baf96af-3b02-4339-904c-6410daa7530f","dataType":"TEXT","description":"The \u003ca href=\"https://en.wikipedia.org/wiki/List_of_U.S._state_abbreviations\"  target=\"_blank\"\u003eU.S. State 2-letter postal code\u003c/a\u003e of the state this record represents.","fixedStorageWidth":2,"format":"","id":"us_state_postal","index":4,"isDimension":true,"isMeasure":false,"label":"U.S. State Postal Code","name":"us_state_postal","reference":false,"revisionNumber":0,"storageType":"VARCHAR","uri":"066c95d9-f5a3-4d56-8e4b-42c0f4b1e050"},{"dataType":"NUMERIC","decimals":0,"description":"Total cumulative positive test results for this state leading up to and including this date.","fixedStorageWidth":32,"format":"","id":"cnt_tested_pos","index":6,"isMeasure":true,"label":"Tested Positive Count","name":"cnt_tested_pos","reference":false,"revisionNumber":0,"storageType":"INT","uri":"a8f1bf07-6962-419c-b0f7-ab200f19258d"},{"dataType":"NUMERIC","decimals":0,"description":"Calculated value (cnt_tested_pos + cnt_tested_neg) of total test results.","fixedStorageWidth":32,"format":"","id":"cnt_tested","index":21,"isMeasure":true,"label":"Tested Count","name":"cnt_tested","reference":false,"revisionNumber":0,"storageType":"INT","uri":"ed9ed73f-6625-48b7-a0ba-10517ce60370"}]}