Confirmed cases per day in NY & Kings counties
GET https://covid19.richdataservices.com/rds/api/query/us_ny/ny_doh_tests/tabulate?dims=date_stamp,us_county_fips&where=(date_stamp>=2020-03-01) AND (us_county_fips=36061 OR us_county_fips=36047)&measure=cnt_confirmed_new:SUM(cnt_confirmed_new)&inject=true&metadata=true&orderBy=date_stamp ASC,us_county_fips ASC&totals=true
One benefit of looking at COVID-19 data reported by state agencies is that they often contain more information around testing and case information than national datasets. For this data reported by the New York Department of Health, we will calculate at the number of new tests performed each day in each county. See it in the Tabulation Engine.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
dims | string | Our dimensions here are date_stamp and county_fipe (county code). This will return a record (or cell, if you're viewing in the tab engine) for each county for each day. | |
where | string | We will limit our results to just NY and Kings counties. |
You can find all county codes by sending the following request. Note that you will need to use the codeValue
property and not thename
property when querying. http://covid19.richdataservices.com/rds/api/catalog/us_ny/ny_doh_tests/classification/us_county_fips/codes
|
| measure
| string | | In this time series, we want the count of new cases for each county on an specific date. We will compute the count of new cases as the sum of newly confirmed cases for a county on a specific date (there will only be one value per date so the sum will give us the correct number), we will create a computed variable, cnt_confirmed_new, as the Sum of the cnt_confirmed_new variable in the data product. The sum can only be used because we used the date_stamp as a dimension. |
| inject
| boolean | | By setting inject
to true
, we tell RDS that we want the county's name (ex: "Kings County, NY") instead of its code (ex: "36047") |
| metadata
| boolean | | Including metadata tells RDS that we want all of the variable metadata returned with our query. This is useful when populating a visualization, or just to give more context to the data. |
| orderBy
| string | | We will order date by ascending order, creating a time series, and county by ascending order, sorting them alphabetically. |
| totals
| boolean | | Choose whether or not to include totals for the dimensions |
RESPONSES
status: OK
{"info":{"cached":false,"columnCount":3,"columnOffset":0,"end":"2020-06-18T13:41:34.667Z","includeMetadata":true,"moreColumns":false,"moreRows":false,"notes":[],"postQueryTime":0,"preQueryTime":99,"queryTime":68,"rowCount":214,"rowLimit":214,"rowOffset":0,"start":"2020-06-18T13:41:34.500Z","tableCellCount":214,"totalProcessingTime":167},"records":[["2020-03-02","Kings County, NY",0],["2020-03-02","New York County, NY",0],["2020-03-03","Kings County, NY",2],["2020-03-03","New York County, NY",3],["2020-03-04","Kings County, NY",4],["2020-03-04","New York County, NY",4],["2020-03-05","Kings County, NY",7],["2020-03-05","New York County, NY",18],["2020-03-06","Kings County, NY",12],["2020-03-06","New York County, NY",14],["2020-03-07","Kings County, NY",9],["2020-03-07","New York County, NY",22],["2020-03-08","Kings County, NY",10],["2020-03-08","New York County, NY",24],["2020-03-09","Kings County, NY",31],["2020-03-09","New York County, NY",47],["2020-03-10","Kings County, NY",29],["2020-03-10","New York County, NY",78],["2020-03-11","Kings County, NY",24],["2020-03-11","New York County, NY",70],["2020-03-12","Kings County, NY",59],["2020-03-12","New York County, NY",186],["2020-03-13","Kings County, NY",136],["2020-03-13","New York County, NY",268],["2020-03-14","Kings County, NY",99],["2020-03-14","New York County, NY",193],["2020-03-15","Kings County, NY",166],["2020-03-15","New York County, NY",317],["2020-03-16","Kings County, NY",171],["2020-03-16","New York County, NY",398],["2020-03-17","Kings County, NY",741],["2020-03-17","New York County, NY",598],["2020-03-18","Kings County, NY",795],["2020-03-18","New York County, NY",1074],["2020-03-19","Kings County, NY",1553],["2020-03-19","New York County, NY",1235],["2020-03-20","Kings County, NY",1378],["2020-03-20","New York County, NY",1263],["2020-03-21","Kings County, NY",1941],["2020-03-21","New York County, NY",1370],["2020-03-22","Kings County, NY",1506],["2020-03-22","New York County, NY",1367],["2020-03-23","Kings County, NY",1422],["2020-03-23","New York County, NY",990],["2020-03-24","Kings County, NY",1474],["2020-03-24","New York County, NY",1065],["2020-03-25","Kings County, NY",1550],["2020-03-25","New York County, NY",1232],["2020-03-26","Kings County, NY",1905],["2020-03-26","New York County, NY",1062],["2020-03-27","Kings County, NY",2254],["2020-03-27","New York County, NY",1314],["2020-03-28","Kings County, NY",1790],["2020-03-28","New York County, NY",1160],["2020-03-29","Kings County, NY",1627],["2020-03-29","New York County, NY",788],["2020-03-30","Kings County, NY",3113],["2020-03-30","New York County, NY",1422],["2020-03-31","Kings County, NY",2011],["2020-03-31","New York County, NY",1015],["2020-04-01","Kings County, NY",2041],["2020-04-01","New York County, NY",1002],["2020-04-02","Kings County, NY",2512],["2020-04-02","New York County, NY",1294],["2020-04-03","Kings County, NY",3234],["2020-04-03","New York County, NY",1820],["2020-04-04","Kings County, NY",1990],["2020-04-04","New York County, NY",1278],["2020-04-05","Kings County, NY",2013],["2020-04-05","New York County, NY",1162],["2020-04-06","Kings County, NY",2245],["2020-04-06","New York County, NY",1249],["2020-04-07","Kings County, NY",2607],["2020-04-07","New York County, NY",1257],["2020-04-08","Kings County, NY",2565],["2020-04-08","New York County, NY",1424],["2020-04-09","Kings County, NY",2578],["2020-04-09","New York County, NY",1659],["2020-04-10","Kings County, NY",2887],["2020-04-10","New York County, NY",1685],["2020-04-11","Kings County, NY",2670],["2020-04-11","New York County, NY",1783],["2020-04-12","Kings County, NY",2029],["2020-04-12","New York County, NY",1033],["2020-04-13","Kings County, NY",2055],["2020-04-13","New York County, NY",1206],["2020-04-14","Kings County, NY",5103],["2020-04-14","New York County, NY",4068],["2020-04-15","Kings County, NY",3724],["2020-04-15","New York County, NY",1533],["2020-04-16","Kings County, NY",3347],["2020-04-16","New York County, NY",1476],["2020-04-17","Kings County, NY",3016],["2020-04-17","New York County, NY",1585],["2020-04-18","Kings County, NY",2390],["2020-04-18","New York County, NY",1093],["2020-04-19","Kings County, NY",1835],["2020-04-19","New York County, NY",954],["2020-04-20","Kings County, NY",2300],["2020-04-20","New York County, NY",1099],["2020-04-21","Kings County, NY",2827],["2020-04-21","New York County, NY",1430],["2020-04-22","Kings County, NY",3526],["2020-04-22","New York County, NY",1581],["2020-04-23","Kings County, NY",5030],["2020-04-23","New York County, NY",2654],["2020-04-24","Kings County, NY",4021],["2020-04-24","New York County, NY",2110],["2020-04-25","Kings County, NY",3685],["2020-04-25","New York County, NY",2354],["2020-04-26","Kings County, NY",2684],["2020-04-26","New York County, NY",2007],["2020-04-27","Kings County, NY",2940],["2020-04-27","New York County, NY",1650],["2020-04-28","Kings County, NY",3873],["2020-04-28","New York County, NY",2260],["2020-04-29","Kings County, NY",3944],["2020-04-29","New York County, NY",2299],["2020-04-30","Kings County, NY",3927],["2020-04-30","New York County, NY",2205],["2020-05-01","Kings County, NY",4717],["2020-05-01","New York County, NY",2606],["2020-05-02","Kings County, NY",3804],["2020-05-02","New York County, NY",2214],["2020-05-03","Kings County, NY",2545],["2020-05-03","New York County, NY",1524],["2020-05-04","Kings County, NY",3364],["2020-05-04","New York County, NY",2246],["2020-05-05","Kings County, NY",3597],["2020-05-05","New York County, NY",2499],["2020-05-06","Kings County, NY",5284],["2020-05-06","New York County, NY",2966],["2020-05-07","Kings County, NY",4582],["2020-05-07","New York County, NY",3036],["2020-05-08","Kings County, NY",4747],["2020-05-08","New York County, NY",2633],["2020-05-09","Kings County, NY",3682],["2020-05-09","New York County, NY",2336],["2020-05-10","Kings County, NY",2825],["2020-05-10","New York County, NY",1496],["2020-05-11","Kings County, NY",2984],["2020-05-11","New York County, NY",1984],["2020-05-12","Kings County, NY",4615],["2020-05-12","New York County, NY",2825],["2020-05-13","Kings County, NY",6107],["2020-05-13","New York County, NY",3697],["2020-05-14","Kings County, NY",5741],["2020-05-14","New York County, NY",3933],["2020-05-15","Kings County, NY",5793],["2020-05-15","New York County, NY",3469],["2020-05-16","Kings County, NY",4377],["2020-05-16","New York County, NY",3096],["2020-05-17","Kings County, NY",3052],["2020-05-17","New York County, NY",2019],["2020-05-18","Kings County, NY",4133],["2020-05-18","New York County, NY",2830],["2020-05-19","Kings County, NY",3890],["2020-05-19","New York County, NY",3685],["2020-05-20","Kings County, NY",7252],["2020-05-20","New York County, NY",4219],["2020-05-21","Kings County, NY",5372],["2020-05-21","New York County, NY",4363],["2020-05-22","Kings County, NY",6189],["2020-05-22","New York County, NY",4582],["2020-05-23","Kings County, NY",6813],["2020-05-23","New York County, NY",4187],["2020-05-24","Kings County, NY",4990],["2020-05-24","New York County, NY",3356],["2020-05-25","Kings County, NY",5214],["2020-05-25","New York County, NY",3635],["2020-05-26","Kings County, NY",5940],["2020-05-26","New York County, NY",3599],["2020-05-27","Kings County, NY",10938],["2020-05-27","New York County, NY",6888],["2020-05-28","Kings County, NY",10686],["2020-05-28","New York County, NY",7418],["2020-05-29","Kings County, NY",9619],["2020-05-29","New York County, NY",5678],["2020-05-30","Kings County, NY",7167],["2020-05-30","New York County, NY",4425],["2020-05-31","Kings County, NY",5765],["2020-05-31","New York County, NY",4385],["2020-06-01","Kings County, NY",7500],["2020-06-01","New York County, NY",5161],["2020-06-02","Kings County, NY",7485],["2020-06-02","New York County, NY",4211],["2020-06-03","Kings County, NY",7880],["2020-06-03","New York County, NY",4377],["2020-06-04","Kings County, NY",7659],["2020-06-04","New York County, NY",4416],["2020-06-05","Kings County, NY",9370],["2020-06-05","New York County, NY",5322],["2020-06-06","Kings County, NY",8378],["2020-06-06","New York County, NY",4711],["2020-06-07","Kings County, NY",7254],["2020-06-07","New York County, NY",4045],["2020-06-08","Kings County, NY",5499],["2020-06-08","New York County, NY",3953],["2020-06-09","Kings County, NY",8815],["2020-06-09","New York County, NY",5433],["2020-06-10","Kings County, NY",6515],["2020-06-10","New York County, NY",4991],["2020-06-11","Kings County, NY",8670],["2020-06-11","New York County, NY",5660],["2020-06-12","Kings County, NY",10217],["2020-06-12","New York County, NY",6296],["2020-06-13","Kings County, NY",9012],["2020-06-13","New York County, NY",5525],["2020-06-14","Kings County, NY",8880],["2020-06-14","New York County, NY",6036],["2020-06-15","Kings County, NY",8034],["2020-06-15","New York County, NY",6158],["2020-06-16","Kings County, NY",8472],["2020-06-16","New York County, NY",5830]],"totals":[[null,null,669602],["2020-03-02",null,0],[null,"Kings County, NY",410841],[null,"New York County, NY",258761],["2020-03-03",null,5],["2020-03-04",null,8],["2020-03-05",null,25],["2020-03-06",null,26],["2020-03-07",null,31],["2020-03-08",null,34],["2020-03-09",null,78],["2020-03-10",null,107],["2020-03-11",null,94],["2020-03-12",null,245],["2020-03-13",null,404],["2020-03-14",null,292],["2020-03-15",null,483],["2020-03-16",null,569],["2020-03-17",null,1339],["2020-03-18",null,1869],["2020-03-19",null,2788],["2020-03-20",null,2641],["2020-03-21",null,3311],["2020-03-22",null,2873],["2020-03-23",null,2412],["2020-03-24",null,2539],["2020-03-25",null,2782],["2020-03-26",null,2967],["2020-03-27",null,3568],["2020-03-28",null,2950],["2020-03-29",null,2415],["2020-03-30",null,4535],["2020-03-31",null,3026],["2020-04-01",null,3043],["2020-04-02",null,3806],["2020-04-03",null,5054],["2020-04-04",null,3268],["2020-04-05",null,3175],["2020-04-06",null,3494],["2020-04-07",null,3864],["2020-04-08",null,3989],["2020-04-09",null,4237],["2020-04-10",null,4572],["2020-04-11",null,4453],["2020-04-12",null,3062],["2020-04-13",null,3261],["2020-04-14",null,9171],["2020-04-15",null,5257],["2020-04-16",null,4823],["2020-04-17",null,4601],["2020-04-18",null,3483],["2020-04-19",null,2789],["2020-04-20",null,3399],["2020-04-21",null,4257],["2020-04-22",null,5107],["2020-04-23",null,7684],["2020-04-24",null,6131],["2020-04-25",null,6039],["2020-04-26",null,4691],["2020-04-27",null,4590],["2020-04-28",null,6133],["2020-04-29",null,6243],["2020-04-30",null,6132],["2020-05-01",null,7323],["2020-05-02",null,6018],["2020-05-03",null,4069],["2020-05-04",null,5610],["2020-05-05",null,6096],["2020-05-06",null,8250],["2020-05-07",null,7618],["2020-05-08",null,7380],["2020-05-09",null,6018],["2020-05-10",null,4321],["2020-05-11",null,4968],["2020-05-12",null,7440],["2020-05-13",null,9804],["2020-05-14",null,9674],["2020-05-15",null,9262],["2020-05-16",null,7473],["2020-05-17",null,5071],["2020-05-18",null,6963],["2020-05-19",null,7575],["2020-05-20",null,11471],["2020-05-21",null,9735],["2020-05-22",null,10771],["2020-05-23",null,11000],["2020-05-24",null,8346],["2020-05-25",null,8849],["2020-05-26",null,9539],["2020-05-27",null,17826],["2020-05-28",null,18104],["2020-05-29",null,15297],["2020-05-30",null,11592],["2020-05-31",null,10150],["2020-06-01",null,12661],["2020-06-02",null,11696],["2020-06-03",null,12257],["2020-06-04",null,12075],["2020-06-05",null,14692],["2020-06-06",null,13089],["2020-06-07",null,11299],["2020-06-08",null,9452],["2020-06-09",null,14248],["2020-06-10",null,11506],["2020-06-11",null,14330],["2020-06-12",null,16513],["2020-06-13",null,14537],["2020-06-14",null,14916],["2020-06-15",null,14192],["2020-06-16",null,14302]],"variables":[{"dataType":"DATE","description":"The date the test result was processed by the NYS Electronic Clinical Laboratory Reporting System (ECLRS).","fixedStorageWidth":0,"format":"YYYY-MM-DD (\u003ca href=\"https://en.wikipedia.org/wiki/ISO_8601\" target=\"_blank\"\u003eISO 8601\u003c/a\u003e)","id":"date_stamp","index":1,"isDimension":true,"isMeasure":false,"label":"Datestamp","name":"date_stamp","reference":false,"revisionNumber":0,"storageType":"DATE","uri":"e5f7369b-8cd8-49d6-b540-ebbf4dce095c"},{"classificationUri":"03f13b5e-a808-4d76-bc58-46bcd1787379","dataType":"TEXT","description":"The New York county of residence for the person tested.","fixedStorageWidth":5,"format":"FIPS 6-4 County Code","id":"us_county_fips","index":2,"isDimension":true,"isMeasure":false,"label":"County Code (5-digit)","name":"us_county_fips","reference":false,"revisionNumber":0,"storageType":"VARCHAR","uri":"d5f2fe51-f6e3-4a43-9303-e454b47e6f58"},{"dataType":"NUMERIC","fixedStorageWidth":5,"id":"cnt_tested_new","name":"cnt_tested_new","reference":false,"revisionNumber":0,"storageType":"NUMERIC","uri":"computation.variable.sum"}]}