Builder14 min readBadge: API Explorer

APIs and JSON, hands on

How apps ask other services for data: endpoints, methods, status codes and JSON, with a real API you can try in your browser.

What an API is

An API is a menu of requests another program accepts. Each item on the menu is an endpoint, a URL like https://api.github.com/users/octocat. Your app sends a request; the service sends back a response, usually as JSON, a simple text format for data. Payments, maps, AI models and weather all work this way.

The parts of a request

  • Method: GET reads data, POST creates something, PATCH or PUT updates it, DELETE removes it.
  • URL and query parameters: /repos?per_page=5 asks for five results.
  • Headers: extra details, like Authorization: Bearer <key> to prove who's asking.
  • Body: the data you send with POST or PATCH, usually JSON.

Reading the response

The status code says how it went: 200 OK, 201 created, 400 something's wrong with the request, 401 not signed in, 403 not allowed, 404 not found, 429 too many requests, 500 the server failed. JSON uses { } for objects with named fields and [ ] for lists, so { "user": { "name": "Sam" } } gives you the name at user.name. Always check the status before using the data.

Try one, then use them safely

Open https://api.github.com/users/octocat in your browser: that's real JSON from GitHub's public API. In the browser Console you can run fetch('https://api.github.com/users/octocat').then((r) => r.json()).then(console.log). For APIs that need a key, call them from your server with the key in an environment variable, read the docs for limits and costs, handle errors and rate limits, and send only the data the service needs.

Key terms

API
An agreed way for one piece of software to ask another for something.
Endpoint
One URL an API answers, like /users/octocat, each doing one job.
HTTP method
The verb of a web request: GET reads, POST creates, PATCH or PUT updates, DELETE removes.
JSON
A simple text format for data that apps send to each other: names and values in curly braces.
HTTP status code
A number a server sends back: 200 OK, 401 not signed in, 403 not allowed, 404 not found, 500 server error.
API key
A secret code that identifies your app to a service and is often tied to billing.
Rate limit
The most requests or tokens a key may use in a period, such as per minute.
Environment variable
A setting or secret the app reads at run time, kept outside the code.
See the full glossary

Try it

Your first API calls

  1. Open https://api.github.com/users/octocat in your browser and find the name and public_repos fields.
  2. Run the fetch line from the guide in your browser's Console and expand the result.
  3. Change the URL to a user that doesn't exist and note the status code.
  4. Ask an AI to write a tiny page that shows a GitHub user's name and avatar, checking response.ok first.

Ask an AI tutor about this guide

Copy a prompt into ChatGPT, Claude or Gemini to go deeper. Check what it tells you against the guide.

Study with an AI tutor: copy this whole guide with tutoring instructions, then paste it into your AI assistant.
  • Explain it like I'm 12
  • Quiz me (5 questions, one at a time)
  • Show me a real example for my situation
  • What do beginners get wrong?

Knowledge check

Five questions. Get 4 right to earn the API Explorer badge. You can retake it as often as you like.

Question 1 of 5

Which HTTP method is used to read data?

Finished the How software works guides? Take the How software works track test for ten mixed questions.

My notes

Write what clicked, what confused you, and what you want to try. Saved in this browser only.

Learn it live

Digital Builders University runs small live workshops where you build something real with an instructor beside you, starting with Vibe Coding 101.

See workshops

Practise it

Last reviewed November 25, 2026. AI tools change fast; check each tool’s own site for current features, plans and prices.