Twitter API Academic Research access with R
2022-03-29
Chapter 1 About
1.1 Book
This book offers some practical understanding on how to access the Twitter API with R. It assumes an Academic Research access but also some familiarity with R. If you are a student or an academic you can get more information on how to apply here. The book is based on the official Twitter documentation that you can access here. The code used in this book doesn’t rely on any ad-hoc package to access the Twitter API. This probably requries some more work on the user side but it also allows for more flexibility in defining and setting API queries and in responding to API changes. The code used in this book relies on three generalist packages
The httr package (Wickham 2020) to deal with HTTP requests;
The dplyr package (Wickham et al. 2021) to manipulate data objects in R; and
The jsonlite package (Ooms 2022) to deal with JSON-formatted data objects.
This book is very much a working in progress. For suggestions, comments or if you note a mistake, please create an issue here.
1.1.1 Twitter relationships
In collecting Twitter data using the API, there are a number of entry points. Each node in the diagram indicate a possible entry point with arrows indicating the type of API requests necessary to crawl the graph.
Of course there are many other entry points. A good place to see a complete list is the official Twitter API endpoint map.