Skip to content
Session on Application Programming Interfaces, in particular the Twitter API. Includes discussion of twitterbots.
Branch: master
Clone or download
Pull request Compare This branch is 22 commits ahead of DHRI-Curriculum:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
sections
.gitignore Updated with links, what is api section, updated tweet Jun 15, 2018
LICENSE
README.md Update README.md May 9, 2019
api.py
my_keys.py Initial commit Jan 18, 2016
scrape-data.py
scrape-simple.py
tweets.txt Added twitterbot. Fixed import of keys file. Added example tweets Jan 21, 2016
twitterbot.py

README.md

Introduction to the Twitter API

APIs (Application Programming Interfaces) are a structured way for programs to communicate with other programs. A knowledge of APIs allows your programs to communicate with major services such as The New York Times and Twitter and collect data from organizations such as the Library of Congress.

By the end of this workshop, participants will:

  • Understand the purpose of Application Programming Interfaces (APIs), especially web APIs.
  • Authenticate to and interact with a real API—the Twitter API.
  • Create a Twitterbot—that is, a Python program that automatically controls a Twitter account.
  • Collect tweets and tweet metadata from Twitter's streaming API.
  • Learn how to read API documentation and research potential APIs to address issues in research.

Important Note

Do not share your API key, secret, or access tokens with anyone, and do not publish code with your key or token visible. Treat your keys and tokens as you would a password.


What is an API?
Getting Your API key
Accessing the API
Creating a Twitterbot
Scraping Data Using the Streaming API
Resources


Session Leader: Ericka Christie
Based on previous work by Patrick Smyth

Creative Commons License

Digital Research Institute (DRI) Curriculum by Graduate Center Digital Initiatives is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Based on a work at https://github.com/DHRI-Curriculum. When sharing this material or derivative works, preserve this paragraph, changing only the title of the derivative work, or provide comparable attribution.

You can’t perform that action at this time.