+
+
-### JavaScript (in a web browser)
+Install the package using pip:
+```bash
+pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
+```
+
+```python
+# Import
+from epidatpy import CovidcastEpidata, EpiDataContext, EpiRange
+# Fetch data
+epidata = EpiDataContext()
+res = epidata.pub_fluview(regions="nat", epiweeks=EpiRange(201501, 201510))
+print(res)
+```
+
+
+
+
+```R
+library(epidatr)
+# Fetch data
+res <- pub_fluview(regions = "nat", epiweeks = epirange(201501, 201510))
+print(res)
+```
+
-````html
+
+
+The JavaScript client is available [here](https://github.com/cmu-delphi/delphi-epidata/blob/main/src/client/delphi_epidata.js).
+
+```html
-````
+ EpidataAsync.fluview('nat', [EpidataAsync.range(201501, 201510)]).then((res) => {
+
+
+### Legacy Clients
+
+We recommend using the modern client libraries mentioned above. Legacy clients are also available for [Python](https://pypi.org/project/delphi-epidata/), [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R), and [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.js).
-### Python
+
+
+
+
Optionally install the package using pip(env):
-````bash
+```bash
pip install delphi-epidata
-````
+```
Otherwise, place `delphi_epidata.py` from this repo next to your python script.
-````python
+```python
# Import
from delphi_epidata import Epidata
# Fetch data
-res = Epidata.fluview(['nat'], [201440, Epidata.range(201501, 201510)])
+res = Epidata.fluview(['nat'], [Epidata.range(201501, 201510)])
print(res['result'], res['message'], len(res['epidata']))
-````
+```
+
-### R
+
-````R
-# Import
-source('delphi_epidata.R')
+Place `delphi_epidata.R` from this repo next to your R script.
+
+```R
+source("delphi_epidata.R")
# Fetch data
-res <- Epidata$fluview(list('nat'), list(201440, Epidata$range(201501, 201510)))
-cat(paste(res$result, res$message, length(res$epidata), "\n"))
-````
+res <- Epidata$fluview(regions = list("nat"), epiweeks = list(Epidata$range(201501, 201510)))
+print(res$message)
+print(length(res$epidata))
+```
+
+
+
+
+
+
+```html
+
+
+
+
+```
+
+
+
diff --git a/docs/api/fluview_clinical.md b/docs/api/fluview_clinical.md
index ca2b7b801..d37a438cc 100644
--- a/docs/api/fluview_clinical.md
+++ b/docs/api/fluview_clinical.md
@@ -2,139 +2,228 @@
title: FluView Clinical
parent: Data Sources and Signals
grand_parent: Other Endpoints (COVID-19 and Other Diseases)
-nav_order: 1
+nav_order: 2
---
# FluView Clinical
+{: .no_toc}
-This is the API documentation for accessing the FluView Clinical
-(`fluview_clinical`) endpoint of [Delphi](https://delphi.cmu.edu/)'s
-epidemiological data.
+
+| Attribute | Details |
+| :--- | :--- |
+| **Source Name** | `fluview_clinical` |
+| **Data Source** | [United States Centers for Disease Control and Prevention (CDC)](http://gis.cdc.gov/grasp/fluview/fluportaldashboard.html) |
+| **Geographic Levels** | National, Department of Health & Human Services (HHS) Regions, Census Divisions, State (see [Geographic Codes](geographic_codes.md#us-regions-and-states)) |
+| **Temporal Granularity** | Weekly (Epiweek) |
+| **Reporting Cadence** | Weekly (typically Fridays) |
+| **Temporal Scope Start** | 2016w40 |
+| **License** | [Publicly Accessible US Government](https://www.usa.gov/government-works) |
+
+
+## Overview
+{: .no_toc}
+
+This data source provides age-stratified clinical data based on laboratory-confirmed influenza reports from the US FluView dashboard.
General topics not specific to any particular endpoint are discussed in the
[API overview](README.md). Such topics include:
[contributing](README.md#contributing), [citing](README.md#citing), and
[data licensing](README.md#data-licensing).
-## FluView Clinical Data
+## Table of contents
+{: .no_toc .text-delta}
+
+1. TOC
+{:toc}
+
+## Estimation
+
+Values are sourced directly from the CDC's NREVSS (National Respiratory and Enteric Virus Surveillance System) clinical laboratories.
+
+The metrics consist of weekly counts of influenza specimens (total tested and total positive for types A and B) and their corresponding positivity rates. Unlike the syndromic ILI data in the [FluView](fluview.html) endpoint, these metrics provide laboratory confirmation of influenza circulation.
+
+### Percentages
+
+The CDC calculates three percentage metrics:
-...
+* **`percent_positive`**: Percentage of total specimens that tested positive for influenza (A or B)
+* **`percent_a`**: Percentage of total specimens that tested positive for influenza A
+* **`percent_b`**: Percentage of total specimens that tested positive for influenza B
-# The API
+
-The base URL is: https://api.delphi.cmu.edu/epidata/fluview_clinical/
+## Lag and Backfill
-See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
+The data is preliminary and subject to revision. Clinical labs may report data late or correct previously reported data. The `issues` and `lag` parameters allow access to historical versions of the data.
-## Parameters
+## The API
-### Required
+The base URL is:
+
+
+### Parameters
+
+#### Required
| Parameter | Description | Type |
| --- | --- | --- |
-| `epiweeks` | epiweeks | `list` of epiweeks |
-| `regions` | regions | `list` of [region](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/regions.txt) labels |
+| `epiweeks` | epiweeks (see [Date Formats](date_formats.md)) | `list` of epiweeks |
+| `regions` | regions | `list` of region labels: `nat`, states, `hhs1`-`hhs10`, `cen1`-`cen9` (see [Geographic Codes](geographic_codes.md#us-regions-and-states)) |
-### Optional
+#### Optional
| Parameter | Description | Type |
|-----------|--------------------------------------------|--------------------|
-| `issues` | issues | `list` of epiweeks |
+| `issues` | issues (see [Date Formats](date_formats.md)) | `list` of epiweeks |
| `lag` | # weeks between each epiweek and its issue | integer |
-Notes:
-- If both `issues` and `lag` are specified, only `issues` is used.
-If neither is specified, the current issues are used.
+{: .note}
+> **Notes:**
+> - If both `issues` and `lag` are specified, only `issues` is used.
+> - If neither is specified, the current issues are used.
-## Response
+### 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[].release_date` | | string |
-| `epidata[].region` | | string |
-| `epidata[].issue` | | integer |
-| `epidata[].epiweek` | | integer |
-| `epidata[].lag` | | integer |
-| `epidata[].total_specimens` | | integer |
-| `epidata[].total_a` | | integer |
-| `epidata[].total_b` | | integer |
-| `epidata[].percent_positive` | | float |
-| `epidata[].percent_a` | | float |
-| `epidata[].percent_b` | | float |
+| `epidata[].release_date` | date when data was released | string |
+| `epidata[].region` | region identifier | string |
+| `epidata[].issue` | epiweek of publication | integer |
+| `epidata[].epiweek` | epiweek for which data is valid | integer |
+| `epidata[].lag` | number of weeks between epiweek and issue | integer |
+| `epidata[].total_specimens` | total number of specimens tested | integer |
+| `epidata[].total_a` | total specimens positive for influenza A | integer |
+| `epidata[].total_b` | total specimens positive for influenza B | integer |
+| `epidata[].percent_positive` | percentage of specimens testing positive for influenza | float |
+| `epidata[].percent_a` | percentage of specimens testing positive for influenza A | float |
+| `epidata[].percent_b` | percentage of specimens testing positive for influenza B | float |
| `message` | `success` or error message | string |
-# Example URLs
+## Example URLs
### FluView Clinical on 2020w01 (national)
-https://api.delphi.cmu.edu/epidata/fluview_clinical/?regions=nat&epiweeks=202001
+
```json
{
"result": 1,
"epidata": [
{
- "release_date": "2020-04-10",
+ "release_date": "2021-10-08",
"region": "nat",
- "issue": 202014,
+ "issue": 202139,
"epiweek": 202001,
- "lag": 13,
- "total_specimens": 64980,
- "total_a": 5651,
- "total_b": 9647,
- "percent_positive": 23.5426,
- "percent_a": 8.69652,
- "percent_b": 14.8461
- },
- ...
+ "lag": 91,
+ "total_specimens": 65177,
+ "total_a": 5645,
+ "total_b": 9664,
+ "percent_positive": 23.4883,
+ "percent_a": 8.66103,
+ "percent_b": 14.8273
+ }
],
"message": "success"
}
```
+## Code Samples
+
+Libraries are available for [R](https://cmu-delphi.github.io/epidatr/) and [Python](https://cmu-delphi.github.io/epidatpy/).
+The following samples show how to import the library and fetch national FluView Clinical data for epiweeks `201601-201701`.
+
+
+
+
+
+
+Install the package using pip:
+```bash
+pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
+```
+
+```python
+# Import
+from epidatpy import CovidcastEpidata, EpiDataContext, EpiRange
+# Fetch data
+res = Epidata.fluview_clinical(['nat'], [Epidata.range(201601, 201701)])
+print(res['result'], res['message'], len(res['epidata']))
+```
+
+
+
-# Code Samples
+```R
+library(epidatr)
+# Fetch data
+res <- pub_fluview_clinical(regions = "nat", epiweeks = epirange(201601, 201701))
+print(res)
+```
+
-Libraries are available for [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/main/src/client/delphi_epidata.js), [Python](https://pypi.org/project/delphi-epidata/), and [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R).
-The following samples show how to import the library and fetch national FluView Clinical data for epiweeks `201940` and `202001-202010` (11 weeks total).
+
-### JavaScript (in a web browser)
+### Legacy Clients
-````html
-
-
-
-
-````
+We recommend using the modern client libraries mentioned above. Legacy clients are also available for [Python](https://pypi.org/project/delphi-epidata/), [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R), and [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.js).
-### Python
+
+
+
+
Optionally install the package using pip(env):
-````bash
+```bash
pip install delphi-epidata
-````
+```
-Otherwise, place `delphi_epidata.py` from this repo next to your python script.
+Place `delphi_epidata.py` from this repo next to your python script.
-````python
+```python
# Import
from delphi_epidata import Epidata
# Fetch data
-res = Epidata.fluview_clinical(['nat'], [201940, Epidata.range(202001, 202010)])
+res = Epidata.fluview_clinical(['nat'], [Epidata.range(201601, 201701)])
print(res['result'], res['message'], len(res['epidata']))
-````
+```
+
-### R
+
-````R
-# Import
-source('delphi_epidata.R')
+Place `delphi_epidata.R` from this repo next to your R script.
+
+```R
+source("delphi_epidata.R")
# Fetch data
-res <- Epidata$fluview_clinical(list('nat'), list(201940, Epidata$range(202001, 202010)))
-cat(paste(res$result, res$message, length(res$epidata), "\n"))
-````
+res <- Epidata$fluview_clinical(regions = list("nat"), epiweeks = list(Epidata$range(201601, 201701)))
+print(res$message)
+print(length(res$epidata))
+```
+
+
+
+
+
+
+ ```html
+
+
+
+
+ ```
+
+
+
diff --git a/docs/api/fluview_meta.md b/docs/api/fluview_meta.md
index 0826a98ba..1e489395c 100644
--- a/docs/api/fluview_meta.md
+++ b/docs/api/fluview_meta.md
@@ -6,31 +6,45 @@ nav_order: 1
---
# FluView Metadata
+{: .no_toc}
-This is the API documentation for accessing the FluView metadata
-(`fluview_meta`) endpoint of [Delphi](https://delphi.cmu.edu/)'s epidemiological
-data.
+| Attribute | Details |
+| :--- | :--- |
+| **Source Name** | `fluview_meta` |
+| **Data Source** | [United States Centers for Disease Control and Prevention (CDC)](http://gis.cdc.gov/grasp/fluview/fluportaldashboard.html) |
+| **License** | [Publicly Accessible US Government](https://www.usa.gov/government-works) |
+
+## Overview
+{: .no_toc}
+
+The FluView metadata (`fluview_meta`) endpoint is a companion data source to the [FluView](fluview.md) 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](README.md). Such topics include:
[contributing](README.md#contributing), [citing](README.md#citing), and
[data licensing](README.md#data-licensing).
+## Table of contents
+{: .no_toc .text-delta}
+
+1. TOC
+{:toc}
+
## FluView Metadata
Returns information about the [`fluview` endpoint](fluview.md).
-# The API
+## The API
-The base URL is: https://api.delphi.cmu.edu/epidata/fluview_meta/
+The base URL is:
-See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
-## Parameters
+### Parameters
There are no parameters for this endpoint.
-## Response
+### Response
| Field | Description | Type |
|---------------------------|-----------------------------------------------------------------|------------------|
@@ -41,10 +55,10 @@ There are no parameters for this endpoint.
| `epidata[].table_rows` | total number of rows in the table | integer |
| `message` | `success` or error message | string |
-# Example URLs
+## Example URLs
### FluView Metadata
-https://api.delphi.cmu.edu/epidata/fluview_meta/
+
```json
{
@@ -59,3 +73,38 @@ https://api.delphi.cmu.edu/epidata/fluview_meta/
"message": "success"
}
```
+
+## Code Samples
+
+Libraries are available for [R](https://cmu-delphi.github.io/epidatr/) and [Python](https://cmu-delphi.github.io/epidatpy/).
+The following samples show how to import the library and fetch FluView metadata.
+
+
+
+
+
+
+```python
+# Import
+from epidatpy import EpiDataContext
+# Fetch data
+epidata = EpiDataContext()
+res = epidata.pub_fluview_meta()
+print(res)
+```
+
+
+
+
+```R
+library(epidatr)
+# Fetch data
+res <- pub_fluview_meta()
+print(res)
+```
+
+
+
diff --git a/docs/api/geographic_codes.md b/docs/api/geographic_codes.md
new file mode 100644
index 000000000..fe2fcaecc
--- /dev/null
+++ b/docs/api/geographic_codes.md
@@ -0,0 +1,467 @@
+---
+title: Geographic Codes
+parent: Other Endpoints (COVID-19 and Other Diseases)
+nav_order: 900
+---
+
+# Geographic Codes
+{: .no_toc}
+
+This page documents the valid geographic codes accepted by various API endpoints.
+
+## Table of contents
+{: .no_toc .text-delta}
+
+1. TOC
+{:toc}
+
+## Countries and Territories in the Americas
+
+Multiple endpoints accept ISO 3166-1 alpha-2 country codes for countries and territories in the Americas.
+
+{: .note}
+> **Note:** While the API accepts codes for all countries listed below, data may not be available for every country or territory.
+
+### Supported Codes
+
+| Code | Name |
+|---|---|
+| AG | Antigua and Barbuda |
+| AI | Anguilla |
+| AR | Argentina |
+| AW | Aruba |
+| BB | Barbados |
+| BL | Saint Barthelemy |
+| BM | Bermuda |
+| BO | Bolivia |
+| BQ | Bonaire, Saint Eustatius and Saba |
+| BR | Brazil |
+| BS | Bahamas |
+| BZ | Belize |
+| CA | Canada |
+| CL | Chile |
+| CO | Colombia |
+| CR | Costa Rica |
+| CU | Cuba |
+| CW | Curaçao |
+| DO | Dominican Republic |
+| EC | Ecuador |
+| GD | Grenada |
+| GF | French Guiana |
+| GP | Guadeloupe |
+| GT | Guatemala |
+| GY | Guyana |
+| HN | Honduras |
+| HT | Haiti |
+| JM | Jamaica |
+| KN | Saint Kitts and Nevis |
+| KY | Cayman Islands |
+| LC | Saint Lucia |
+| MF | Saint Martin (French part) |
+| MQ | Martinique |
+| MS | Montserrat |
+| MX | Mexico |
+| NI | Nicaragua |
+| PA | Panama |
+| PE | Peru |
+| PR | Puerto Rico |
+| PY | Paraguay |
+| SR | Suriname |
+| SV | El Salvador |
+| SX | Sint Maarten (Dutch part) |
+| TC | Turks and Caicos Islands |
+| TT | Trinidad and Tobago |
+| US | United States of America |
+| UY | Uruguay |
+| VC | Saint Vincent and the Grenadines |
+| VE | Venezuela |
+| VG | Virgin Islands (UK) |
+| VI | Virgin Islands (US) |
+
+
+
+## US Regions and States
+
+Multiple endpoints use standard US geographic codes. These include the national code, HHS regions, Census divisions, and state codes.
+
+### National Code
+
+| Code | Name |
+|---|---|
+| nat | United States (National) |
+
+### HHS Regions
+
+The US Department of Health and Human Services divides the country into 10 regions.
+
+| Code | Region | States |
+|---|---|---|
+| hhs1 | Region 1 | CT, ME, MA, NH, RI, VT |
+| hhs2 | Region 2 | NJ, NY, PR, VI |
+| hhs3 | Region 3 | DE, DC, MD, PA, VA, WV |
+| hhs4 | Region 4 | AL, FL, GA, KY, MS, NC, SC, TN |
+| hhs5 | Region 5 | IL, IN, MI, MN, OH, WI |
+| hhs6 | Region 6 | AR, LA, NM, OK, TX |
+| hhs7 | Region 7 | IA, KS, MO, NE |
+| hhs8 | Region 8 | CO, MT, ND, SD, UT, WY |
+| hhs9 | Region 9 | AZ, CA, HI, NV, AS, GU, MP |
+| hhs10 | Region 10 | AK, ID, OR, WA |
+
+### Census Divisions
+
+The US Census Bureau divides the country into 9 divisions.
+
+| Code | Division | States |
+|---|---|---|
+| cen1 | New England | CT, ME, MA, NH, RI, VT |
+| cen2 | Mid-Atlantic | NJ, NY, PA |
+| cen3 | East North Central | IL, IN, MI, OH, WI |
+| cen4 | West North Central | IA, KS, MN, MO, NE, ND, SD |
+| cen5 | South Atlantic | DE, DC, FL, GA, MD, NC, SC, VA, WV |
+| cen6 | East South Central | AL, KY, MS, TN |
+| cen7 | West South Central | AR, LA, OK, TX |
+| cen8 | Mountain | AZ, CO, ID, MT, NV, NM, UT, WY |
+| cen9 | Pacific | AK, CA, HI, OR, WA |
+
+### US States and Territories
+
+Full list of 51 US states and territories used by multiple endpoints:
+
+#### US States
+
+| Code | Name |
+|---|---|
+| AK | Alaska |
+| AL | Alabama |
+| AR | Arkansas |
+| AZ | Arizona |
+| CA | California |
+| CO | Colorado |
+| CT | Connecticut |
+| DC | District of Columbia |
+| DE | Delaware |
+| FL | Florida |
+| GA | Georgia |
+| HI | Hawaii |
+| IA | Iowa |
+| ID | Idaho |
+| IL | Illinois |
+| IN | Indiana |
+| KS | Kansas |
+| KY | Kentucky |
+| LA | Louisiana |
+| MA | Massachusetts |
+| MD | Maryland |
+| ME | Maine |
+| MI | Michigan |
+| MN | Minnesota |
+| MO | Missouri |
+| MS | Mississippi |
+| MT | Montana |
+| NC | North Carolina |
+| ND | North Dakota |
+| NE | Nebraska |
+| NH | New Hampshire |
+| NJ | New Jersey |
+| NM | New Mexico |
+| NV | Nevada |
+| NY | New York |
+| OH | Ohio |
+| OK | Oklahoma |
+| OR | Oregon |
+| PA | Pennsylvania |
+| RI | Rhode Island |
+| SC | South Carolina |
+| SD | South Dakota |
+| TN | Tennessee |
+| TX | Texas |
+| UT | Utah |
+| VA | Virginia |
+| VT | Vermont |
+| WA | Washington |
+| WI | Wisconsin |
+| WV | West Virginia |
+| WY | Wyoming |
+
+#### US Territories
+
+| Code | Name |
+|---|---|
+| PR | Puerto Rico |
+| VI | Virgin Islands |
+| GU | Guam |
+| AS | American Samoa |
+| MP | Northern Mariana Islands |
+| FM | Federated States of Micronesia |
+| MH | Marshall Islands |
+| PW | Palau |
+
+## Selected US cities
+
+Selected US cities used by multiple endpoints.
+
+| Code |
+|---|
+| Abilene_TX |
+| Akron_OH |
+| Albany_NY |
+| Albuquerque_NM |
+| Alexandria_VA |
+| Allentown_PA |
+| Amarillo_TX |
+| Anaheim_CA |
+| Anchorage_AK |
+| Ann_Arbor_MI |
+| Arlington_TX |
+| Arlington_VA |
+| Atlanta_GA |
+| Austin_TX |
+| Bakersfield_CA |
+| Baltimore_MD |
+| Baton_Rouge_LA |
+| Berkeley_CA |
+| Birmingham_AL |
+| Boise_ID |
+| Boston_MA |
+| Boulder_CO |
+| Buffalo_NY |
+| Cary_NC |
+| Charlotte_NC |
+| Chicago_IL |
+| Cleveland_OH |
+| Colorado_Springs_CO |
+| Columbia_SC |
+| Columbus_OH |
+| Dallas_TX |
+| Dayton_OH |
+| Denver_CO |
+| Des_Moines_IA |
+| Durham_NC |
+| Eugene_OR |
+| Fresno_CA |
+| Ft_Worth_TX |
+| Gainesville_FL |
+| Grand_Rapids_MI |
+| Greensboro_NC |
+| Greenville_SC |
+| Honolulu_HI |
+| Houston_TX |
+| Indianapolis_IN |
+| Irvine_CA |
+| Irving_TX |
+| Jacksonville_FL |
+| Jackson_MS |
+| Kansas_City_MO |
+| Knoxville_TN |
+| Las_Vegas_NV |
+| Lexington_KY |
+| Lincoln_NE |
+| Little_Rock_AR |
+| Los_Angeles_CA |
+| Lubbock_TX |
+| Madison_WI |
+| Memphis_TN |
+| Mesa_AZ |
+| Miami_FL |
+| Milwaukee_WI |
+| Nashville_TN |
+| Newark_NJ |
+| New_Orleans_LA |
+| New_York_NY |
+| Norfolk_VA |
+| Oakland_CA |
+| Oklahoma_City_OK |
+| Omaha_NE |
+| Orlando_FL |
+| Philadelphia_PA |
+| Phoenix_AZ |
+| Pittsburgh_PA |
+| Plano_TX |
+| Portland_OR |
+| Providence_RI |
+| Raleigh_NC |
+| Reno_NV |
+| Reston_VA |
+| Richmond_VA |
+| Rochester_NY |
+| Roswell_GA |
+| Sacramento_CA |
+| Salt_Lake_City_UT |
+| Santa_Clara_CA |
+| San_Antonio_TX |
+| San_Diego_CA |
+| San_Francisco_CA |
+| San_Jose_CA |
+| Scottsdale_AZ |
+| Seattle_WA |
+| Somerville_MA |
+| Spokane_WA |
+| Springfield_MO |
+| State_College_PA |
+| St_Louis_MO |
+| St_Paul_MN |
+| Sunnyvale_CA |
+| Tampa_FL |
+| Tempe_AZ |
+| Tucson_AZ |
+| Tulsa_OK |
+| Washington_DC |
+| Wichita_KS |
+
+## NIDSS
+
+Geographic codes used by [NIDSS Flu](nidss_flu.html) and [NIDSS Dengue](nidss_dengue.html) endpoints.
+
+### Taiwan Regions
+
+Regions of Taiwan.
+
+| Code |
+|---|
+| nationwide |
+| central |
+| eastern |
+| kaoping |
+| northern |
+| southern |
+| taipei |
+
+### Taiwan Cities and Counties
+
+Administrative divisions of Taiwan.
+
+| Code |
+|---|
+| changhua_county |
+| chiayi_city |
+| chiayi_county |
+| hsinchu_city |
+| hsinchu_county |
+| hualien_county |
+| kaohsiung_city |
+| keelung_city |
+| kinmen_county |
+| lienchiang_county |
+| miaoli_county |
+| nantou_county |
+| new_taipei_city |
+| penghu_county |
+| pingtung_county |
+| taichung_city |
+| tainan_city |
+| taipei_city |
+| taitung_county |
+| taoyuan_city |
+| yilan_county |
+| yunlin_county |
+
+## European Countries
+
+European countries and regions used by the [ECDC ILI](ecdc_ili.html) endpoint.
+
+| Name |
+|---|
+| Armenia |
+| Austria |
+| Azerbaijan |
+| Belarus |
+| Belgium |
+| Czech Republic |
+| Denmark |
+| Estonia |
+| Finland |
+| France |
+| Georgia |
+| Iceland |
+| Ireland |
+| Israel |
+| Italy |
+| Kazakhstan |
+| Kosovo* |
+| Kyrgyzstan |
+| Latvia |
+| Lithuania |
+| Luxembourg |
+| Malta |
+| Moldova |
+| Montenegro |
+| Netherlands |
+| North Macedonia |
+| Norway |
+| Poland |
+| Portugal |
+| Romania |
+| Russia |
+| Serbia |
+| Slovakia |
+| Slovenia |
+| Spain |
+| Switzerland |
+| Tajikistan |
+| Turkey |
+| Turkmenistan |
+| Ukraine |
+| United Kingdom - England |
+| United Kingdom - Northern Irel |
+| United Kingdom - Scotland |
+| United Kingdom - Wales |
+| Uzbekistan |
+
+## FluSurv Locations
+
+Locations used by the [FluSurv](flusurv.html) endpoint.
+
+| Code | Description |
+|---|---|
+| CA | California |
+| CO | Colorado |
+| CT | Connecticut |
+| GA | Georgia |
+| IA | Iowa |
+| ID | Idaho |
+| MD | Maryland |
+| MI | Michigan |
+| MN | Minnesota |
+| NM | New Mexico |
+| NY_albany | New York (Albany) |
+| NY_rochester | New York (Rochester) |
+| OH | Ohio |
+| OK | Oklahoma |
+| OR | Oregon |
+| RI | Rhode Island |
+| SD | South Dakota |
+| TN | Tennessee |
+| UT | Utah |
+| network_all | All Networks |
+| network_eip | Emerging Infections Program |
+| network_ihsp | Influenza Hospitalization Surveillance Project |
+
+## Republic of Korea
+
+Geographic codes used by the [KCDC ILI](kcdc_ili.html) endpoint.
+
+| Code | Name |
+|---|---|
+| ROK | Republic of Korea |
+
+
+## FluView Cities
+
+Specific cities used by the [FluView](fluview.html) endpoint.
+
+| City | Code |
+|---|---|
+| Chicago | ord |
+| Los Angeles | lax |
+| New York City | jfk |
+
+### Note on New York
+
+In the CDC FluView system, New York State and New York City are often reported separately.
+* `ny_minus_jfk` represents New York State **excluding** NYC.
+* `jfk` represents New York City.
+* `ny` represents the entire state (the sum of the two).
diff --git a/docs/api/gft.md b/docs/api/gft.md
index ced862113..914292fa0 100644
--- a/docs/api/gft.md
+++ b/docs/api/gft.md
@@ -1,58 +1,72 @@
---
-title: inactive Google Flu Trends
-parent: Data Sources and Signals
-grand_parent: Other Endpoints (COVID-19 and Other Diseases)
-nav_order: 2
+parent: Inactive Sources (Other)
+grand_parent: Data Sources and Signals
+title: Google Flu Trends
---
# Google Flu Trends
+{: .no_toc}
-This is the API documentation for accessing the Google Flu Trends (`gft`)
-endpoint of [Delphi](https://delphi.cmu.edu/)'s epidemiological data.
+
+| Attribute | Details |
+| :--- | :--- |
+| **Source Name** | `gft` |
+| **Data Source** | [Google Flu Trends Estimates](https://www.google.com/publicdata/explore?ds=z3bsqef7ki44ac_) ([context](https://en.wikipedia.org/wiki/Google_Flu_Trends)) |
+| **Geographic Levels** | National, Department of Health & Human Services (HHS) Regions, State (see [Geographic Codes](geographic_codes.md#us-regions-and-states)), Selected US Cities (see [Selected US Cities](geographic_codes.md#selected-us-cities)) |
+| **Temporal Granularity** | Weekly (Epiweek) |
+| **Reporting Cadence** | Inactive - No longer updated since 2015w32 |
+| **Temporal Scope Start** | 2003w40 |
+| **License** | [Google Terms of Service](https://policies.google.com/terms) |
+
+
+## Overview
+{: .no_toc}
+
+This data source provides a historical estimate of influenza activity based on the aggregated volume of search queries related to flu symptoms, treatments, and related topics. The data is sourced from Google Flu Trends (GFT), which used these query volumes to model ILI rates.
+
+We offer similar search query-based disease tracking that is more up to date: [Google Health Trends](ght.md), available through mid 2022, and [Google Symptoms](covidcast-signals/google-symptoms.md), available through late 2025.
+Although these datasets are all based on search query volume, the processing and privacy handling differs such that reported values may not be comparable between sources.
General topics not specific to any particular endpoint are discussed in the
[API overview](README.md). Such topics include:
[contributing](README.md#contributing), [citing](README.md#citing), and
[data licensing](README.md#data-licensing).
-## Google Flu Trends Data
+## Table of contents
+{: .no_toc .text-delta}
-Estimate of influenza activity based on volume of certain search queries. Google has discontinued Flu Trends, and this is now a static endpoint.
- - Data Source: [Google Flu Trends Estimates](https://www.google.com/publicdata/explore?ds=z3bsqef7ki44ac_) ([context](https://en.wikipedia.org/wiki/Google_Flu_Trends))
- - Temporal Resolution: Weekly from 2003w40 until 2015w32
- - Spatial Resolution: National, [HHS regions](http://www.hhs.gov/iea/regional/) ([1+10](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/regions.txt)); by state/territory ([50+1](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/states.txt)); and by city ([97](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/cities.txt))
- - Open access
+1. TOC
+{:toc}
-# The API
+## The API
-The base URL is: https://api.delphi.cmu.edu/epidata/gft/
+The base URL is:
-See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
-## Parameters
+### Parameters
-### Required
+#### Required
| Parameter | Description | Type |
| --- | --- | --- |
-| `epiweeks` | epiweeks | `list` of epiweeks |
-| `locations` | locations | `list` of [region](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/regions.txt)/[state](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/states.txt)/[city](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/cities.txt) labels |
+| `locations` | Locations to fetch. National, HHS regions, US states (see [US Regions and States](geographic_codes.md#us-regions-and-states)), and select cities (see [Selected US Cities](geographic_codes.md#selected-us-cities)). | `list` of strings |
+| `epiweeks` | Epiweeks to fetch. Supports [`epirange()`] and defaults to all ("*") dates. | `list` of epiweeks |
-## Response
+### 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[].location` | location | string |
-| `epidata[].epiweek` | epiweek | epiweek |
-| `epidata[].num` | number | integer |
+| `epidata[].epiweek` | epiweek | integer |
+| `epidata[].num` | GFT estimate (estimated ILI cases per 100,000 physician visits) | integer |
| `message` | `success` or error message | string |
-# Example URLs
+## Example URLs
### Google Flu Trends on 2015w01 (national)
-https://api.delphi.cmu.edu/epidata/gft/?locations=nat&epiweeks=201501
+
```json
{
@@ -69,47 +83,103 @@ https://api.delphi.cmu.edu/epidata/gft/?locations=nat&epiweeks=201501
```
-# Code Samples
+## Code Samples
-Libraries are available for [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/main/src/client/delphi_epidata.js), [Python](https://pypi.org/project/delphi-epidata/), and [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R).
-The following samples show how to import the library and fetch Google Flu Trends data for epiweeks `201440` and `201501-201510` (11 weeks total).
+Libraries are available for [R](https://cmu-delphi.github.io/epidatr/) and [Python](https://cmu-delphi.github.io/epidatpy/).
+The following samples show how to import the library and fetch Google Flu Trends data for epiweeks `201501-201510`.
-### JavaScript (in a web browser)
+
+
+
+
+
+Install the package using pip:
+```bash
+pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
+```
+
+```python
+# Import
+from epidatpy import CovidcastEpidata, EpiDataContext, EpiRange
+# Fetch data
+epidata = EpiDataContext()
+res = epidata.pub_gft(locations='nat', epiweeks=EpiRange(201501, 201510))
+print(res)
+```
+
+
+
+
+```R
+library(epidatr)
+# Fetch data
+res <- pub_gft(locations = 'nat', epiweeks = epirange(201501, 201510))
+print(res)
+```
+
-### Python
+
+
+### Legacy Clients
+
+We recommend using the modern client libraries mentioned above. Legacy clients are also available for [Python](https://pypi.org/project/delphi-epidata/), [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R), and [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.js).
+
+
+
+
+
Optionally install the package using pip(env):
-````bash
+```bash
pip install delphi-epidata
-````
+```
Otherwise, place `delphi_epidata.py` from this repo next to your python script.
-````python
+```python
# Import
from delphi_epidata import Epidata
# Fetch data
-res = Epidata.gft(['nat'], [201440, Epidata.range(201501, 201510)])
+res = Epidata.gft(['nat'], Epidata.range(201501, 201510))
print(res['result'], res['message'], len(res['epidata']))
-````
+```
+
-### R
+
-````R
-# Import
-source('delphi_epidata.R')
+Place `delphi_epidata.R` from this repo next to your R script.
+
+```R
+source("delphi_epidata.R")
# Fetch data
-res <- Epidata$gft(list('nat'), list(201440, Epidata$range(201501, 201510)))
-cat(paste(res$result, res$message, length(res$epidata), "\n"))
-````
+res <- Epidata$gft(locations = list("nat"), epiweeks = Epidata$range(201501, 201510))
+print(res$message)
+print(length(res$epidata))
+```
+
+
+
+
+
+
+```html
+
+
+
+
+```
+
+
+
diff --git a/docs/api/ght.md b/docs/api/ght.md
index 20698e753..4ed89eec0 100644
--- a/docs/api/ght.md
+++ b/docs/api/ght.md
@@ -1,60 +1,311 @@
---
-title: inactive Google Health Trends
-parent: Data Sources and Signals
-grand_parent: Other Endpoints (COVID-19 and Other Diseases)
-nav_order: 2
+parent: Inactive Sources (Other)
+grand_parent: Data Sources and Signals
+title: Google Health Trends
---
# Google Health Trends
+{: .no_toc}
-This is the API documentation for accessing the [Google Health Trends](https://trends.google.com/trends/fullscreen/m/IN) (`ght`)
-endpoint of [Delphi](https://delphi.cmu.edu/)'s epidemiological data.
+
+| Attribute | Details |
+| :--- | :--- |
+| **Source Name** | `ght` |
+| **Data Source** | Google Health Trends |
+| **Geographic Levels** | National, State (see [Geographic Codes](geographic_codes.md#us-states-and-territories)) |
+| **Temporal Granularity** | Weekly (Epiweek) |
+| **Reporting Cadence** | Inactive - No longer updated since 2022w36 |
+| **Temporal Scope Start** | 1993w01 |
+| **License** | [Google Terms of Service](https://policies.google.com/terms) |
+
+## Overview
+{: .no_toc}
+
+The `ght` endpoint provides access to Google Health Trends data, which tracks the aggregated volume of search queries related to specific influenza symptoms and treatments.
+
+{: .note}
+> **Notes:**
+> - This data source tracks the search interest for specific terms (e.g., "flu symptoms", "thermometer") rather than model estimates. It is distinct from Google Flu Trends (GFT) which provided modeled ILI rates.
+> - Restricted access: This endpoint requires authentication.
General topics not specific to any particular endpoint are discussed in the
[API overview](README.md). Such topics include:
[contributing](README.md#contributing), [citing](README.md#citing), and
[data licensing](README.md#data-licensing).
-## Google Health Trends Data
-
-Estimate of influenza activity based on volume of certain search queries.
This data may be useful for real-time monitoring of diseases, as in:
-
- Herman Anthony Carneiro, Eleftherios Mylonakis. [Google Trends: A Web-Based Tool for Real-Time Surveillance of Disease Outbreaks](https://doi.org/10.1086/630200). Clinical Infectious Diseases, Volume 49, Issue 10, 15 November 2009, Pages 1557–1564.
- Abel Brodeur, Andrew E. Clark, Sarah Fleche, Nattavudh Powdthavee.
[COVID-19, lockdowns and well-being: Evidence from Google Trends](https://doi.org/10.1016/j.jpubeco.2020.104346). Journal of Public Economics, Volume 193, 2021, 104346.
- Sudhakar V. Nuti, Brian Wayda, Isuru Ranasinghe, Sisi Wang, Rachel P. Dreyer, Serene I. Chen, Karthik Murugiah. [The Use of Google Trends in Health Care Research: A Systematic Review](https://doi.org/10.1371/journal.pone.0109583), October 2014.
-# The API
+## Table of contents
+{: .no_toc .text-delta}
+
+1. TOC
+{:toc}
+
+## Estimation
+
+Values represent the relative search volume for a specific query or topic within a geographic region.
+
+
-The base URL is: https://api.delphi.cmu.edu/epidata/ght/
-See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
+## The API
-## Parameters
+The base URL is:
-### Required
+
+### Parameters
+
+#### Required
| Parameter | Description | Type |
| --- | --- | --- |
| `auth` | password | string |
-| `epiweeks` | epiweeks | `list` of epiweeks |
-| `locations` | locations | `list` of [state](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/states.txt) and/or `US` labels |
-| `query` | search query or topic ID (see https://www.freebase.com/) | string |
+| `epiweeks` | epiweeks (see [Date Formats](date_formats.md)) | `list` of epiweeks |
+| `locations` | locations | `list` of state codes (see [Geographic Codes](geographic_codes.md#us-states-and-territories)) and/or `US` |
+| `query` | search query or topic ID (see [Valid Queries](#valid-queries)) | string |
+
+##### Valid Queries
+
+
+Click to expand full list of valid queries
+
+* `/m/0cycc`
+* `influenza type a`
+* `flu duration`
+* `flu fever`
+* `treating flu`
+* `fever flu`
+* `flu recovery`
+* `braun thermoscan`
+* `oscillococcinum`
+* `treating the flu`
+* `cold or flu`
+* `flu versus cold`
+* `flu remedies`
+* `contagious flu`
+* `type a influenza`
+* `flu or cold`
+* `duration of flu`
+* `cold versus flu`
+* `flu cough`
+* `flu headache`
+* `thermoscan`
+* `influenza incubation period`
+* `flu lasts`
+* `length of flu`
+* `flu stomach`
+* `cold vs flu`
+* `flu and fever`
+* `getting over the flu`
+* `influenza a`
+* `treatment for flu`
+* `flu length`
+* `treatment for the flu`
+* `influenza symptoms`
+* `over the counter flu`
+* `flu complications`
+* `cold and flu symptoms`
+* `influenza incubation`
+* `treatment of flu`
+* `human temperature`
+* `low body`
+* `flu contagious`
+* `robitussin ac`
+* `flu how long`
+* `ear thermometer`
+* `flu contagious period`
+* `treat flu`
+* `cough flu`
+* `low body temperature`
+* `expectorant`
+* `flu and cold`
+* `rapid flu`
+* `flu vs. cold`
+* `how to treat the flu`
+* `how long does the flu last?`
+* `viral pneumonia`
+* `flu in kids`
+* `type a flu`
+* `influenza treatment`
+* `fighting the flu`
+* `flu relief`
+* `treat the flu`
+* `flu medicine`
+* `dangerous fever`
+* `what is influenza`
+* `tussin`
+* `low body temp`
+* `flu care`
+* `flu in infants`
+* `flu dizziness`
+* `feed a fever`
+* `flu vs cold`
+* `flu vomiting`
+* `bacterial pneumonia`
+* `flu activity`
+* `flu chills`
+* `anas barbariae`
+* `flu germs`
+* `tylenol cold`
+* `how to get over the flu`
+* `flu in children`
+* `influenza a and b`
+* `duration of the flu`
+* `cold symptoms`
+* `flu report`
+* `rapid flu test`
+* `flu relapse`
+* `get over the flu`
+* `flu during pregnancy`
+* `flu recovery time`
+* `cure for flu`
+* `tamiflu and breastfeeding`
+* `flu chest pain`
+* `flu treatment`
+* `flu nausea`
+* `remedies for the flu`
+* `tamiflu in pregnancy`
+* `side effects of tamiflu`
+* `how to treat flu`
+* `viral bronchitis`
+* `flu how long contagious`
+* `flu remedy`
+
+
+
+### 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[].location` | location label | string |
+| `epidata[].epiweek` | epiweek | integer |
+| `epidata[].query` | search query | string |
+| `epidata[].value` | search volume | float |
+| `message` | `success` or error message | string |
+
+## Example URLs
+
+### Google Health Trends for "how to get over the flu" on 2015w01 (US)
+
+
+```json
+{
+ "result": 1,
+ "epidata": [
+ {
+ "location": "US",
+ "epiweek": 201501,
+ "value": 9.113
+ }
+ ],
+ "message": "success"
+}
+```
+
+## Code Samples
+
+Libraries are available for [R](https://cmu-delphi.github.io/epidatr/) and [Python](https://cmu-delphi.github.io/epidatpy/).
+The following samples show how to import the library and fetch GHT data for "how to get over the flu" in the US for epiweek `201501`.
+
+
+
+
+
+
+Install the package using pip:
+```bash
+pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
+```
+
+```python
+# Import
+from epidatpy import CovidcastEpidata, EpiDataContext, EpiRange
+# Fetch data
+epidata = EpiDataContext()
+res = epidata.ght('auth_token', ['US'], [201501], 'how to get over the flu')
+print(res['result'], res['message'], len(res['epidata']))
+```
+
+
+
+
+```R
+library(epidatr)
+# Fetch data
+res <- pvt_ght(auth = 'auth_token', locations = 'US', epiweeks = 201501,
+ query = "how to get over the flu")
+print(res)
+```
+
+
+
+
+### Legacy Clients
+
+We recommend using the modern client libraries mentioned above. Legacy clients are also available for [Python](https://pypi.org/project/delphi-epidata/), [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R), and [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.js).
+
+
+
+
+
+
+Optionally install the package using pip(env):
+```bash
+pip install delphi-epidata
+```
+
+Otherwise, place `delphi_epidata.py` from this repo next to your python script.
+
+```python
+# Import
+from delphi_epidata import Epidata
+# Fetch data
+res = Epidata.ght('auth_token', ['US'], [201501], 'how to get over the flu')
+print(res['result'], res['message'], len(res['epidata']))
+```
+
+
+
+
+Place `delphi_epidata.R` from this repo next to your R script.
-## Response
+```R
+source("delphi_epidata.R")
+# Fetch data
+res <- Epidata$ght(auth = "auth_token", locations = list("US"), epiweeks = list(201501), query = "how to get over the flu")
+print(res$message)
+print(length(res$epidata))
+```
+
-| Field | Description | Type |
-|-----------|-----------------------------------------------------------------|------------------|
-| `result` | result code: 1 = success, 2 = too many results, -2 = no results | integer |
-| `epidata` | list of results | array of objects |
-| ... | ... | ... |
-| `message` | `success` or error message | string |
+
-# Example URLs
-
-# Code Samples
+```html
+
+
+
+
+```
+
-
+
diff --git a/docs/api/ili_nearby_nowcast.md b/docs/api/ili_nearby_nowcast.md
index defd13b22..2d4d1fa45 100644
--- a/docs/api/ili_nearby_nowcast.md
+++ b/docs/api/ili_nearby_nowcast.md
@@ -1,62 +1,97 @@
---
-title: inactive ILI Nearby Nowcast
-parent: Data Sources and Signals
-grand_parent: Other Endpoints (COVID-19 and Other Diseases)
-nav_order: 2
+parent: Inactive Sources (Other)
+grand_parent: Data Sources and Signals
+title: ILI Nearby Nowcast
permalink: api/nowcast.html
---
# ILI Nearby Nowcast
+{: .no_toc}
-This is the documentation of the API for accessing the ILI Nearby (`nowcast`) endpoint of
-the [Delphi](https://delphi.cmu.edu/)'s epidemiological data.
+
+| Attribute | Details |
+| :--- | :--- |
+| **Source Name** | `nowcast` |
+| **Data Source** | [Delphi's ILI Nearby system](https://delphi.cmu.edu/nowcast/) |
+| **Dataset Type** | Predictive (Leading Indicator) |
+| **Geographic Levels** | National, Department of Health & Human Services (HHS) Regions, Census Divisions, State (see [Geographic Codes](geographic_codes.md#us-regions-and-states)) |
+| **Temporal Granularity** | Weekly (Epiweek) |
+| **Reporting Cadence** | Inactive - No longer updated since 2022w36 |
+| **Temporal Scope Start** | 2010w45 |
+| **License** | [CC BY](https://creativecommons.org/licenses/by/4.0/) |
+
+## Overview
+{: .no_toc}
+
+This endpoint provides Delphi's nowcast estimates of the percentage of outpatient visits due to Influenza-Like Illness (ILI).
+
+This system uses a sensor-fusion approach to estimate the current level of flu activity before the official CDC reports are finalized.
+It is available for:
+* **National/Regional:** 7 days before the first official CDC ILINet report for a given date.
+* **State-level:** 5 days before the first official CDC ILINet report for a given date. State values report weighted percent ILI.
General topics not specific to any particular endpoint are discussed in the
[API overview](README.md). Such topics include:
[contributing](README.md#contributing), [citing](README.md#citing), and
[data licensing](README.md#data-licensing).
-## ILI Nearby Data
-A nowcast of U.S. national, regional, and state-level (weighted) %ILI, available seven days (regionally) or five days (state-level) before the first ILINet report for the corresponding week.
- - Source: [Delphi's ILI Nearby system](https://delphi.cmu.edu/nowcast/)
- - Temporal Resolution: Weekly, from 2010w30*
- - Spatial Resolution: National, [HHS regions](http://www.hhs.gov/iea/regional/), [Census divisions](http://www.census.gov/econ/census/help/geography/regions_and_divisions.html) ([1+10+9](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/regions.txt)), and by state/territory ([51](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/states.txt))
- - Open access
+# Table of contents
+{: .no_toc .text-delta}
+
+1. TOC
+{:toc}
+
+## Estimation
+
+This system uses a sensor-fusion approach to estimate the current level of flu activity (ILI%). It combines data sources to produce a single estimate, aiming to provide an early indicator before the official CDC FluView report is finalized.
-\* Data is usually released on Friday and updated on Sunday and Monday
+The endpoint exposes the following signals:
-# The API
+* **`value`**: The nowcast estimate of the percentage of outpatient visits due to Influenza-Like Illness (ILI).
+* **`std`**: The standard deviation of the nowcast estimate, providing a measure of uncertainty.
-The base URL is: https://api.delphi.cmu.edu/epidata/nowcast/
+The model combines multiple digital surveillance signals, including Wikipedia access logs (see [Wikipedia Access](wiki.md)) and CDC webpage visits (see [CDC Webpage Visits](cdc.md)), to create a predictive model for the current week's ILI%.
-See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
+## Lag and Backfill
-## Parameters
+Nowcast estimates were subject to revision as input data was updated or backfilled.
-### Required
+## Limitations
+
+* These values are estimates (nowcasts), not ground-truth surveillance data. They are subject to modeling errors.
+* The accuracy of the nowcast depends on the availability and stability of the input (Wikipedia, CDC page hits, etc.). Changes in user behaviour or platform algorithms can affect these inputs.
+
+## The API
+
+The base URL is:
+
+
+### Parameters
+
+#### Required
| Parameter | Description | Type |
| --- | --- | --- |
-| `epiweeks` | epiweeks | `list` of epiweeks |
-| `locations` | locations | `list` of [region](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/regions.txt)/[state](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/states.txt) labels |
+| `epiweeks` | epiweeks (see [Date Formats](date_formats.md)) | `list` of epiweeks |
+| `locations` | locations | `list` of location codes: `nat`, HHS regions, Census divisions, or state codes (see [Geographic Codes](geographic_codes.md#us-regions-and-states)) |
-## Response
+### 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[].location` | | string |
-| `epidata[].epiweek` | | integer |
-| `epidata[].value` | | float |
-| `epidata[].std` | | float |
+| `epidata[].location` | location identifier (e.g., 'nat', state code, HHS region, census division) | string |
+| `epidata[].epiweek` | epiweek for the nowcast estimate | integer |
+| `epidata[].value` | nowcast estimate of %ILI (percentage of outpatient visits due to ILI) | float |
+| `epidata[].std` | standard deviation of the nowcast estimate | float |
| `message` | `success` or error message | string |
-# Example URLs
+## Example URLs
### ILI Nearby on 2020w01 (national)
-https://api.delphi.cmu.edu/epidata/nowcast/?locations=nat&epiweeks=202001
+
```json
{
@@ -74,47 +109,103 @@ https://api.delphi.cmu.edu/epidata/nowcast/?locations=nat&epiweeks=202001
```
-# Code Samples
+## Code Samples
-Libraries are available for [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/main/src/client/delphi_epidata.js), [Python](https://pypi.org/project/delphi-epidata/), and [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R).
-The following samples show how to import the library and fetch national ILI Nearby data for epiweeks `201940` and `202001-202010` (11 weeks total).
+Libraries are available for [R](https://cmu-delphi.github.io/epidatr/) and [Python](https://cmu-delphi.github.io/epidatpy/).
+The following samples show how to import the library and fetch national ILI Nearby data for epiweeks `202001-202010` (10 weeks total).
-### JavaScript (in a web browser)
+
+
+
+
+
+Install the package using pip:
+```bash
+pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
+```
+
+```python
+# Import
+from epidatpy import CovidcastEpidata, EpiDataContext, EpiRange
+# Fetch data
+epidata = EpiDataContext()
+res = epidata.pub_nowcast(locations=['nat'], epiweeks=EpiRange(202001, 202010))
+print(res)
+```
+
-### Python
+
+
+```R
+library(epidatr)
+# Fetch data
+res <- pub_nowcast(locations = 'nat', epiweeks = epirange(202001, 202010))
+print(res)
+```
+
+
+
+
+### Legacy Clients
+
+We recommend using the modern client libraries mentioned above. Legacy clients are also available for [Python](https://pypi.org/project/delphi-epidata/), [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R), and [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.js).
+
+
+
+
+
Optionally install the package using pip(env):
-````bash
+```bash
pip install delphi-epidata
-````
+```
Otherwise, place `delphi_epidata.py` from this repo next to your python script.
-````python
+```python
# Import
from delphi_epidata import Epidata
# Fetch data
-res = Epidata.nowcast(['nat'], [201940, Epidata.range(202001, 202010)])
+res = Epidata.nowcast(['nat'], Epidata.range(202001, 202010))
print(res['result'], res['message'], len(res['epidata']))
-````
+```
+
-### R
+
-````R
-# Import
-source('delphi_epidata.R')
+Place `delphi_epidata.R` from this repo next to your R script.
+
+```R
+source("delphi_epidata.R")
# Fetch data
-res <- Epidata$nowcast(list('nat'), list(201940, Epidata$range(202001, 202010)))
-cat(paste(res$result, res$message, length(res$epidata), "\n"))
-````
+res <- Epidata$nowcast(locations = list("nat"), epiweeks = Epidata$range(202001, 202010))
+print(res$message)
+print(length(res$epidata))
+```
+
+
+
+
+
+
+```html
+
+
+
+
+```
+
+
+
diff --git a/docs/api/inactive_other.md b/docs/api/inactive_other.md
new file mode 100644
index 000000000..3b9361088
--- /dev/null
+++ b/docs/api/inactive_other.md
@@ -0,0 +1,12 @@
+---
+title: Inactive Sources (Other)
+parent: Data Sources and Signals
+grand_parent: Other Endpoints (COVID-19 and Other Diseases)
+nav_order: 99
+has_children: true
+---
+
+# Inactive Other Sources
+{: .no_toc}
+
+These Other Endpoint data sources are no longer actively updated.
diff --git a/docs/api/kcdc_ili.md b/docs/api/kcdc_ili.md
index 340d886d2..f98e33448 100644
--- a/docs/api/kcdc_ili.md
+++ b/docs/api/kcdc_ili.md
@@ -1,11 +1,27 @@
---
-title: inactive KCDC ILI
-parent: Data Sources and Signals
-grand_parent: Other Endpoints (COVID-19 and Other Diseases)
-nav_order: 2
+parent: Inactive Sources (Other)
+grand_parent: Data Sources and Signals
+title: KCDC ILI
---
# KCDC ILI
+{: .no_toc}
+
+
+| Attribute | Details |
+| :--- | :--- |
+| **Source Name** | `kcdc_ili` |
+| **Data Source** | [Korea Disease Control and Prevention Agency (KCDC) ILI surveillance](https://www.kdca.go.kr/) |
+| **Geographic Levels** | ROK (Republic of Korea) (see [Geographic Codes](geographic_codes.md#republic-of-korea)) |
+| **Temporal Granularity** | Weekly (Epiweek) |
+| **Reporting Cadence** | Inactive - No longer updated since 2020w44 |
+| **Temporal Scope Start** | 2004w36 |
+| **License** | [KCDC Copyright policy](https://www.kdca.go.kr/kdca/3509/subview..do) |
+
+## Overview
+{: .no_toc}
+
+This endpoint provides weekly influenza-like illness (ILI) rates for South Korea, as reported by the Korea Centers for Disease Control and Prevention (KCDC).
This is the API documentation for accessing the KCDC ILI (`kcdc_ili`) endpoint of [Delphi](https://delphi.cmu.edu/)'s epidemiological data.
@@ -14,49 +30,185 @@ General topics not specific to any particular endpoint are discussed in the
[contributing](README.md#contributing), [citing](README.md#citing), and
[data licensing](README.md#data-licensing).
-## KCDC ILI Data
+## Table of contents
+{: .no_toc .text-delta}
+
+1. TOC
+{:toc}
+
+## Estimation
+
+The data is reported directly by the Korea Centers for Disease Control and Prevention (KCDC) through their infectious disease surveillance system. The `ili` value represents the number of ILI cases per 1,000 outpatient visits.
+
+KCDC reports are scraped and stored directly. No additional smoothing or statistical adjustments are applied by the Delphi group, other than typical data parsing and versioning.
+
+
+
+## Lag and Backfill
+
+Historical data were revised as KCDC updated its surveillance reports.
+
+
+
+## The API
+
+The base URL is:
+
+
+### Parameters
+
+#### Required
+
+| Parameter | Description | Type |
+| --- | --- | --- |
+| `regions` | Regions to fetch. See [Geographic Codes](geographic_codes.html#republic-of-korea). | `list` of strings |
+| `epiweeks` | Epiweeks to fetch. Supports [`epirange()`] and defaults to all ("*") dates. | `list` of epiweeks |
+
+#### Optional
+
+| Parameter | Description | Type |
+| --- | --- | --- |
+| `issues` | Optionally, the issue(s) (see [Date Formats](date_formats.html)) of the data to fetch. | `list` of epiweeks |
+| `lag` | Optionally, the lag of the issues to fetch. | integer |
-KCDC ILI data from KCDC website. ...
+{: .note}
+> **Notes:**
+> - If both `issues` and `lag` are specified, only `issues` is used.
+> - If neither is specified, the current issues are used.
-# The API
+### Response
-The base URL is: https://api.delphi.cmu.edu/epidata/kcdc_ili/
+| Field | Description | Type |
+|---------------------------|-----------------------------------------------------------------|------------------|
+| `result` | result code: 1 = success, 2 = too many results, -2 = no results | integer |
+| `epidata` | list of results | array of objects |
+| `epidata[].release_date` | date of release | string |
+| `epidata[].region` | region name | string |
+| `epidata[].issue` | epiweek of issue | integer |
+| `epidata[].epiweek` | epiweek of data | integer |
+| `epidata[].lag` | lag in weeks | integer |
+| `epidata[].ili` | ILI cases per 1,000 outpatient visits | float |
+| `message` | `success` or error message | string |
-See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
+## Example URLs
-## Parameters
+### KCDC ILI in ROK on 2020w01
+
-### Required
+```json
+{
+ "result": 1,
+ "epidata": [
+ {
+ "release_date": "2020-01-10",
+ "region": "ROK",
+ "issue": 202001,
+ "epiweek": 202001,
+ "lag": 44,
+ "ili": 49.8
+ }
+ ],
+ "message": "success"
+}
+```
-| Parameter | Description | Type |
-|------------|-------------|--------------------|
-| `epiweeks` | epiweeks | `list` of epiweeks |
-| `regions` | regions | `ROK` |
+## Code Samples
-### Optional
+Libraries are available for [R](https://cmu-delphi.github.io/epidatr/) and [Python](https://cmu-delphi.github.io/epidatpy/).
+The following samples show how to import the library and fetch KCDC ILI data for ROK for epiweeks `202001` and `202002`.
-| Parameter | Description | Type |
-|-----------|--------------------------------------------|--------------------|
-| `issues` | issues | `list` of epiweeks |
-| `lag` | # weeks between each epiweek and its issue | integer |
+
+
-## Response
+
-| Field | Description | Type |
-|-----------|-----------------------------------------------------------------|------------------|
-| `result` | result code: 1 = success, 2 = too many results, -2 = no results | integer |
-| `epidata` | list of results | array of objects |
-| ... | ... | ... |
-| `message` | `success` or error message | string |
+Install the package using pip:
+```bash
+pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
+```
-# Example URLs
+```python
+# Import
+from epidatpy import CovidcastEpidata, EpiDataContext, EpiRange
+# Fetch data
+epidata = EpiDataContext()
+res = epidata.pub_kcdc_ili(regions=['ROK'], epiweeks=[202001, 202002])
+print(res)
+```
+
-
+
-# Code Samples
+```R
+library(epidatr)
+# Fetch data
+res <- pub_kcdc_ili(regions = 'ROK', epiweeks = c(202001, 202002))
+print(res)
+```
+
+
+
+
+### Legacy Clients
+
+We recommend using the modern client libraries mentioned above. Legacy clients are also available for [Python](https://pypi.org/project/delphi-epidata/), [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R), and [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.js).
+
+
+
+
+
+
+Optionally install the package using pip(env):
+```bash
+pip install delphi-epidata
+```
+
+Otherwise, place `delphi_epidata.py` from this repo next to your python script.
+
+```python
+# Import
+from delphi_epidata import Epidata
+# Fetch data
+res = Epidata.kcdc_ili(['ROK'], [202001, 202002])
+print(res['result'], res['message'], len(res['epidata']))
+```
+
+
+
+
+Place `delphi_epidata.R` from this repo next to your R script.
+
+```R
+source("delphi_epidata.R")
+# Fetch data
+res <- Epidata$kcdc_ili(regions = list("ROK"), epiweeks = list(202001, 202002))
+print(res$message)
+print(length(res$epidata))
+```
+
+
+
+
+
+
+```html
+
+
+
+
+```
+
-
+
diff --git a/docs/api/nidss_dengue.md b/docs/api/nidss_dengue.md
index 33cd2ffc3..5d25329a9 100644
--- a/docs/api/nidss_dengue.md
+++ b/docs/api/nidss_dengue.md
@@ -1,58 +1,84 @@
---
-title: inactive NIDSS Dengue
-parent: Data Sources and Signals
-grand_parent: Other Endpoints (COVID-19 and Other Diseases)
-nav_order: 2
+parent: Inactive Sources (Other)
+grand_parent: Data Sources and Signals
+title: NIDSS Dengue
---
# NIDSS Dengue
+{: .no_toc}
-This is the documentation of the API for accessing the Taiwan National Infectious Disease Statistics System Dengue (`nidss_dengue`) endpoint of
-the [Delphi](https://delphi.cmu.edu/)'s epidemiological data.
+
+| Attribute | Details |
+| :--- | :--- |
+| **Source Name** | `nidss_dengue` |
+| **Data Source** | [Taiwan CDC](http://nidss.cdc.gov.tw/en/SingleDisease.aspx?dc=1&dt=4&disease=061&position=1)|
+| **Geographic Levels** | Taiwan [hexchotomy regions](https://en.wikipedia.org/wiki/Regions_of_Taiwan#Hexchotomy) and [cities/counties](https://en.wikipedia.org/wiki/List_of_administrative_divisions_of_Taiwan) (see [Geographic Codes](geographic_codes.md#nidss)) |
+| **Temporal Granularity** | Weekly (Epiweek) |
+| **Reporting Cadence** | Inactive - No longer updated since 2018w10 |
+| **Temporal Scope Start** | 2003w01 |
+| **License** | [Open Access](https://data.gov.tw/license) |
+
+## Overview
+{: .no_toc}
+
+This endpoint reports counts of confirmed dengue cases from the Taiwan National Infectious Disease Statistics System (NIDSS) via the Taiwan CDC.
General topics not specific to any particular endpoint are discussed in the
[API overview](README.md). Such topics include:
[contributing](README.md#contributing), [citing](README.md#citing), and
[data licensing](README.md#data-licensing).
-## NIDSS Dengue Data
+## Table of contents
+{: .no_toc .text-delta}
+
+1. TOC
+{:toc}
+
+## Estimation
+
+Confirmed dengue cases are aggregated from NIDSS weekly reports, summing across all demographic groups (age/gender) and combining city/county data into six major [hexchotomy regions](geographic_codes.md#nidss).
+
+
-Counts of confirmed dengue cases from Taiwan's National Infectious Disease Statistics System (NIDSS).
- - Data source: [Taiwan CDC](http://nidss.cdc.gov.tw/en/SingleDisease.aspx?dc=1&dt=4&disease=061&position=1)
- - Temporal Resolution: Weekly from 2003w01
- - Spatial Resolution: By [hexchotomy region](https://en.wikipedia.org/wiki/Regions_of_Taiwan#Hexchotomy) ([6+1](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/nidss_regions.txt)) and by [city/county](https://en.wikipedia.org/wiki/List_of_administrative_divisions_of_Taiwan) ([22](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/nidss_locations.txt))
- - Open access
+## Lag and Backfill
-# The API
+Historical data were subject to revisions as new cases were confirmed or reclassified.
-The base URL is: https://api.delphi.cmu.edu/epidata/nidss_dengue/
+## Limitations
-See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
+Users should be aware of Taiwan's epiweek definition changes in 2009 (see [NIDSS Flu](nidss_flu.md) for similar quirks).
-## Parameters
-### Required
+
+## The API
+
+The base URL is:
+
+
+### Parameters
+
+#### Required
| Parameter | Description | Type |
| --- | --- | --- |
-| `epiweeks` | epiweeks | `list` of epiweeks |
-| `locations` | locations | `list` of [region](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/nidss_regions.txt) and/or [location](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/nidss_locations.txt) labels |
+| `epiweeks` | epiweeks (see [Date Formats](date_formats.md)) | `list` of epiweeks |
+| `locations` | locations | `list` of Taiwan region and/or location labels (see [Geographic Codes](geographic_codes.md#nidss)) |
-## Response
+### 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[].location` | location | string |
+| `epidata[].location` | location (hexchotomy region) | string |
| `epidata[].epiweek` | epiweek during which the data was collected | integer |
-| `epidata[].count` | number of cases | integer |
+| `epidata[].count` | number of confirmed dengue cases | integer |
| `message` | `success` or error message | string |
-# Example URLs
+## Example URLs
### NIDSS Dengue on 2015w01 (nationwide)
-https://api.delphi.cmu.edu/epidata/nidss_dengue/?locations=nationwide&epiweeks=201501
+
```json
{
@@ -69,51 +95,107 @@ https://api.delphi.cmu.edu/epidata/nidss_dengue/?locations=nationwide&epiweeks=2
```
-# Code Samples
+## Code Samples
-Libraries are available for [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/main/src/client/delphi_epidata.js), [Python](https://pypi.org/project/delphi-epidata/), and [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R).
-The following samples show how to import the library and fetch national NIDSS Dengue data for epiweeks `201440` and `201501-201510` (11 weeks total).
+Libraries are available for [R](https://cmu-delphi.github.io/epidatr/) and [Python](https://cmu-delphi.github.io/epidatpy/).
+The following samples show how to import the library and fetch national NIDSS Dengue data for epiweeks `201501-201510` (10 weeks total).
-### JavaScript (in a web browser)
+
+
+
+
+
+Install the package using pip:
+```bash
+pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
+```
+
+```python
+# Import
+from epidatpy import CovidcastEpidata, EpiDataContext, EpiRange
+# Fetch data
+epidata = EpiDataContext()
+res = epidata.pub_nidss_dengue(locations=['nationwide'], epiweeks=EpiRange(201501, 201510))
+print(res)
+```
+
+
+
-### Python
+```R
+library(epidatr)
+# Fetch data
+res <- pub_nidss_dengue(locations = 'nationwide', epiweeks = epirange(201501, 201510))
+print(res)
+```
+
+
+
+
+### Legacy Clients
+
+We recommend using the modern client libraries mentioned above. Legacy clients are also available for [Python](https://pypi.org/project/delphi-epidata/), [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R), and [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.js).
+
+
+
+
+
Optionally install the package using pip(env):
-````bash
+```bash
pip install delphi-epidata
-````
+```
Otherwise, place `delphi_epidata.py` from this repo next to your python script.
-````python
+```python
# Import
from delphi_epidata import Epidata
# Fetch data
-res = Epidata.nidss_dengue(['nationwide'], [201440, Epidata.range(201501, 201510)])
+res = Epidata.nidss_dengue(['nationwide'], Epidata.range(201501, 201510))
print(res['result'], res['message'], len(res['epidata']))
-````
+```
-### R
+# Source and Licensing
-````R
-# Import
-source('delphi_epidata.R')
+The full text of the NIDSS Dengue license information is available on the Taiwan Digital Development Department's [website](https://data.gov.tw/license).
+
+
+
+
+Place `delphi_epidata.R` from this repo next to your R script.
+
+```R
+source("delphi_epidata.R")
# Fetch data
-res <- Epidata$nidss_dengue(list('nationwide'), list(201440, Epidata$range(201501, 201510)))
-cat(paste(res$result, res$message, length(res$epidata), "\n"))
-````
+res <- Epidata$nidss_dengue(regions = list("nationwide"), epiweeks = Epidata$range(201501, 201510))
+print(res$message)
+print(length(res$epidata))
+```
+
-# Source and Licensing
+
+
+
+
+```html
+
+
+
+
+```
+
-The full text of the NIDSS Dengue license information is available on the Taiwan Digital Development Department's [website](https://data.gov.tw/license).
\ No newline at end of file
+
diff --git a/docs/api/nidss_flu.md b/docs/api/nidss_flu.md
index d35e991d3..b16ef4873 100644
--- a/docs/api/nidss_flu.md
+++ b/docs/api/nidss_flu.md
@@ -1,57 +1,94 @@
---
-title: inactive NIDSS Flu
-parent: Data Sources and Signals
-grand_parent: Other Endpoints (COVID-19 and Other Diseases)
-nav_order: 2
+parent: Inactive Sources (Other)
+grand_parent: Data Sources and Signals
+title: NIDSS Flu
---
# NIDSS Flu
+{: .no_toc}
-This is the documentation of the API for accessing the Taiwan National Infectious Disease Statistics System Flu (`nidss_flu`) endpoint of
-the [Delphi](https://delphi.cmu.edu/)'s epidemiological data.
+
+| Attribute | Details |
+| :--- | :--- |
+| **Source Name** | `nidss_flu` |
+| **Source** | [Taiwan CDC](http://nidss.cdc.gov.tw/en/CDCWNH01.aspx?dc=wnh) |
+| **Geographic Levels** | Taiwan [hexchotomy regions](https://en.wikipedia.org/wiki/Regions_of_Taiwan#Hexchotomy) (see [Geographic Codes](geographic_codes.html#taiwan-regions)) |
+| **Temporal Granularity** | Weekly (Epiweek) |
+| **Reporting Cadence** | Inactive - No longer updated since 2018w10 |
+| **Temporal Scope Start** | 2008w14 |
+| **License** | [Open Access](https://data.gov.tw/license) |
+
+## Overview
+{: .no_toc}
+
+This endpoint provides weekly influenza case counts for Taiwan, as reported by the Taiwan National Infectious Disease Statistics System (NIDSS) via the Taiwan CDC.
+
+The data is generally released weekly on Tuesday.
+
+{: .warning}
+> **Historical Reporting Quirks**
+>
+> This data source contains historical reporting quirks. See [Limitations](#limitations) for details.
General topics not specific to any particular endpoint are discussed in the
[API overview](README.md). Such topics include:
[contributing](README.md#contributing), [citing](README.md#citing), and
[data licensing](README.md#data-licensing).
-## NIDSS Flu Data
+## Table of contents
+{: .no_toc .text-delta}
+
+1. TOC
+{:toc}
+
+## Estimation
-Outpatient ILI from Taiwan's National Infectious Disease Statistics System (NIDSS).
- - Source: [Taiwan CDC](http://nidss.cdc.gov.tw/en/CDCWNH01.aspx?dc=wnh)
- - Temporal Resolution: Weekly* from 2008w14
- - Spatial Resolution: By [hexchotomy region](https://en.wikipedia.org/wiki/Regions_of_Taiwan#Hexchotomy) ([6+1](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/nidss_regions.txt))
- - Open access
+Data is directly sourced from the Taiwan CDC's National Infectious Disease Statistics System (NIDSS). Delphi does not perform any adjustments or smoothing. The reported metrics include:
+* **`visits`**: The total number of patients visiting outpatient departments (OPD) and emergency rooms (ER) with influenza-like illness.
+* **`ili`**: The percentage of visits due to ILI, calculated as `(ILI Visits / Total Visits) * 100`.
-\* Data is usually released on Tuesday
+
-# The API
+## Lag and Backfill
-The base URL is: https://api.delphi.cmu.edu/epidata/nidss_flu/
+Historical values were revised as new data became available or due to the epiweek adjustments described above.
-See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
+## Limitations
-## Parameters
+{: .warning}
+> **Historical Reporting Quirks**
+>
+> * **Week 53 (2003-2007):** For years prior to 2008 (excluding 2003), week 53 was reported but is mapped to week 52 in this endpoint to maintain standard epiweek numbering.
+> * **2009 Epiweek Change:** Taiwan adopted a new epiweek system in 2009. Data for 2009 is shifted by -1 week (e.g., 2009w02 becomes 2009w01) to align with standard US CDC epiweek definitions.
-### Required
+
+## The API
+
+The base URL is:
+
+
+### Parameters
+
+#### Required
| Parameter | Description | Type |
| --- | --- | --- |
-| `epiweeks` | epiweeks | `list` of epiweeks |
-| `regions` | regions | `list` of [region](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/nidss_regions.txt) labels |
+| `epiweeks` | epiweeks (see [Date Formats](date_formats.html)) | `list` of epiweeks |
+| `regions` | regions | `list` of Taiwan region labels (see [Geographic Codes](geographic_codes.html#taiwan-regions)) |
-### Optional
+#### Optional
| Parameter | Description | Type |
|-----------|--------------------------------------------|--------------------|
-| `issues` | issues | `list` of epiweeks |
+| `issues` | issues (see [Date Formats](date_formats.html)) | `list` of epiweeks |
| `lag` | # weeks between each epiweek and its issue | integer |
-Notes:
-- If both `issues` and `lag` are specified, only `issues` is used.
-If neither is specified, the current issues are used.
+{: .note}
+> **Notes:**
+> - If both `issues` and `lag` are specified, only `issues` is used.
+> - If neither is specified, the current issues are used.
-## Response
+### Response
| Field | Description | Type |
|--------------------------|-----------------------------------------------------------------|------------------|
@@ -66,10 +103,10 @@ If neither is specified, the current issues are used.
| `epidata[].ili` | percent ILI | float |
| `message` | `success` or error message | string |
-# Example URLs
+## Example URLs
### NIDSS Flu on 2015w01 (nationwide)
-https://api.delphi.cmu.edu/epidata/nidss_flu/?regions=nationwide&epiweeks=201501
+
```json
{
@@ -90,51 +127,107 @@ https://api.delphi.cmu.edu/epidata/nidss_flu/?regions=nationwide&epiweeks=201501
```
-# Code Samples
+## Code Samples
-Libraries are available for [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/main/src/client/delphi_epidata.js), [Python](https://pypi.org/project/delphi-epidata/), and [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R).
-The following samples show how to import the library and fetch national NIDSS Flu data for epiweeks `201440` and `201501-201510` (11 weeks total).
+Libraries are available for [R](https://cmu-delphi.github.io/epidatr/) and [Python](https://cmu-delphi.github.io/epidatpy/).
+The following samples show how to import the library and fetch national NIDSS Flu data for epiweeks `201501-201510` (10 weeks total).
-### JavaScript (in a web browser)
+
+
+
+
+
+Install the package using pip:
+```bash
+pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
+```
+
+```python
+# Import
+from epidatpy import CovidcastEpidata, EpiDataContext, EpiRange
+# Fetch data
+epidata = EpiDataContext()
+res = epidata.pub_nidss_flu(regions=['nationwide'], epiweeks=EpiRange(201501, 201510))
+print(res)
+```
+
+
+
-### Python
+```R
+library(epidatr)
+# Fetch data
+res <- pub_nidss_flu(regions = 'nationwide', epiweeks = epirange(201501, 201510))
+print(res)
+```
+
+
+
+
+### Legacy Clients
+
+We recommend using the modern client libraries mentioned above. Legacy clients are also available for [Python](https://pypi.org/project/delphi-epidata/), [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R), and [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.js).
+
+
+
+
+
Optionally install the package using pip(env):
-````bash
+```bash
pip install delphi-epidata
-````
+```
Otherwise, place `delphi_epidata.py` from this repo next to your python script.
-````python
+```python
# Import
from delphi_epidata import Epidata
# Fetch data
-res = Epidata.nidss_flu(['nationwide'], [201440, Epidata.range(201501, 201510)])
+res = Epidata.nidss_flu(['nationwide'], Epidata.range(201501, 201510))
print(res['result'], res['message'], len(res['epidata']))
-````
+```
+
+# Source and Licensing
-### R
+The full text of the NIDSS Flu license information is available on the Taiwan Digital Development Department's [website](https://data.gov.tw/license).
+
-````R
-# Import
-source('delphi_epidata.R')
+
+
+Place `delphi_epidata.R` from this repo next to your R script.
+
+```R
+source("delphi_epidata.R")
# Fetch data
-res <- Epidata$nidss_flu(list('nationwide'), list(201440, Epidata$range(201501, 201510)))
-cat(paste(res$result, res$message, length(res$epidata), "\n"))
-````
+res <- Epidata$nidss_flu(regions = list("nationwide"), epiweeks = Epidata$range(201501, 201510))
+print(res$message)
+print(length(res$epidata))
+```
+
-# Source and Licensing
+
+
+
+
+```html
+
+
+
+
+```
+
-The full text of the NIDSS Flu license information is available on the Taiwan Digital Development Department's [website](https://data.gov.tw/license).
\ No newline at end of file
+
diff --git a/docs/api/norostat.md b/docs/api/norostat.md
index 80c289c84..442326ce0 100644
--- a/docs/api/norostat.md
+++ b/docs/api/norostat.md
@@ -1,51 +1,201 @@
---
-title: inactive NoroSTAT
-parent: Data Sources and Signals
-grand_parent: Other Endpoints (COVID-19 and Other Diseases)
-nav_order: 2
+parent: Inactive Sources (Other)
+grand_parent: Data Sources and Signals
+title: NoroSTAT
---
# NoroSTAT
+{: .no_toc}
-This is the documentation of the API for accessing the NoroSTAT (`norostat`) endpoint of
-the [Delphi](https://delphi.cmu.edu/)'s epidemiological data.
+
+| Attribute | Details |
+| :--- | :--- |
+| **Source Name** | `norostat` |
+| **Data Source** | [CDC NoroSTAT](https://www.cdc.gov/norovirus/php/reporting/norostat-data.html) metadata endpoint (requires authentication) |
+| **Dataset Type** | Surveillance (Inactive) |
+| **Geographic Levels** | Only a specific list of full state names are permitted. See the `locations` output of the [meta_norostat](norostat_meta.md#norostat-metadata-1) endpoint for the allowed values. |
+| **Temporal Granularity** | Weekly (Epiweek) |
+| **Reporting Cadence** | Inactive - No longer updated since 2020w30. |
+| **Temporal Scope Start** | 2012w31 |
+| **License** | [Publicly Accessible US Government](https://www.usa.gov/government-works) |
+
+## Overview
+{: .no_toc}
+
+This data source provides norovirus surveillance data for US states, collected through the NoroSTAT system via the US CDC.
General topics not specific to any particular endpoint are discussed in the
[API overview](README.md). Such topics include:
[contributing](README.md#contributing), [citing](README.md#citing), and
[data licensing](README.md#data-licensing).
-**NOTE**: Delphi stopped stopped acquiring data from this data source in November 2020.
+{: .note}
+> **Note:** Restricted access: This endpoint requires authentication.
+
+## Table of contents
+{: .no_toc .text-delta}
+
+1. TOC
+{:toc}
+
+## Estimation
+
+NoroSTAT data is derived from the CDC's sentinel surveillance system, which tracks norovirus outbreaks in participating states. The `value` field represents raw outbreak counts.
+
+Outbreak reports are aggregated weekly. No additional smoothing or statistical adjustments are applied by Delphi.
+
+## Lag and Backfill
+
+* **Lag:** Historically, data was released with a lag of several weeks.
+* **Backfill:** NoroSTAT data was subject to revisions as new reports were finalized or historical data was updated by participating states. The API tracks these revisions via the `release_date`.
+
+## Limitations
+
+* Data is only available for specific lists of participating states. Use the [NoroSTAT Metadata](norostat_meta.md) endpoint to check available locations.
+
+
+## The API
+
+The base URL is:
+
+
+### Parameters
+
+#### Required
+
+| Parameter | Description | Type |
+| --- | --- | --- |
+| `auth` | password | string |
+| `epiweeks` | epiweeks (see [Date Formats](date_formats.html)) | `list` of epiweeks |
+| `location` | Location string. Must be an exact match from the `location` field of the [NoroSTAT Metadata](norostat_meta.md) endpoint. | string |
+
+### 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[].release_date` | date when data was released | date (YYYY-MM-DD)|
+| `epidata[].epiweek` | epiweek for the data point | integer |
+| `epidata[].value` | count of norovirus outbreaks | integer |
+| `message` | `success` or error message | string |
+
+## Example URLs
+
+### NoroSTAT on 2015w01
+
+
+```json
+{
+ "result": 1,
+ "epidata": [
+ {
+ "release_date": "2014-10-21",
+ "epiweek": 201233,
+ "value": 2
+ }
+ ],
+ "message": "success"
+}
+```
+
+## Code Samples
+
+Libraries are available for [R](https://cmu-delphi.github.io/epidatr/) and [Python](https://cmu-delphi.github.io/epidatpy/).
+The following samples show how to import the library and fetch NoroSTAT data for the most recent available states for epiweek `201501`.
-## NoroSTAT Data
+
+
-# The API
+
-The base URL is: https://api.delphi.cmu.edu/epidata/norostat/
+Install the package using pip:
+```bash
+pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
+```
-See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
+```python
+# Import
+from epidatpy import CovidcastEpidata, EpiDataContext, EpiRange
+# Fetch data
+epidata = EpiDataContext()
+res = epidata.pvt_norostat(auth='auth_token', locations=['Minnesota, Ohio, Oregon, Tennessee, and Wisconsin'], epiweeks=[201501])
+print(res)
+```
+
-## Parameters
+
-### Required
+```R
+library(epidatr)
+# Fetch data
+res <- pvt_norostat(auth = 'auth_token', locations = 'Minnesota, Ohio, Oregon, Tennessee, and Wisconsin', epiweeks = 201501)
+print(res)
+```
+
-
+
-## Response
+### Legacy Clients
-| Field | Description | Type |
-|-----------|-----------------------------------------------------------------|------------------|
-| `result` | result code: 1 = success, 2 = too many results, -2 = no results | integer |
-| `epidata` | list of results | array of objects |
-| ... | ... | ... |
-| `message` | `success` or error message | string |
+We recommend using the modern client libraries mentioned above. Legacy clients are also available for [Python](https://pypi.org/project/delphi-epidata/), [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R), and [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.js).
-# Example URLs
+
+
-
+
-# Code Samples
+Optionally install the package using pip(env):
+```bash
+pip install delphi-epidata
+```
+
+Otherwise, place `delphi_epidata.py` from this repo next to your python script.
+
+```python
+# Import
+from delphi_epidata import Epidata
+# Fetch data
+res = Epidata.norostat('auth_token', ['Minnesota, Ohio, Oregon, Tennessee, and Wisconsin'], [201501])
+print(res['result'], res['message'], len(res['epidata']))
+```
+
+
+
+
+Place `delphi_epidata.R` from this repo next to your R script.
+
+```R
+source("delphi_epidata.R")
+# Fetch data
+res <- Epidata$norostat(auth = "auth_token", locations = list("Minnesota, Ohio, Oregon, Tennessee, and Wisconsin"), epiweeks = list(201501))
+print(res$message)
+print(length(res$epidata))
+```
+
+
+
+
+
+
+```html
+
+
+
+
+```
+
-
+
diff --git a/docs/api/norostat_meta.md b/docs/api/norostat_meta.md
index 47b99dfd0..ec3ebc66d 100644
--- a/docs/api/norostat_meta.md
+++ b/docs/api/norostat_meta.md
@@ -1,50 +1,199 @@
---
-title: inactive NoroSTAT Metadata
-parent: Data Sources and Signals
-grand_parent: Other Endpoints (COVID-19 and Other Diseases)
-nav_order: 2
+parent: Inactive Sources (Other)
+grand_parent: Data Sources and Signals
+title: NoroSTAT Metadata
permalink: api/meta_norostat.html
---
# NoroSTAT Metadata
+{: .no_toc}
-This is the documentation of the API for accessing the NoroSTAT Metadata (`meta_norostat`) endpoint of
-the [Delphi](https://delphi.cmu.edu/)'s epidemiological data.
+
+| Attribute | Details |
+| :--- | :--- |
+| **Source Name** | `meta_norostat` |
+| **Data Source** | [CDC NoroSTAT](https://www.cdc.gov/norovirus/php/reporting/norostat-data.html) |
+| **Reporting Cadence** | Inactive - Delphi stopped stopped acquiring data from this data source in November 2020. |
+| **License** | [Publicly Accessible US Government](https://www.usa.gov/government-works) |
+
+## Overview
+{: .no_toc}
+
+This endpoint is a companion data source to the [NoroSTAT](norostat.md) endpoint.
+It describes when the NoroSTAT endpoint was last updated and for which locations.
General topics not specific to any particular endpoint are discussed in the
[API overview](README.md). Such topics include:
[contributing](README.md#contributing), [citing](README.md#citing), and
[data licensing](README.md#data-licensing).
-## NoroSTAT Metadata
-
-...
-
-# The API
-
-The base URL is: https://api.delphi.cmu.edu/epidata/meta_norostat/
-
-See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
-
-## Parameters
-
-### Required
-
-
-
-## Response
-
-| Field | Description | Type |
-|-----------|-----------------------------------------------------------------|------------------|
-| `result` | result code: 1 = success, 2 = too many results, -2 = no results | integer |
-| `epidata` | list of results | array of objects |
-| ... | ... | ... |
-| `message` | `success` or error message | string |
-
-# Example URLs
-
-
-
-# Code Samples
+{: .note}
+> **Note:** Restricted access: This endpoint requires authentication.
+
+## Table of contents
+{: .no_toc .text-delta}
+
+1. TOC
+{:toc}
+
+
+## The API
+
+The base URL is:
+
+
+### Parameters
+
+#### Required
+
+| Parameter | Description | Type |
+| --- | --- | --- |
+| `auth` | password | string |
+
+### Response
+
+| Field | Description | Type |
+|-------------------------------|-----------------------------------------------------------------|------------------|
+| `result` | result code: 1 = success, 2 = too many results, -2 = no results | integer |
+| `epidata` | metadata object containing locations and releases | object |
+| `epidata.locations` | list of location sets available over time | array of objects |
+| `epidata.locations[].location`| comma-separated list of state names available in this release | string |
+| `epidata.releases` | list of data release dates | array of objects |
+| `epidata.releases[].release_date` | date when data was released (YYYY-MM-DD) | string |
+| `message` | `success` or error message | string |
+
+## Example URLs
+
+### NoroSTAT Metadata
+
+
+```json
+{
+ "result": 1,
+ "epidata": {
+ "locations": [
+ {
+ "location": "Massachusetts, Michigan, Minnesota, Nebraska, New Mexico, Ohio, Oregon, South Carolina, Tennessee, Virginia, Wisconsin, and Wyoming"
+ },
+ {
+ "location": "Massachusetts, Michigan, Minnesota, New Mexico, Ohio, Oregon, South Carolina, Tennessee, Virginia, Wisconsin, and Wyoming"
+ },
+ {
+ "location": "Massachusetts, Michigan, Minnesota, Ohio, Oregon, South Carolina, Tennessee, Virginia, and Wisconsin"
+ },
+ {
+ "location": "Michigan, Minnesota, Ohio, Oregon, South Carolina, Tennessee, and Wisconsin"
+ },
+ {
+ "location": "Minnesota, Ohio, Oregon, Tennessee, and Wisconsin"
+ }
+ ],
+ "releases": [
+ {"release_date": "2014-10-21"},
+ {"release_date": "2015-03-30"},
+ ...]
+ },
+ "message": "success"
+}
+```
+
+## Code Samples
+
+Libraries are available for [R](https://cmu-delphi.github.io/epidatr/) and [Python](https://cmu-delphi.github.io/epidatpy/).
+The following samples show how to import the library and fetch NoroSTAT Metadata.
+
+
+
+
+
+
+Install the package using pip:
+```bash
+pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
+```
+
+```python
+# Import
+from epidatpy import CovidcastEpidata, EpiDataContext, EpiRange
+# Fetch data
+epidata = EpiDataContext()
+res = epidata.pvt_meta_norostat(auth='auth_token')
+print(res)
+```
+
+
+
+
+```R
+library(epidatr)
+# Fetch data
+res <- pvt_meta_norostat(auth = 'auth_token')
+print(res)
+```
+
+
+
+
+### Legacy Clients
+
+We recommend using the modern client libraries mentioned above. Legacy clients are also available for [Python](https://pypi.org/project/delphi-epidata/), [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R), and [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.js).
+
+
+
+
+
+
+Optionally install the package using pip(env):
+```bash
+pip install delphi-epidata
+```
+
+Otherwise, place `delphi_epidata.py` from this repo next to your python script.
+
+```python
+# Import
+from delphi_epidata import Epidata
+# Fetch data
+res = Epidata.meta_norostat('auth_token')
+print(res['result'], res['message'], len(res['epidata']))
+```
+
+
+
+
+Place `delphi_epidata.R` from this repo next to your R script.
+
+```R
+source("delphi_epidata.R")
+# Fetch data
+res <- Epidata$meta_norostat(auth = "auth_token")
+print(res$message)
+print(length(res$epidata))
+```
+
+
+
+
+
+
+```html
+
+
+
+
+```
+
-
+
diff --git a/docs/api/paho_dengue.md b/docs/api/paho_dengue.md
index 70d3bb300..917a24848 100644
--- a/docs/api/paho_dengue.md
+++ b/docs/api/paho_dengue.md
@@ -1,49 +1,214 @@
---
-title: inactive PAHO Dengue
-parent: Data Sources and Signals
-grand_parent: Other Endpoints (COVID-19 and Other Diseases)
-nav_order: 2
+parent: Inactive Sources (Other)
+grand_parent: Data Sources and Signals
+title: PAHO Dengue
---
# PAHO Dengue
+{: .no_toc}
-This is the documentation of the API for accessing the PAHO Dengue (`paho_dengue`) endpoint of
-the [Delphi](https://delphi.cmu.edu/)'s epidemiological data.
+
+| Attribute | Details |
+| :--- | :--- |
+| **Source Name** | `paho_dengue` |
+| **Data Source** | [Pan American Health Organization (PAHO) Dengue surveillance](https://www.paho.org/en/arbo-portal/dengue-data-and-analysis) |
+| **Geographic Levels** | Countries and territories in the Americas (see [Geographic Codes](geographic_codes.md#countries-and-territories-in-the-americas))
*Note: Data availability varies by country.* |
+| **Temporal Granularity** | Weekly (Epiweek) |
+| **Reporting Cadence** | Inactive - No longer updated since 2020w31 |
+| **Temporal Scope Start** | 2014w01 |
+| **License** | This was scraped from a publicly-accessible website, but no explicit license terms were found. |
+
+## Overview
+{: .no_toc}
+
+This endpoint provides weekly dengue case counts for countries and territories in the Americas, as reported by the Pan American Health Organization (PAHO).
General topics not specific to any particular endpoint are discussed in the
[API overview](README.md). Such topics include:
[contributing](README.md#contributing), [citing](README.md#citing), and
[data licensing](README.md#data-licensing).
-## PAHO Dengue Data
+## Table of contents
+{: .no_toc .text-delta}
+
+1. TOC
+{:toc}
+
+## Estimation
+
+Data is scraped from PAHO epidemiological reports. The endpoint exposes cumulative counts per calendar year for each country.
+
+The available indicators include:
+* **`num_dengue`**: Total cumulative cases of dengue.
+* **`num_severe`**: Cumulative cases of severe dengue.
+* **`num_deaths`**: Cumulative dengue-related deaths.
+* **`incidence_rate`**: Incidence rate per 100,000 population, calculated as `(num_dengue / total_pop) * 100` (where `total_pop` is in thousands).
+
+No additional smoothing or statistical adjustments are applied by Delphi.
+
+## Lag and Backfill
+
+* **Lag:** Historically, data was updated weekly but with varying reporting lags depending on the country or territory.
+* **Backfill:** Historical values were subject to revisions by PAHO as more laboratory confirmations were finalized. Delphi tracks these via the `issue` and `release_date`.
+
+## Limitations
+
+* Not all countries report all metrics (e.g., severe cases or deaths) consistently every week.
+
+
+
+## The API
+
+The base URL is:
+
+
+### Parameters
+
+#### Required
+
+| Parameter | Description | Type |
+| --- | --- | --- |
+| `epiweeks` | epiweeks (see [Date Formats](date_formats.md)) | `list` of epiweeks |
+| `regions` | regions | `list` of region labels (see [Geographic Codes](geographic_codes.md#paho-dengue)) |
-...
+### Response
-# The API
+| Field | Description | Type |
+|------------------------------|-----------------------------------------------------------------|------------------|
+| `result` | result code: 1 = success, 2 = too many results, -2 = no results | integer |
+| `epidata` | list of results | array of objects |
+| `epidata[].release_date` | date when data was released | date (YYYY-MM-DD)|
+| `epidata[].region` | region label (ISO 3166-1 alpha-2 code) | string |
+| `epidata[].serotype` | dengue serotype information | string |
+| `epidata[].issue` | epiweek when data was issued | integer |
+| `epidata[].epiweek` | epiweek for the data point | integer |
+| `epidata[].lag` | number of weeks between epiweek and issue | integer |
+| `epidata[].total_pop` | total population (in thousands) | integer |
+| `epidata[].num_dengue` | total number of dengue cases | integer |
+| `epidata[].num_severe` | number of severe dengue cases | integer |
+| `epidata[].num_deaths` | number of dengue-related deaths | integer |
+| `epidata[].incidence_rate` | incidence rate per 100,000 population | float |
+| `message` | `success` or error message | string |
-The base URL is: https://api.delphi.cmu.edu/epidata/paho_dengue/
+## Example URLs
-See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
+### PAHO Dengue on 2015w01 (Canada)
+
-## Parameters
+```json
+{
+ "result": 1,
+ "epidata": [
+ {
+ "release_date": "2020-08-07",
+ "region": "CA",
+ "serotype": " ",
+ "issue": 202032,
+ "epiweek": 201501,
+ "lag": 291,
+ "total_pop": 0,
+ "num_dengue": 0,
+ "num_severe": 0,
+ "num_deaths": 0,
+ "incidence_rate": 0.0
+ }
+ ],
+ "message": "success"
+}
+```
-### Required
+## Code Samples
-
+Libraries are available for [R](https://cmu-delphi.github.io/epidatr/) and [Python](https://cmu-delphi.github.io/epidatpy/).
+The following samples show how to import the library and fetch PAHO Dengue data for Canada for epiweek `201501`.
-## Response
+
+
-# Example URLs
+
-
+Install the package using pip:
+```bash
+pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
+```
-# Code Samples
+```python
+# Import
+from epidatpy import CovidcastEpidata, EpiDataContext, EpiRange
+# Fetch data
+epidata = EpiDataContext()
+res = epidata.pub_paho_dengue(regions=['ca'], epiweeks=[201501])
+print(res)
+```
+
-
+
+
+```R
+library(epidatr)
+# Fetch data
+res <- pub_paho_dengue(regions = 'ca', epiweeks = 201501)
+print(res)
+```
+
+
+
+
+### Legacy Clients
+
+We recommend using the modern client libraries mentioned above. Legacy clients are also available for [Python](https://pypi.org/project/delphi-epidata/), [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R), and [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.js).
+
+
+
+
+
+
+Place `delphi_epidata.py` from this repo next to your python script.
+
+```python
+# Import
+from delphi_epidata import Epidata
+# Fetch data
+res = Epidata.paho_dengue(['ca'], [201501])
+print(res['result'], res['message'], len(res['epidata']))
+```
+
+
+
+
+Place `delphi_epidata.R` from this repo next to your R script.
+
+```R
+source("delphi_epidata.R")
+# Fetch data
+res <- Epidata$paho_dengue(regions = list("ca"), epiweeks = list(201501))
+print(res$message)
+print(length(res$epidata))
+```
+
+
+
+
+
+
+```html
+
+
+
+
+```
+
+
+
diff --git a/docs/api/quidel.md b/docs/api/quidel.md
index 28655e219..25274a0f0 100644
--- a/docs/api/quidel.md
+++ b/docs/api/quidel.md
@@ -1,41 +1,199 @@
---
-title: inactive Quidel
-parent: Data Sources and Signals
-grand_parent: Other Endpoints (COVID-19 and Other Diseases)
-nav_order: 2
+parent: Inactive Sources (Other)
+grand_parent: Data Sources and Signals
+title: Quidel
---
# Quidel
+{: .no_toc}
-This is the documentation of the API for accessing the Quidel (`quidel`) endpoint of the Delphi’s epidemiological data.
+
+| Attribute | Details |
+| :--- | :--- |
+| **Source Name** | `quidel` |
+| **Data Source** | QuidelOrtho Corp. influenza testing data |
+| **Geographic Levels** | Department of Health & Human Services (HHS) Regions (see [Geographic Codes](geographic_codes.md#hhs-regions)) |
+| **Temporal Granularity** | Weekly (Epiweek) |
+| **Reporting Cadence** | Inactive - No longer updated since 2020w15|
+| **Temporal Scope Start** | 2015w35 |
+| **License** | Permission by QuidelOrtho |
+
+## Overview
+{: .no_toc}
+
+This data source provides influenza testing data from Quidel Corporation, covering HHS health regions. Data is aggregated by unique device. Covers US states (excluding some like FL in older mappings).
General topics not specific to any particular endpoint are discussed in the [API overview](https://cmu-delphi.github.io/delphi-epidata/). Such topics include: [contributing](https://cmu-delphi.github.io/delphi-epidata/api/README.html#contributing), [citing](https://cmu-delphi.github.io/delphi-epidata/api/README.html#citing), and [data licensing](https://cmu-delphi.github.io/delphi-epidata/api/README.html#data-licensing).
-## Quidel Data
+{: .note}
+> **Note:** Restricted access: This endpoint requires authentication.
+
+## Table of contents
+{: .no_toc .text-delta}
+
+1. TOC
+{:toc}
-Data provided by Quidel Corp., which contains flu lab test results.
+## Estimation
+
+Data is aggregated from Quidel's network and reports the average number of test records per unique device within the given HHS region and epiweek:
+
+$$Value = \frac{\text{Total Test Records}}{\text{Number of Unique Devices}}$$
+
+{: .important }
+> This metric reflects the average testing volume per device, not the positivity rate.
+
+For further details on data processing, lag, and limitations, please refer to the [main endpoint documentation regarding Quidel data](covidcast-signals/quidel.md).
## The API
-The base URL is: https://api.delphi.cmu.edu/epidata/quidel/
+The base URL is:
See this [documentation](https://cmu-delphi.github.io/delphi-epidata/api/README.html) for details on specifying epiweeks, dates, and lists.
-## Parameters
+### Parameters
-### Required
+#### Required
| Parameter | Description | Type |
| --- | --- | --- |
| `auth` | password | string |
-| `epiweeks` | epiweeks | `list` of epiweeks |
-| `locations` | locations | `list` of `hhs<#>` [region](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/regions.txt) labels |
+| `epiweeks` | epiweeks (see [Date Formats](date_formats.md)) | `list` of epiweeks |
+| `locations` | locations | `list` of `hhs<#>` region labels (see [Geographic Codes](geographic_codes.md#hhs-regions)) |
+
+### 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[].location` | HHS region label | string |
+| `epidata[].epiweek` | epiweek for the data point | integer |
+| `epidata[].value` | average number of test records per unique facility | float |
+| `message` | `success` or error message | string |
+
+## Example URLs
+
+### Quidel on 2015w35-2020w01 (HHS Region 1)
+
+
+```json
+{
+ "result": 1,
+ "epidata": [
+ {
+ "location": "hhs1",
+ "epiweek": 201535,
+ "value": 2.0
+ },
+ {
+ "location": "hhs1",
+ "epiweek": 201536,
+ "value": 6.16667
+ },
+ ...
+ ],
+ "message": "success"
+}
+```
+
+## Code Samples
+
+Libraries are available for [R](https://cmu-delphi.github.io/epidatr/) and [Python](https://cmu-delphi.github.io/epidatpy/).
+The following samples show how to import the library and fetch Quidel data for HHS Region 1 for epiweeks `201535-202001`.
+
+
+
+
+
+
+Install the package using pip:
+```bash
+pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
+```
+
+```python
+# Import
+from epidatpy import CovidcastEpidata, EpiDataContext, EpiRange
+# Fetch data
+epidata = EpiDataContext()
+res = epidata.pvt_quidel(auth='auth_token', locations=['hhs1'], epiweeks=EpiRange(201535, 202001))
+print(res)
+```
+
+
+
+
+```R
+library(epidatr)
+# Fetch data
+res <- pvt_quidel(auth = 'auth_token', locations = 'hhs1', epiweeks = epirange(201535, 202001))
+print(res)
+```
+
+
+
+
+### Legacy Clients
+
+We recommend using the modern client libraries mentioned above. Legacy clients are also available for [Python](https://pypi.org/project/delphi-epidata/), [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R), and [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.js).
+
+
+
+
+
+
+Optionally install the package using pip(env):
+```bash
+pip install delphi-epidata
+```
+
+Otherwise, place `delphi_epidata.py` from this repo next to your python script.
+
+```python
+# Import
+from delphi_epidata import Epidata
+# Fetch data
+res = Epidata.quidel('auth_token', ['hhs1'], Epidata.range(201535, 202001))
+print(res['result'], res['message'], len(res['epidata']))
+```
+
+
+
+
+Place `delphi_epidata.R` from this repo next to your R script.
+
+```R
+source("delphi_epidata.R")
+# Fetch data
+res <- Epidata$quidel(auth = "auth_token", locations = list("hhs1"), epiweeks = Epidata$range(201535, 202001))
+print(res$message)
+print(length(res$epidata))
+```
+
+
+
+
+
-## Response
+```html
+
+
+
+
+```
+
-| Field | Description | Type |
-|-----------|-----------------------------------------------------------------|------------------|
-| `result` | result code: 1 = success, 2 = too many results, -2 = no results | integer |
-| `epidata` | list of results | array of objects |
-| ... | ... | ... |
-| `message` | `success` or error message | string |
\ No newline at end of file
+
diff --git a/docs/api/twitter.md b/docs/api/twitter.md
index e14d940b6..8b7190992 100644
--- a/docs/api/twitter.md
+++ b/docs/api/twitter.md
@@ -1,77 +1,223 @@
---
-title: inactive Twitter Stream
-parent: Data Sources and Signals
-grand_parent: Other Endpoints (COVID-19 and Other Diseases)
-nav_order: 2
+parent: Inactive Sources (Other)
+grand_parent: Data Sources and Signals
+title: Twitter Stream
---
# Twitter Stream
+{: .no_toc}
-This is the API documentation for accessing the Twitter Stream (`twitter`)
-endpoint of [Delphi](https://delphi.cmu.edu/)'s epidemiological data.
+
+| Attribute | Details |
+| :--- | :--- |
+| **Source Name** | `twitter` |
+| **Data Source** | [HealthTweets](http://www.healthtweets.org/) |
+| **Geographic Levels** | National, Department of Health & Human Services (HHS) Regions, Census Divisions, State (see [Geographic Codes](geographic_codes.md#us-regions-and-states)) |
+| **Temporal Granularity** | Daily and Weekly (Epiweek) |
+| **Reporting Cadence** | Inactive - No longer updated since 2020w31 (2020-12-07)|
+| **Temporal Scope Start** | 2011w48 (2011-11-27) |
+
+
+
+## Overview
+{: .no_toc}
+
+This data source provides estimates of influenza activity derived from the content of public Twitter posts. The data was processed by HealthTweets.org using natural language processing (NLP) to classify tweets as flu-related.
General topics not specific to any particular endpoint are discussed in the
[API overview](README.md). Such topics include:
[contributing](README.md#contributing), [citing](README.md#citing), and
[data licensing](README.md#data-licensing).
-## Twitter Stream Data
+{: .note}
+> **Note:** Restricted access: This endpoint requires authentication.
-Estimate of influenza activity based on analysis of language used in tweets.
- - Source: [HealthTweets](http://www.healthtweets.org/)
- - Temporal Resolution: Daily and weekly from 2011-12-01 (2011w48)
- - Spatial Resolution: National, [HHS regions](http://www.hhs.gov/iea/regional/), and [Census divisions](http://www.census.gov/econ/census/help/geography/regions_and_divisions.html) ([1+10+9](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/regions.txt)); and by state/territory ([51](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/states.txt))
- - Restricted access: Delphi doesn't have permission to share this dataset
+## Table of contents
+{: .no_toc .text-delta}
-# The API
+1. TOC
+{:toc}
-The base URL is: https://api.delphi.cmu.edu/epidata/twitter/
-See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
+## Estimation
-## Parameters
+The classification and processing pipeline involves several stages to transform raw Twitter data into health trends:
-### Required
+1. **Data Collection**: Two streams are collected via the Twitter Streaming API:
+ * **HEALTH Stream**: Capped at 1% of public tweets, filtered using 269 health-related keywords.
+ * **SAMPLE Stream**: A random 1% sample of all public tweets.
+2. **Classification**: A statistical classifier identifies health-related tweets within the HEALTH stream (estimated F1-score of 0.70). These are further processed to distinguish actual influenza reports from general awareness or concern.
+3. **Geolocation**: Every identified health tweet and every tweet from the SAMPLE stream is geolocated using **Carmen**, which resolves location down to the city level using profile data and geotags.
+4. **Normalization**: The volume of identified influenza infections (`num`) is normalized by the total volume of tweets from the same location in the SAMPLE stream (`total`) to calculate the prevalence (`percent`).
+5. **Gap Filling**: Missing data (e.g., due to network interruptions) is estimated based on adjacent days.
-| Parameter | Description | Type |
-| --- | --- | --- |
-| `auth` | password | string |
-| `locations` | locations | `list` of [region](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/regions.txt)/[state](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/states.txt) labels |
-| `dates` | dates | `list` of dates |
-| `epiweeks` | epiweeks | `list` of epiweeks |
+For more technical details, see the [research paper below](#citing-the-survey).
+
+## Limitations
+
+* Highly dependent on Twitter's API access and terms of service, which have changed significantly.
+* Twitter users are not a representative sample of the general population.
-Note:
-- Only one of `dates` and `epiweeks` is required. If both are provided, `epiweeks` is ignored.
+## The API
-## Response
+The base URL is:
-| Field | Description | Type |
-|-----------|-----------------------------------------------------------------|------------------|
-| `result` | result code: 1 = success, 2 = too many results, -2 = no results | integer |
-| `epidata` | list of results | array of objects |
-| ... | ... | ... |
-| `message` | `success` or error message | string |
-# Example URLs
+### Parameters
+
+#### Required
+
+| Parameter | Description | Type |
+| --- | --- | --- |
+| `auth` | password | string |
+| `locations` | locations | `list` of location codes: `nat`, HHS regions, Census divisions, or state codes (see [Geographic Codes](geographic_codes.md#us-regions-and-states)) |
+| `dates` | dates (see [Date Formats](date_formats.md)) | `list` of dates |
+| `epiweeks` | epiweeks (see [Date Formats](date_formats.md)) | `list` of epiweeks |
+
+{: .note}
+> **Note:** Only one of `dates` and `epiweeks` is required. If both are provided, `epiweeks` is ignored.
+
+### 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[].location` | location label | string |
+| `epidata[].date` | date (yyyy-MM-dd) | string |
+| `epidata[].epiweek` | epiweek | integer |
+| `epidata[].num` | number of flu-related tweets in the HEALTH stream (see [Methodology](#methodology)) | integer |
+| `epidata[].total` | total number of tweets in the random SAMPLE stream for the same location | integer |
+| `epidata[].percent` | flu-related tweets normalized based on the number
+of tweets in SAMPLE | float |
+| `message` | `success` or error message | string |
+
+## Example URLs
### Twitter on 2015w01 (national)
-https://api.delphi.cmu.edu/epidata/twitter/?auth=...&locations=nat&epiweeks=201501
+
```json
{
- "result":1,
- "epidata":[...],
- "message":"success"
+ "result": 1,
+ "epidata": [
+ {
+ "location": "nat",
+ "num": 3067,
+ "total": 443291,
+ "epiweek": 201501,
+ "percent": 0.6919
+ }
+ ],
+ "message": "success"
}
```
# Citing the Survey
Researchers who use the Twitter Stream data for research are asked to credit and cite the survey in publications based on the data. Specifically, we ask that you cite our paper describing the survey:
- > Mark Dredze, Renyuan Cheng, Michael J Paul, David A Broniatowski. HealthTweets.org: A Platform for Public Health Surveillance using Twitter. AAAI Workshop on the World Wide Web and Public Health
+ > Mark Dredze, Renyuan Cheng, Michael J Paul, David A Broniatowski. HealthTweets.org: A Platform for Public Health Surveillance using Twitter. AAAI Workshop on the World Wide Web and Public Health
> Intelligence, 2014.
-
-# Code Samples
-
+## Code Samples
+
+Libraries are available for [R](https://cmu-delphi.github.io/epidatr/) and [Python](https://cmu-delphi.github.io/epidatpy/).
+The following samples show how to import the library and fetch Twitter data for national level for epiweek `201501`.
+
+
+
+
+
+
+Install the package using pip:
+```bash
+pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
+```
+
+```python
+# Import
+from epidatpy import CovidcastEpidata, EpiDataContext, EpiRange
+# Fetch data
+epidata = EpiDataContext()
+res = epidata.pvt_twitter(auth='auth_token', locations=['nat'], time_type="week", time_values=[201501])
+print(res)
+```
+
+
+
+
+```R
+library(epidatr)
+# Fetch data
+res <- pvt_twitter(auth = 'auth_token', locations = 'nat',
+ time_type = "week", time_values = 201501)
+print(res)
+```
+
+
+
+
+### Legacy Clients
+
+We recommend using the modern client libraries mentioned above. Legacy clients are also available for [Python](https://pypi.org/project/delphi-epidata/), [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R), and [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.js).
+
+
+
+
+
+
+Optionally install the package using pip(env):
+```bash
+pip install delphi-epidata
+```
+
+Otherwise, place `delphi_epidata.py` from this repo next to your python script.
+
+```python
+# Import
+from delphi_epidata import Epidata
+# Fetch data
+res = Epidata.twitter('auth_token', ['nat'], time_type="week", time_values=[201501])
+print(res['result'], res['message'], len(res['epidata']))
+```
+
+
+
+
+Place `delphi_epidata.R` from this repo next to your R script.
+
+```R
+source("delphi_epidata.R")
+# Fetch data
+res <- Epidata$twitter(auth = "auth_token", locations = list("nat"), time_type = "week", time_values = list(201501))
+print(res$message)
+print(length(res$epidata))
+```
+
+
+
+
+
+
+```html
+
+
+
+
+```
+
+
+
diff --git a/docs/api/wiki.md b/docs/api/wiki.md
index ba780ea6f..91ccb91dd 100644
--- a/docs/api/wiki.md
+++ b/docs/api/wiki.md
@@ -1,74 +1,231 @@
---
-title: inactive Wikipedia Access
-parent: Data Sources and Signals
-grand_parent: Other Endpoints (COVID-19 and Other Diseases)
-nav_order: 2
+parent: Inactive Sources (Other)
+grand_parent: Data Sources and Signals
+title: Wikipedia Access
---
# Wikipedia Access
+{: .no_toc}
-This is the API documentation for accessing the Wikipedia Access (`wiki`)
-endpoint of [Delphi](https://delphi.cmu.edu/)'s epidemiological data.
+
+| Attribute | Details |
+| :--- | :--- |
+| **Source Name** | `wiki` |
+| **Data Source** | [Wikimedia pageviews](https://dumps.wikimedia.org/other/pagecounts-raw/) for health-related Wikipedia articles |
+| **Geographic Levels** | Not applicable (article-based) |
+| **Temporal Granularity** | Hourly, Daily, and Weekly (Epiweek) |
+| **Available Articles** | [54 health-related articles](#available-articles) |
+| **Reporting Cadence** | Inactive - No longer updated since 2021w11|
+| **Temporal Scope Start** | 2007w50 (December 9th, 2007) |
+| **License** | [CC BY-SA](https://creativecommons.org/licenses/by-sa/4.0/) |
+
+
+## Overview
+{: .no_toc}
+
+This data source measures public interest in health topics by tracking access counts for specific influenza-related articles on English-language Wikipedia. Delphi aggregates these counts from Wikimedia's public pageview dumps, providing a proxy for information-seeking behavior and public awareness of the flu.
General topics not specific to any particular endpoint are discussed in the
[API overview](README.md). Such topics include:
[contributing](README.md#contributing), [citing](README.md#citing), and
[data licensing](README.md#data-licensing).
-## Wikipedia Access Data
+## Table of contents
+{: .no_toc .text-delta}
+
+1. TOC
+{:toc}
+
+## Estimation
+
+Counts are extracted directly from Wikimedia's public pageviews dumps.
-Number of page visits for selected English, Influenza-related wikipedia articles.
- - Source: [Wikimedia](https://dumps.wikimedia.org/other/pagecounts-raw/)
- - Temporal Resolution: Hourly, daily, and weekly from 2007-12-09 (2007w50)
- - Spatial Resolution: N/A
- - Other resolution: By article ([54](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/articles.txt))
- - Open access
+The available indicators include:
+* **`count`**: The number of pageviews for the specific article in the given language and time period.
+* **`total`**: The total number of pageviews for all articles in the specified language during the same time period.
+* **`value`**: The normalized pageview rate, calculated as `(count / total) * 1,000,000` (views per million).
-# The API
+Counts are aggregated by hour and then summed to daily or weekly totals. No smoothing is applied.
-The base URL is: https://api.delphi.cmu.edu/epidata/wiki/
+
-See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
+## Limitations
-## Parameters
+* Information-seeking behaviour does not always correlate perfectly with disease incidence.
-### Required
+
+## The API
+
+The base URL is:
+
+
+### Parameters
+
+#### Required
| Parameter | Description | Type |
| --- | --- | --- |
-| `articles` | articles | list of [articles](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/articles.md) |
+| `articles` | articles | list of [articles](#available-articles) |
| `language` | language (currently `en`, `es`, and `pt` supported) | string |
-| `dates` | dates | `list` of dates |
-| `epiweeks` | epiweeks | `list` of epiweeks |
-
-Note:
-- Only one of `dates` and `epiweeks` is required. If both are provided, `epiweeks` is ignored.
-
-### Optional
+| `dates` | dates (see [Date Formats](date_formats.html)) | `list` of dates |
+| `epiweeks` | epiweeks (see [Date Formats](date_formats.html)) | `list` of epiweeks |
+
+##### Available Articles
+
+Articles are categorized by the disease or condition they are most closely related to. Note that some articles (like "fever" or "nausea") may overlap across categories.
+
+###### Influenza (Flu)
+
+Click to expand
+
+| Article Name |
+|---|
+| amantadine |
+| antiviral_drugs |
+| avian_influenza |
+| canine_influenza |
+| cat_flu |
+| chills |
+| common_cold |
+| cough |
+| equine_influenza |
+| fatigue_(medical) |
+| fever |
+| flu_season |
+| gastroenteritis |
+| headache |
+| hemagglutinin_(influenza) |
+| human_flu |
+| influenza |
+| influenzalike_illness |
+| influenzavirus_a |
+| influenzavirus_c |
+| influenza_a_virus |
+| influenza_a_virus_subtype_h10n7 |
+| influenza_a_virus_subtype_h1n1 |
+| influenza_a_virus_subtype_h1n2 |
+| influenza_a_virus_subtype_h2n2 |
+| influenza_a_virus_subtype_h3n2 |
+| influenza_a_virus_subtype_h3n8 |
+| influenza_a_virus_subtype_h5n1 |
+| influenza_a_virus_subtype_h7n2 |
+| influenza_a_virus_subtype_h7n3 |
+| influenza_a_virus_subtype_h7n7 |
+| influenza_a_virus_subtype_h7n9 |
+| influenza_a_virus_subtype_h9n2 |
+| influenza_b_virus |
+| influenza_pandemic |
+| influenza_prevention |
+| influenza_vaccine |
+| malaise |
+| myalgia |
+| nasal_congestion |
+| nausea |
+| neuraminidase_inhibitor |
+| orthomyxoviridae |
+| oseltamivir |
+| paracetamol |
+| rhinorrhea |
+| rimantadine |
+| shivering |
+| sore_throat |
+| swine_influenza |
+| viral_neuraminidase |
+| viral_pneumonia |
+| vomiting |
+| zanamivir |
+
+
+
+###### Norovirus (Noro)
+
+Click to expand
+
+| Article Name |
+|---|
+| abdominal_pain |
+| caliciviridae |
+| dehydration |
+| diarrhea |
+| fecal–oral_route |
+| foodborne_illness |
+| gastroenteritis |
+| intravenous_therapy |
+| leaky_scanning |
+| nausea |
+| norovirus |
+| oral_rehydration_therapy |
+| rotavirus |
+| shellfish |
+| vomiting |
+
+
+
+###### Dengue
+
+Click to expand
+
+| Article Name |
+|---|
+| aedes |
+| aedes_aegypti |
+| arthralgia |
+| blood_transfusion |
+| dengue_fever |
+| dengue_vaccine |
+| dengue_virus |
+| diarrhea |
+| exanthem |
+| fever |
+| flavivirus |
+| headache |
+| hematuria |
+| mosquito |
+| mosquito-borne_disease |
+| myalgia |
+| nausea |
+| nosebleed |
+| paracetamol |
+| petechia |
+| rhinitis |
+| thrombocytopenia |
+| vomiting |
+
+
+
+
+
+#### Optional
| Parameter | Description | Type |
|-----------|-------------|------------------------|
| `hours` | hours | `list` of hours (0-23) |
-## Response
+{: .note}
+> **Notes:**
+> - Only one of `dates` and `epiweeks` is required. If both are provided, `epiweeks` is ignored.
+> - `dates`, `epiweeks`, and `hours` are `None` by default.
+> - `language` is `en` by default.
+
+### 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[].article` | | string |
-| `epidata[].count` | | integer |
-| `epidata[].total` | | integer |
-| `epidata[].hour` | hour (-1 if `hour` not used) | integer |
-| `epidata[].date` | date (yyyy-MM-dd) (only included if `date` used) | string |
-| `epidata[].epiweek` | epiweek (only included if `epiweek` used) | integer |
-| `epidata[].value` | | float |
+| `epidata[].article` | Wikipedia article name | string |
+| `epidata[].count` | article-specific pageview count for the requested period/hours | integer |
+| `epidata[].total` | total Wikipedia pageviews for the specified `language` (e.g., all English Wikipedia traffic) over the same period/hours | integer |
+| `epidata[].hour` | hour (0-23) of access (-1 if not filtering by hour) | integer |
+| `epidata[].date` | date (yyyy-MM-dd) | string |
+| `epidata[].epiweek` | epiweek | integer |
+| `epidata[].value` | normalized pageview count (pageviews per million total language traffic): `(count / total) * 10^6` | float |
| `message` | `success` or error message | string |
-# Example URLs
+## Example URLs
### Wikipedia Access article "influenza" on 2020w01
-https://api.delphi.cmu.edu/epidata/wiki/?language=en&articles=influenza&epiweeks=202001
+
```json
{
@@ -88,7 +245,7 @@ https://api.delphi.cmu.edu/epidata/wiki/?language=en&articles=influenza&epiweeks
```
### Wikipedia Access article "influenza" on date 2020-01-01
-https://api.delphi.cmu.edu/epidata/wiki/?language=en&articles=influenza&dates=20200101
+
```json
{
@@ -107,54 +264,103 @@ https://api.delphi.cmu.edu/epidata/wiki/?language=en&articles=influenza&dates=20
}
```
-# Code Samples
+## Code Samples
-Libraries are available for [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/main/src/client/delphi_epidata.js), [Python](https://pypi.org/project/delphi-epidata/), and [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R).
-The following samples show how to import the library and fetch national Wikipedia Access data for article "influenza" on
-epiweeks `201940` and `202001-202010` (11 weeks total) for hours 0 and 12 in English.
+Libraries are available for [R](https://cmu-delphi.github.io/epidatr/) and [Python](https://cmu-delphi.github.io/epidatpy/).
+The following samples show how to import the library and fetch Wikipedia Access data for article "influenza" in English for epiweeks `202001-202010` (10 weeks total) and hours 0 and 12.
-
+
+
-````html
-
-
-
-
-````
+
+
+Install the package using pip:
+```bash
+pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
+```
+
+```python
+# Import
+from epidatpy import CovidcastEpidata, EpiDataContext, EpiRange
+# Fetch data
+epidata = EpiDataContext()
+res = epidata.pub_wiki(articles=['influenza'], time_values=EpiRange(202001, 202010), time_type='week', language='en', hours=[0, 12])
+print(res)
+```
+
+
+
+
+```R
+library(epidatr)
+# Fetch data
+res <- pub_wiki(articles = "influenza", time_values = epirange(202001, 202010),
+ time_type = "week", language = "en", hours = c(0, 12))
+print(res)
+```
+
+
+
-### Python
+### Legacy Clients
+
+We recommend using the modern client libraries mentioned above. Legacy clients are also available for [Python](https://pypi.org/project/delphi-epidata/), [R](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R), and [JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.js).
+
+
+
+
+
Optionally install the package using pip(env):
-````bash
+```bash
pip install delphi-epidata
-````
+```
Otherwise, place `delphi_epidata.py` from this repo next to your python script.
-````python
+```python
# Import
from delphi_epidata import Epidata
# Fetch data
-res = Epidata.wiki(['influenza'], None, [201940, Epidata.range(202001, 202010)], [0, 12])
+res = Epidata.wiki(['influenza'], Epidata.range(202001, 202010), {'time_type': 'week', 'language': 'en', 'hours': [0, 12]})
print(res['result'], res['message'], len(res['epidata']))
-````
+```
+
-Note:
-- `dates`, `epiweeks`, and `hours` are `None` by default.
-- `language` is `en` by default.
+
-### R
+Place `delphi_epidata.R` from this repo next to your R script.
-````R
-# Import
-source('delphi_epidata.R')
+```R
+source("delphi_epidata.R")
# Fetch data
-res <- Epidata$wiki(list('nat'), NULL, list(201940, Epidata$range(202001, 202010)), list(0, 12), 'en')
-cat(paste(res$result, res$message, length(res$epidata), "\n"))
-````
+res <- Epidata$wiki(articles = list("influenza"), time_values = Epidata$range(202001, 202010), time_type = "week", options = list(language = "en", hours = list(0, 12)))
+print(res$message)
+print(length(res$epidata))
+```
+
+
+
+
+
+```html
+
+
+
+
+```
+
+
+
diff --git a/docs/symptom-survey/contingency-tables.md b/docs/symptom-survey/contingency-tables.md
index f92ee1ef4..b05a871aa 100644
--- a/docs/symptom-survey/contingency-tables.md
+++ b/docs/symptom-survey/contingency-tables.md
@@ -30,7 +30,7 @@ territories worldwide, also [through
ICPSR](https://www.icpsr.umich.edu/web/ICPSR/studies/39206).
These tables are more detailed than the [coarse aggregates reported in the
-COVIDcast Epidata API](../api/covidcast-signals/fb-survey.md), which are grouped
+COVIDcast Epidata API](../api/covidcast-signals/covid-trends-and-impact-survey.md), which are grouped
only by geographic region. [Individual response data](survey-files.md) for the
survey is available, but only to researchers who request restricted data access
via ICPSR, whereas these contingency tables are available to the general public.
diff --git a/docs/symptom-survey/data-access.md b/docs/symptom-survey/data-access.md
index 435f07ee2..6c30c759c 100644
--- a/docs/symptom-survey/data-access.md
+++ b/docs/symptom-survey/data-access.md
@@ -13,7 +13,7 @@ well-being. This may help improve our local and national responses to the
pandemic and our understanding of how it has affected society.
[High-level aggregates](../api/covidcast.md) of select survey items are
-publicly available in the [COVIDcast API](../api/covidcast-signals/fb-survey.md).
+publicly available in the [COVIDcast API](../api/covidcast-signals/covid-trends-and-impact-survey.md).
[Finer aggregates](./contingency-tables.md) grouped by various demographic
characteristics are available for download.
diff --git a/docs/symptom-survey/index.md b/docs/symptom-survey/index.md
index 48b42b012..dbba7e899 100644
--- a/docs/symptom-survey/index.md
+++ b/docs/symptom-survey/index.md
@@ -40,7 +40,7 @@ If you have questions about the survey or getting access to data, contact us at
The [survey results dashboard](https://delphi.cmu.edu/covidcast/survey-results/)
provides a high-level summary of survey results. Geographically aggregated data
from this survey is publicly available through the [COVIDcast API](../api/covidcast.md)
-as the [`fb-survey` data source](../api/covidcast-signals/fb-survey.md). Demographic breakdowns of survey
+as the [`fb-survey` data source](../api/covidcast-signals/covid-trends-and-impact-survey.md). Demographic breakdowns of survey
data are publicly available as [downloadable contingency tables](contingency-tables.md).
CTIS data has been used in [numerous peer-reviewed publications](publications.md).
diff --git a/docs/symptom-survey/weights.md b/docs/symptom-survey/weights.md
index 3cd1c60ee..a6a5df858 100644
--- a/docs/symptom-survey/weights.md
+++ b/docs/symptom-survey/weights.md
@@ -10,7 +10,7 @@ nav_order: 5
The survey's individual response files contain respondent weights calculated
by Facebook. These weights are also used to produce our
[public contingency tables](./contingency-tables.md) and the geographic aggregates
-[in the COVIDcast Epidata API](../api/covidcast-signals/fb-survey.md).
+[in the COVIDcast Epidata API](../api/covidcast-signals/covid-trends-and-impact-survey.md).
Facebook has developed a [User Guide for the CTIS
Weights](https://dataforgood.facebook.com/dfg/resources/user-guide-for-ctis-weights)