Data Collection¶
In this module, you will learn how to collect social media data through platform APIs.
Most collection jobs have the same shape: authenticate if the platform requires it, ask for a page of results, keep asking until there is nothing more, and store what came back.
Learning objectives¶
- Authenticate with and query a platform API
- Collect posts, threads, user profiles, and social graph data
- Recognize how the platforms' data models differ, and what that means for collection
- Page through results and respect rate limits
- Choose a sampling strategy that fits the research question
Pages¶
| Page | What it covers |
|---|---|
| Sampling strategies | Keyword-based, user-based, graph snowball, and whole-board collection; snowball sampling for growing a keyword list, with the interactive demo |
| Key concepts | What the data looks like, ways to get it, finding the API documentation, pagination, rate limits and what they buy you, storage, credentials, and choosing a platform |
| Run it continuously | Periodic jobs with cron, stream collectors under a supervisor, and how to check on a collector that runs for weeks |
| Research considerations | Terms of service, consent and deletion, ethics review, offensive content, and media |
Platform notebooks¶
Here, we provide notebooks for three platforms: Bluesky, 4chan, and YouTube, to demonstrate how to interact with their API endpoints. Readers are encouraged to explore other platforms and their APIs.
| Platform | Access | Sections | |
|---|---|---|---|
| Bluesky | Free account and app password. Posts are searchable by keyword and time, so a collector can backfill. | Search posts, User profile, Followers | Open in Colab |
| 4chan | No key. Anonymous, no search, threads get deleted within hours or days, so a collector must run continuously. | Boards, Catalog, Thread, Archive, Collect a whole board | Open in Colab |
| YouTube | Google API key. Every request costs quota units from a daily budget. | Search videos, Channel information, Video information, Video comments | Open in Colab |
Related¶
- Snowball sampling demo, an interactive page that grows a keyword list one round at a time
- Research papers, including the datasets built with the methods on this page
- Build Your Own Pipeline, a guide whose first stage is a continuous data collection system