Agency Totals
The following API endpoints are pulling data from the LA Times Agency Totals dataset. You can find and download the original data from github.com/datadesk/california-coronavirus-data/blob/master/latimes-agency-totals.csv
An agency is the name of the county or city public health agency that provided the data.
GETapi/covid19/latimes/agency-totals
Full URL: https://api.joeczubiak.com/api/covid19/latimes/agency-totals
Parameters
agency optional
string
Filters the results to the agency provided. An agency is the name of the county or city public health agency that provided the data.
county optional
string
Filters the results to the county provided.
fips optional
string
Filters the results to the fips provided. (The FIPS code is a code given to the county by the federal government.)
date optional
string
Filters the results to a specific date. Format yyyy-mm-dd. Example "2020-04-09"
confirmed_cases optional
integer
Filters the data to only those with confirmed_cases equaling the number provided.
did_not_update optional
boolean
Filters the data to only those that did not update. Set to 1, for true, to filter. 0, for false will not filter the results and will provide all results including those that did not update. Accepts 1 or 0 only.
page optional
integer
Default: 1
Set to the pagination page number you wish to receive.
per_page optional
integer
Default: 100
The number of results to be returned from the request.
order optional
string
Default: asc
Specifies the order to sort the results. Accepts "asc" or "desc."
order_by optional
string
Default: date
Orders the content by a particular field. Specify the field.
Results
The following is a sample response in the format you will receive from making a request.
{
"data": [
{
"agency": "Alameda",
"county": "Alameda",
"fips": "001",
"date": "2020-04-06",
"confirmed_cases": 557,
"deaths": 13,
"did_not_update": ""
},
...
],
"status": "200",
"links": {
"first": "https://api.joeczubiak.com/api/covid19/latimes/agency-totals?page=1",
"last": "https://api.joeczubiak.com/api/covid19/latimes/agency-totals?page=18",
"prev": null,
"next": "https://api.joeczubiak.com/api/covid19/latimes/agency-totals?page=2"
},
"attribution": {
"required": true,
"message": "You must provide attribution when using this data.",
"sample_attribution_text": "This data is being provided free from the LA Times.",
"commercial_uses_allowed": false
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 18,
"path": "https://api.joeczubiak.com/api/covid19/latimes/agency-totals",
"per_page": 100,
"to": 100,
"total": 1750
},
}
Examples
const fetch = require('node-fetch');
fetch('https://api.joeczubiak.com/api/covid19/latimes/agency-totals', {
method: 'GET',
headers: {
'Accept': 'application/json'
}
})
.then(response => {
console.log(
`Response: ${response.status}`
);
return response.json();
})
.then(json => console.log(json))
.catch(err => console.error(err));