Skip to main content
QUICK REVIEW

[Paper Review] Is the Sample Good Enough? Comparing Data from Twitter's Streaming API with Twitter's Firehose

Fred Morstatter, Jürgen Pfeffer|arXiv (Cornell University)|Jun 21, 2013
Complex Network Analysis TechniquesPhysics and Astronomy6 citations
TL;DR

This paper evaluates the representativeness of Twitter's Streaming API by comparing it against the full Firehose dataset across multiple dimensions. It finds that while the Streaming API performs reasonably well for large-scale hashtag and topic analysis when coverage is high, it introduces bias in small-sample scenarios and underperforms random sampling, particularly in network and centrality measures, though geotagged data is nearly complete due to spatial filtering.

ABSTRACT

Twitter is a social media giant famous for the exchange of short, 140-character messages called "tweets". In the scientific community, the microblogging site is known for openness in sharing its data. It provides a glance into its millions of users and billions of tweets through a "Streaming API" which provides a sample of all tweets matching some parameters preset by the API user. The API service has been used by many researchers, companies, and governmental institutions that want to extract knowledge in accordance with a diverse array of questions pertaining to social media. The essential drawback of the Twitter API is the lack of documentation concerning what and how much data users get. This leads researchers to question whether the sampled data is a valid representation of the overall activity on Twitter. In this work we embark on answering this question by comparing data collected using Twitter's sampled API service with data collected using the full, albeit costly, Firehose stream that includes every single published tweet. We compare both datasets using common statistical metrics as well as metrics that allow us to compare topics, networks, and locations of tweets. The results of our work will help researchers and practitioners understand the implications of using the Streaming API.

Motivation & Objective

  • To assess whether Twitter’s Streaming API provides a statistically representative sample of overall Twitter activity.
  • To evaluate the impact of sampling bias on common analytical tasks such as topic modeling, network analysis, and geospatial distribution.
  • To compare Streaming API results against both random samples from the Firehose and the full Firehose to isolate biases in the sampling mechanism.
  • To provide researchers with empirical guidance on when and how to use the Streaming API with confidence.
  • To estimate the actual data coverage of the Streaming API under varying parameter sets and conditions.

Proposed method

  • Collect parallel datasets using identical parameters from both the Streaming API and the Twitter Firehose.
  • Use correlation coefficients to compare the top n hashtags between Streaming API and Firehose data.
  • Apply Latent Dirichlet Allocation (LDA) to extract and compare topic distributions across datasets.
  • Construct user-user retweet networks from both datasets and compare top-100 key players and network centralization metrics.
  • Analyze geotagged tweet distributions by continent and spatial region to assess sampling bias in location-based analysis.
  • Compare Streaming API results against 100 randomly sampled datasets from the Firehose to evaluate statistical robustness.

Experimental results

Research questions

  • RQ1How well does the Streaming API represent the full distribution of hashtags compared to the Firehose?
  • RQ2To what extent does the Streaming API preserve topic distributions when compared to the full dataset?
  • RQ3How accurately can network centrality measures and key player identification be recovered from Streaming API data?
  • RQ4How does the geographical distribution of geotagged tweets compare between the Streaming API and the Firehose?
  • RQ5Does the Streaming API perform better or worse than random sampling from the Firehose in key analytical tasks?

Key findings

  • The Streaming API's coverage drops significantly as the number of matching tweets increases, with performance degrading under low coverage conditions.
  • For top hashtag analysis, the Streaming API shows negative correlation with the Firehose when n is small, while random sampling maintains high positive correlation.
  • Topic modeling using LDA shows significantly higher accuracy with random samples from the Firehose than with Streaming API data, especially at low coverage.
  • On average, the Streaming API recovers 50–60% of the top 100 key players in retweet networks from one day of data, improving with data aggregation over multiple days.
  • Network centralization indexes correlate strongly with the proportion of data covered by the Streaming API, indicating systematic bias in network structure.
  • Despite sampling, the Streaming API captures nearly all geotagged tweets when using geographic bounding boxes, due to spatial filtering effects.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.