FluView Metadata
| Attribute | Details |
|---|---|
| Source Name | fluview_meta |
| Data Source | United States Centers for Disease Control and Prevention (CDC) |
| License | Publicly Accessible US Government |
Overview
The FluView metadata (fluview_meta) endpoint is a companion data source to the FluView endpoint.
It describes when the FluView endpoint was last updated and how many records are available.
General topics not specific to any particular endpoint are discussed in the API overview. Such topics include: contributing, citing, and data licensing.
Table of contents
FluView Metadata
Returns information about the fluview endpoint.
The API
The base URL is: https://api.delphi.cmu.edu/epidata/fluview_meta/
Parameters
There are no parameters for this endpoint.
Response
| Field | Description | Type |
|---|---|---|
result |
result code: 1 = success, 2 = too many results, -2 = no results | integer |
epidata |
list of results | array of objects |
epidata[].latest_update |
date when data was last updated | string |
epidata[].latest_issue |
most recent “issue” (epiweek) in the data | integer |
epidata[].table_rows |
total number of rows in the table | integer |
message |
success or error message |
string |
Example URLs
FluView Metadata
https://api.delphi.cmu.edu/epidata/fluview_meta/
{
"result": 1,
"epidata": [
{
"latest_update": "2020-04-24",
"latest_issue": 202016,
"table_rows": 957673
}
],
"message": "success"
}
Code Samples
Libraries are available for R and Python. The following samples show how to import the library and fetch FluView metadata.
# Import
from epidatpy import EpiDataContext
# Fetch data
epidata = EpiDataContext()
res = epidata.pub_fluview_meta()
print(res.df())
library(epidatr)
# Fetch data
res <- pub_fluview_meta()
print(res)
Legacy Clients
We recommend using the modern client libraries mentioned above. Legacy clients are also available for Python, R, and JavaScript.
Optionally install the package using pip(env):
pip install delphi-epidata
Otherwise, place delphi_epidata.py from this repo next to your python script.
# Import
from delphi_epidata import Epidata
# Fetch data
res = Epidata.fluview_meta()
print(res['result'], res['message'], len(res['epidata']))
Place delphi_epidata.R from this repo next to your R script.
source("delphi_epidata.R")
# Fetch data
res <- Epidata$fluview_meta()
print(res$epidata)
<!-- Imports -->
<script src="delphi_epidata.js"></script>
<!-- Fetch data -->
<script>
EpidataAsync.fluview_meta().then((res) => {
console.log(res.result, res.message, res.epidata != null ? res.epidata.length : 0);
});
</script>