Your bookmarks

Loading your bookmarks

Latest updates

New courses, skills, book chapters, and site improvements will appear here.

Create free accountSign upDashboardDashboard

Application Programming Interface (API)

  • Standard term
3 steps

An Application Programming Interface (API) is the published set of requests one program can make of another, with rules for what each request must include and what comes back.

Your app sends a request in the form the service publishes, such as a package's weight and destination, and gets back labeled data it knows how to read. Neither side sees how the other works inside, so the service can rebuild its internals without breaking your app, provided the published form stays the same.

Where you’ll meet it

You ask your AI to add live shipping prices to your online shop's checkout, and it works when you try it. During the holiday rush the shipping service goes down for an hour, and your checkout charges every customer $0 for shipping.

What to do

  1. Ask your AI what checkout shows when the shipping service fails or answers slowly.
  2. Have it charge a flat backup rate you choose in place of $0.
  3. Have it fake an outage in a test, and look at the checkout page.

Easy to mix up

An endpoint is one address within an API, for requests about one kind of thing, such as orders. The API is the whole set of requests the service accepts, with the rules for each.

Check yourself

Your app shows a store's opening hours from its API. The store's API renames the field "hours" to "openingHours" and changes nothing else. What will your app's visitors likely see?

Go deeperWeb APIs are one kind of a much older idea

Code libraries, packages of ready-made code that programmers build on, and operating systems such as Windows have published APIs for decades. When people building apps with AI say "API" today, they almost always mean a web API, which your program reaches over the internet.

You'll often meet the word through an API key, a secret code that identifies your app so the service can allow, limit, and bill your requests. “The OpenAI API” or “the Claude API” lets your program reach the same family of models you chat with, paid for by use and without the chat app's added instructions, memory, and tools.

A careful app also plans for the limits a service sets, such as how many requests it accepts each minute and what each one costs. It also notes which version of the rules its code was written for, because services retire old versions.

Practice Build Basics

Or take the learning quiz on a mix of every set