Getting data from the web: API access
Overview
- Identify multiple methods for obtaining data from the internet
- Define web-scraping
- Define Application Program Interface (API)
- Explain APIs authentication keys and demonstrate secure methods for storing these keys
- Interact with APIs
- Define JSON data structure and how to convert them to data frames
Before class
- Chapter 1 and 4 in Web Scraping with R
- Setup:
- Go to the geonames site and register an account
- Click here to enable the free web service
- Go to the OMDb website and click on the “API Key” tab to generate your API key
Several packages are needed for this week’s lectures (all installed on R workbench). If you are using R from your laptop (VS. R Workbench), I’d suggest following the lectures using R Workbench and installing the packages after class.
Additional Resources
rvestdocumentationhttrdocumentation- Web Scraping using R Cheat Sheet
- More install-and-play API packages for R
Class materials
- Run the code below in your console to download today’s in-class
exercises:
usethis::use_course("CFSS-MACSS/web-api-access")