Skip to Main Content
| University Libraries
See Updates and FAQs for the latest library services updates. Subject Librarians are available for online appointments, and Virtual Reference has extended hours.

Social Media Data and Tools

A guide discussing how to acquire, extract, and use social media data and tools

Social Media APIs

Note: this page covers advanced topics in social media analysis involving coding and programming.

Many social media platforms allow you to interact with their data directly through an Application Programming Interface (API). However, doing so requires at least a moderate amount of programming knowledge. In data science and computational social science, the most popular language options are Python and R, which you can learn about by visiting the Learn Python InfoGuide and the Learn R InfoGuide.

In this page we will cover:

  1. How to get access to social media APIs.
  2. How to program scripts to gather data from APIs in Python.
  3. How to program scripts to gather data from APIs in R.

Before we get started, it is highly recommended that you familiarize yourself with two important concepts:

  1. REST APIs (or RESTful APIs).
  2. The JSON file format.

The coding examples assume knowledge about, and comfort iterating through, JSON response objects. There are some great resources already available on our web scraping InfoGuide, but the following resources are useful for learning more about REST APIs and JSON:

Python API Coding Examples

R API Coding Examples