6.1. APIs#
6.1.1. What Is an API?#
API stands for Application Programming Interface.
An API is a way to programmatically interact with a applications or other software.
A document that describes how an API behaves is called the API specification.
Actual software that meets the specification is said to implement or expose an API.
APIs are written by software developers so that other developers can extend or interact with their software.
APIs are used by almost every piece of software we use on a daily basis. For example an graphical application on your computer uses APIs provided by the operating system to create windows and draw to the screen.
6.1.2. What Is a Web API?#
A web API is an API that works over the web using the HTTP protocol.
Web APIs allow communication between clients such as web browsers, desktop and mobile apps with a server.
Web APIs are now a staple of software. You likely use apps on your computer or mobile phone that rely on web APIs.
For example
6.1.3. How Do Web APIs Work?#
6.1.4. What is JSON?#
JSON stands for JavaScript Object Notation.
It’s a lightweight, human-readable format for storing and exchanging data.
Example
The example below shows a JSON “Object”, which is like a dictionary, of a student. You can also find various other data types that are supported in JSON like strings, arrays and numbers.
{
"name": "Alex",
"age": 17,
"skills": ["Python", "HTML"],
"address": {
"city": "Sydney",
"postcode": "2000"
}
}
6.1.5. Glossary#
- API#
Application Programming Interface. A way to programmatically interact with applications or other software.
- API specification#
A document that describes how an API behaves.
- Web API#
An API that works over the web using the HTTP protocol.
- JSON#
JavaScript Object Notation. A lightweight, human-readable format for storing and exchanging data.