Introduction

️✅ Learning objectives

  • Explain what an API is.
  • Decide whether this book is for you.

What is an API?

API = “application programming interface”

  • “application” = function, website… any computerized thing
  • “programming” = can be used in code
  • “interface” = way to interact with something

🤖 APIs allow computers to talk to one another

What are web APIs?

💻 Technically any function’s list of arguments is an API

“httr2 is a ground-up rewrite of httr that provides a pipeable API with an explicit request object that solves more problems felt by packages that wrap APIs” (httr2 docs, emphasis added)

🕸️ This book = web APIs

  • Web API = API on the internet
  • For rest of book, “API” means “web API”

What are some API examples?

What will I learn?

Part 1: Get started

  • Get started with APIs
  • Quickly parse API responses
  • Tell APIs who you are

Part 2: Get more data

  • Get a lot of data from APIs
  • Scrape data from web pages
  • Process other responses types

Part 3: Do more with APIs

  • Do other things with APIs
  • Find APIs
  • Communicate with other types of APIs
  • Learn more about APIs

What won’t I learn?

  • How can I access APIs with {httr} or {curl}?
  • How can I create an API?
  • How can I access APIs from other programming languages?

Who should read this book?

  • Data Analysts/Scientists
    • Access datasets
    • Enrich datasets
  • Machine Learning Engineers
    • Feature engineering
  • Shiny App Designers
    • Load/process data

Prerequisites

  • Familiarity with R
  • Very few hard prerequisites
    • Will point to resources when helpful
  • Helpful:
    • Advanced R to do more complicated things with retrieved data

How are chapters structured?

  • Learning Objectives ≈ skills
    • “After you read this chapter, you will be able to…”
  • Test-Yourself Questions to check understanding
  • Check online version for updates