Skip to main content
QUICK REVIEW

[Paper Review] A Public Dataset Tracking Social Media Discourse about the 2024 U.S. Presidential Election on Twitter/X

A. Balasubramanian, Vito Zou|arXiv (Cornell University)|Nov 1, 2024
Social Media and PoliticsSocial Sciences4 citations
TL;DR

This paper introduces a publicly available dataset of 22 million X (formerly Twitter) posts collected between May 1 and July 31, 2024, tracking discourse around the U.S. 2024 Presidential Election. Using a custom-built scraper with targeted keywords, the authors capture evolving political sentiment, trending topics, and narrative dynamics, offering researchers a robust resource for studying misinformation, political engagement, and platform influence during the election cycle.

ABSTRACT

In this paper, we introduce the first release of a large-scale dataset capturing discourse on $\mathbb{X}$ (a.k.a., Twitter) related to the upcoming 2024 U.S. Presidential Election. Our dataset comprises 22 million publicly available posts on X.com, collected from May 1, 2024, to July 31, 2024, using a custom-built scraper, which we describe in detail. By employing targeted keywords linked to key political figures, events, and emerging issues, we aligned data collection with the election cycle to capture evolving public sentiment and the dynamics of political engagement on social media. This dataset offers researchers a robust foundation to investigate critical questions about the influence of social media in shaping political discourse, the propagation of election-related narratives, and the spread of misinformation. We also present a preliminary analysis that highlights prominent hashtags and keywords within the dataset, offering initial insights into the dominant themes and conversations occurring in the lead-up to the election. Our dataset is available at: url{https://github.com/sinking8/usc-x-24-us-election

Motivation & Objective

  • To provide researchers with a large-scale, publicly accessible dataset of real-time political discourse on X during the 2024 U.S. Presidential Election.
  • To enable longitudinal analysis of how political narratives, hashtags, and keywords evolve in response to major events such as debates, endorsements, and candidate announcements.
  • To support research on misinformation, coordinated inauthentic behavior, and the role of verified users and bots in shaping election-related discourse.
  • To establish a reproducible, transparent data collection framework using keyword-based scraping aligned with the election timeline.
  • To offer a foundation for cross-platform comparative studies by providing a standardized dataset for future analysis of digital political ecosystems.

Proposed method

  • A custom web scraper, the X-Scraper, built using a Chromium driver and multiple personal accounts to comply with X.com’s terms of service.
  • The scraper uses targeted keyword queries with OR logic, time-range filtering (since/until), and post-type filters (e.g., retweets, quotes) to capture relevant content.
  • Data collection is segmented into time intervals with dynamic keyword updates to reflect real-time events, such as adding 'Assassination' after the July 13 Trump incident and 'JD Vance' after his VP nomination.
  • The system performs regular sanity checks to ensure data coverage and minimize gaps, while accounting for X.com’s interface limitations and rate caps (~2,300 posts/hour per account).
  • Metadata includes post content, user information, media, engagement metrics, and interaction types, enabling analysis of user behavior and content reach.
  • The dataset is stored in a structured schema and made publicly available via GitHub, with ongoing updates planned throughout the election cycle.
Figure 1. Timeline Plot of Hashtag Occurrences (May-July 2024)
Figure 1. Timeline Plot of Hashtag Occurrences (May-July 2024)

Experimental results

Research questions

  • RQ1How do political hashtags and keywords evolve in response to major election events on X?
  • RQ2What role do verified users and suspected bots play in amplifying or shaping election-related narratives on X?
  • RQ3How does the discourse on X reflect public sentiment and ideological polarization in the lead-up to the 2024 U.S. Presidential Election?
  • RQ4To what extent does keyword-based scraping capture representative samples of public discourse on X, despite platform interface limitations?
  • RQ5How do coordinated inauthentic behaviors and misinformation narratives emerge and spread across X during a high-stakes election cycle?

Key findings

  • The dataset comprises 22 million publicly available X posts collected from May 1 to July 31, 2024, covering a comprehensive span of the pre-convention election period.
  • Preliminary analysis reveals dominant hashtags and keywords such as 'thedemocrats', 'DNC', 'Kamala Harris', 'Republican party', and 'Third Party', reflecting core party and candidate discourse.
  • The dynamic keyword update strategy successfully captured real-time discourse shifts, including spikes in mentions of 'Assassination' and 'JD Vance' following major events.
  • Despite platform restrictions, the scraper achieved near-total coverage of publicly available data during the observation window, as confirmed by manual monitoring.
  • The dataset demonstrates high temporal and thematic relevance, aligning with key election milestones and enabling longitudinal analysis of political discourse evolution.
  • The dataset is publicly accessible at https://github.com/sinking8/usc-x-24-us-election, with ongoing updates planned to support continuous research throughout the election cycle.
A Public Dataset Tracking Social Media Discourse about the 2024 U.S. Presidential Election on Twitter/X

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.