An application programming interface (or API) is like a friendly message board that lets two groups of people talk to each other without needing to know all about each other’s secrets.
Imagine you have a favorite toy robot that can sing songs. You want it to play music from your phone, but you don’t know how the robot works inside. Your phone has an API, like a special note pad that says: “Here’s what I can do and how I talk.” The robot also has its own note pad so it knows how to understand messages from your phone. That way, they can work together without needing to know all about each other’s brains.
How APIs Work
Think of an API as a waiter in a restaurant. You don’t need to go into the kitchen to order food, you just tell the waiter what you want, and they bring it out to you. In this case, your phone is like you, the robot is like the kitchen, and the waiter (the API) helps them talk.
So when apps or robots need to share information, they use these friendly message boards, or APIs, to send messages and work together!
Examples
- Imagine two apps talking to each other through a simple message board, that's an API in action.
- An API is like a menu at a restaurant: it tells the software what options are available.
Ask a question
See also
- How Does Creating Your Own Programming Language - Computerphile Work?
- How Does Better C# - Reducing Complexity Work?
- How Does Programming Terms: Mutable vs Immutable Work?
- Programming vs Coding - What's the difference?
- How Does Ultimate Guide to Choosing a Tech Stack Work?