Twitter Stream

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

General topics not specific to any particular endpoint 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.

  • 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://api.delphi.cmu.edu/epidata/twitter/

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://api.delphi.cmu.edu/epidata/twitter/?auth=…&locations=nat&epiweeks=201501

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

Code Samples