API Fundamentals Course
API Fundamentals
/
Beginner

Web APIs

Definition

A specific type of API that can be accessed over the internet using the HTTP protocol.

Explain Like I'm New

When most people say 'API', they actually mean 'Web API'. It is an interface that lives on a server somewhere in the world. You talk to it by sending web requests (just like typing a URL in Chrome), and it talks back by sending raw data (usually JSON) instead of HTML webpages.

Real World Example

The Spotify Web API. You send an HTTP request over the internet to `api.spotify.com/v1/tracks/123`, and Spotify's servers send back a JSON text file containing the song name, artist, and album cover URL.

Common Use Cases

  • •Fetching remote data
  • •Mobile app backends
  • •Cloud services

Interactive Example

Interview Questions

basic

  • What protocol do almost all Web APIs use to communicate over the internet?

intermediate

  • If a Web API does not return HTML, what data format does it usually return?

Flash Cards

Question

Which protocol?

Click to reveal answer
Answer

HTTP (Hypertext Transfer Protocol) or HTTPS (Secure).

Question

What format?

Click to reveal answer
Answer

JSON (JavaScript Object Notation). It is lightweight, readable by humans, and easily parsed by any programming language.