Link Search Menu Expand Document

Twitter Stream

This is the documentation of the API for accessing the Twitter Stream (twitter) data source of the Delphi’s epidemiological data.

General topics not specific to any particular data source are discussed in the API overview. Such topics include: contributing, citing, and data licensing.

Twitter Stream Data

Estimate of influenza activity based on analysis of language used in tweets.

  • Data source: HealthTweets
  • Temporal Resolution: Daily and weekly from 2011-12-01 (2011w48)
  • Spatial Resolution: National, HHS regions, and Census divisions (1+10+9); and by state/territory (51)
  • Restricted access: Delphi doesn’t have permission to share this dataset

The API

The base URL is: https://delphi.cmu.edu/epidata/api.php

See this documentation for details on specifying epiweeks, dates, and lists.

Parameters

Required

Parameter Description Type
auth password string
locations locations list of region/state labels
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.

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

Twitter on 2015w01 (national)

https://delphi.cmu.edu/epidata/api.php?source=twitter&auth=…&locations=nat&epiweeks=201501

{
  "result":1,
  "epidata":[...],
  "message":"success"
}

Code Samples