💻 Computer Science · Topic 94 of 97

APIs and Web Services

An API is a set of rules that lets one program ask another for data or services, such as getting the weather for an app.

▶ Interact

Play with the controls to see the idea in action.

Loading animation…

📘 Learn

An API is a set of rules that lets one program ask another for data or services, such as getting the weather for an app.

  • Requests and responses
  • Data is often sent as JSON
  • APIs hide how the service works inside

🧠 Quick quiz

Three questions. Score 2 or more to complete the topic.

What is APIs and Web Services?

Within Computer Science, which covers algorithms, programming, data, networks, hardware and safe, responsible use of technology, this topic explains APIs and Web Services. Computing topics explain how software, hardware and data work, with diagrams and models that show each step in order.

Check that you can explain APIs and Web Services in your own words and give one example from everyday life. If you can do that, you have understood the core idea.

Understanding APIs and Web Services helps you design, test and explain programs, websites and systems, from small projects to exam questions.

APIs and Web Services in detail

An API (Application Programming Interface) is a set of rules that allows one piece of software to talk to another. It defines what requests can be made, how and what responses to expect, without revealing how it works inside, like a waiter between you and the kitchen.

Web APIs send requests over the internet, often using HTTP, with data returned in formats such as JSON. Examples include weather data, maps, payment systems and social login. Developers use APIs to add features without building them from scratch. Security matters, so keys and authentication control access, and there may be limits on use.

How the interactive helps you understand APIs and Web Services

Watch the network in the interactive. Use any sliders or buttons it offers to change the values and see how the network responds.

Before you change anything, predict the result. Then change one value at a time and check whether your prediction was right. This is a quick way to build a correct mental model of APIs and Web Services.

Real-life uses and examples

Common mistakes to avoid

Frequently asked questions about APIs and Web Services

What is APIs and Web Services?

An API is a set of rules that lets one program ask another for data or services, such as getting the weather for an app.

What are the most important points about APIs and Web Services?

The main points are: Requests and responses; Data is often sent as JSON; APIs hide how the service works inside.

Why is APIs and Web Services useful?

Understanding APIs and Web Services helps you design, test and explain programs, websites and systems, from small projects to exam questions.

How can I practise APIs and Web Services?

Open the interactive at the top of this page and change the controls one at a time. Predict the result before each change, then take the three-question quiz. A score of two or more marks the topic as complete on this device.

Which topics are related to APIs and Web Services?

Related topics in Computer Science include Data Structures: Stacks and Queues, The CPU, Secondary Storage.

← PreviousVersion Control and CollaborationNext →Mobile Apps and Design

Keep exploring Computer Science