Find a course
Age level: University students (18–25)BeginnerTechnology & Programming

APIs, REST and JSON Basics

How apps talk to each other, from HTTP requests to designing your own API

⏱ 2 h 25 min5 modules · 12 lessons80 practice questionsFinal exam: 20 questions
Included with this course

Your certificate for this course

Finish the 12 lessons (about 2 h 25 min) and pass the 20-question final exam. Your Certificate of Completion is ready the moment you pass.

  • Your name and this course titlePrinted in classic diploma typography
  • Grade: Pass, Merit or DistinctionOn the gold seal, with your final score
  • Unique ID and QR codeAnyone can verify it in seconds
  • Score report PDFModule-by-module results and exam score
  1. Lessons12 lessons
  2. Final exam20 questions · 70% to pass
  3. CertificatePDF + score report

What you will learn

  • Explain what an API is and how clients and servers cooperate through a documented contract
  • Take apart an HTTP request and response: URL parts, methods, headers, body and status codes
  • Write valid JSON, spot syntax errors, and parse, serialize and transform JSON in JavaScript and Python
  • Design RESTful endpoints and map create, read, update and delete operations to the right HTTP methods
  • Tell safe and idempotent methods apart and decide which failed requests a client should retry
  • Use query parameters, URL encoding and offset or cursor pagination to retrieve large collections correctly
  • Authenticate with API keys, bearer tokens and OAuth, protect secrets and respect rate limits with exponential backoff
  • Plan a consistent, versioned, documented API and choose between REST, webhooks, GraphQL, gRPC and WebSockets

About this course

Every app you use is quietly talking to other software. A weather app asks a forecast service for data, a checkout page asks a payment service to charge a card, and a map inside a ride-sharing app comes from yet another company. Those conversations happen through APIs, and most of them use the same two building blocks: REST and JSON.

This free course explains how it all works, from the first request to designing an API of your own. You'll start with what an API is and take a real HTTP exchange apart: URLs, methods, headers, bodies and status codes. Then you'll learn JSON thoroughly, including the strict rules that make one stray comma break a whole response, and practice parsing, serializing and reshaping JSON data in JavaScript and Python.

The REST module covers resources and URLs, statelessness, how create, read, update and delete map to POST, GET, PUT, PATCH and DELETE, which methods are safe to retry, and how to read and return useful errors. Next you'll use real-world techniques: query parameters, URL encoding, offset and cursor pagination, API keys, bearer tokens, OAuth, rate limits, timeouts and retries with exponential backoff. Finally, you'll design a clean, versioned, documented API and compare REST with webhooks, GraphQL, gRPC and WebSockets, plus the browser rule known as CORS.

The course is for students, junior developers, testers, analysts and anyone who works next to developers and wants to understand integrations. A little programming experience helps for the code challenges, which run in your browser, but every concept is explained from scratch. Lessons mix short explanations with calculators, bug hunts, scenarios and coding exercises, and you can earn a free certificate of completion by passing the final exam.

Syllabus

  1. APIs and HTTP Basics

    Understand what APIs are, how clients and servers cooperate through contracts, and how HTTP requests and responses are built.

    1. What Is an API?11 min
    2. How the Web Talks: HTTP Requests and Responses13 min
  2. JSON: The Language of APIs

    Read and write JSON correctly, then parse, serialize, validate and reshape API data in JavaScript and Python.

    1. JSON Syntax: Objects, Arrays and Values13 min
    2. Working with JSON in Code14 min
  3. REST APIs

    Design and read RESTful endpoints, map CRUD to HTTP methods, and interpret status codes and error responses like a professional.

    1. REST: Resources, URLs and Representations13 min
    2. HTTP Methods and CRUD14 min
    3. Status Codes and Error Handling14 min
  4. Using Real APIs

    Filter, sort and page through data, authenticate securely, respect rate limits, and call APIs robustly from JavaScript, Python and the command line.

    1. Query Parameters, Filtering and Pagination14 min
    2. Authentication, API Keys and Rate Limits14 min
    3. Calling APIs from Code15 min
  5. Designing APIs and Beyond REST

    Design consistent, versioned, well-documented REST APIs, and know when webhooks, GraphQL, gRPC or WebSockets are the better tool.

    1. Designing a Clean REST API14 min
    2. Webhooks, GraphQL and Beyond REST14 min
  6. Final exam and certificate

    20 questions drawn from a pool of 32. Score 70% or more to pass; retakes get a fresh set of questions.

Try a sample question

An API is only useful to programmers who work at the company that built it.

True or false?

Show the answer

Answer: False

Public APIs are designed for outside developers: thousands of independent apps use the same maps, payment and weather APIs. Many companies also use APIs internally, so different teams' services can work together through stable contracts.

API
Application programming interface: a defined way for one program to request data or actions from another.
Client
The program that sends a request, such as a browser, mobile app or script.
Server
The program that receives requests and sends responses.
Endpoint
A specific method and URL path combination an API offers, such as GET /books/{id}.
HTTP
Hypertext Transfer Protocol: the request-response protocol web APIs use; HTTPS is its encrypted form.
URL
Uniform resource locator: the address of a resource, made of scheme, host, path and optional query string.

Frequently asked questions

What is an API in simple terms?

An API (application programming interface) is a defined way for one program to ask another for data or actions. A web API is reached over the internet: the client sends an HTTP request to a URL, and the server replies with a response, usually containing JSON.

What is the difference between REST and JSON?

REST is an architectural style for designing APIs around resources, URLs and standard HTTP methods. JSON is a data format. Most REST APIs send and receive JSON, but they are separate ideas: a REST API could return XML or CSV, and JSON is used in many places that have nothing to do with REST.

Do I need to know how to code to take this course?

No coding is needed to understand the concepts, and most exercises are questions, scenarios and calculators. The optional code challenges use short JavaScript functions; some experience in any language makes them easier.

What is the difference between PUT and PATCH?

PUT replaces the whole resource with the representation you send, so fields you leave out may be removed or reset. PATCH changes only the fields you send. PATCH is the usual choice for edit forms that change one or two fields.

What do 401 and 403 mean?

401 Unauthorized means the server does not know who you are: credentials are missing, invalid or expired. 403 Forbidden means it knows who you are, but you are not allowed to perform this action. Retrying a 403 without changing permissions will not help.

Is GraphQL replacing REST?

No. GraphQL is popular for apps whose screens need different slices of connected data, but REST remains the most common style for public APIs because it is simple, cacheable and universally supported. Many companies use both.

Is the certificate an accredited qualification?

No. It is a certificate of completion showing you finished the lessons and passed the final exam. It is a good way to show initiative, but it is not an academic or professional credential.

Sources and further reading

Related courses

Adults & professionalsBeginner

HTML and CSS Basics

Build and style a real web page from scratch, from first tag to responsive layout

Technology & Programming
2 h 5 min12 lessonsCertificate
TeensBeginner

Build Your First Website

HTML, CSS and a little JavaScript, from a blank file to a site online

Technology & Programming
1 h 55 min11 lessonsCertificate
University studentsIntermediate

Data Structures and Algorithms

Big O, arrays, hash tables, trees, graphs, sorting and dynamic programming with hands-on code

Technology & Programming
2 h 40 min13 lessonsCertificate
Adults & professionalsBeginner

JavaScript for Beginners

Variables, functions, arrays, objects, the DOM and async code

Technology & Programming
2 h 10 min12 lessonsCertificate
Adults & professionalsBeginner

Excel Fundamentals

Formulas, lookups, tables, PivotTables and charts from zero to confident

Technology & Programming
2 h 10 min12 lessonsCertificate
University studentsBeginner

Introduction to Computer Science

Binary, hardware, algorithms, code and the internet: the ideas behind every computer

Technology & Programming
2 h 35 min12 lessonsCertificate