Building APIs with FastAPI

Build JSON APIs in Python with FastAPI. Learn how HTTP works by calling real APIs, then write routes, read parameters and request bodies, validate data, and send honest status codes.

BTaught by Brad Traversy
4.8
31 enrolled

Start learning

Build real skills one lesson at a time

Explore the complete curriculum below, then start with the lesson that is right for you.

About this course

This course teaches you to build web APIs in Python with FastAPI. You'll start on the client side, reading real responses with requests to see what HTTP looks like. Then you'll build a server by hand to see what a server actually does, hand the busywork to FastAPI, and grow one API until it creates, reads, updates, and deletes data and saves it to a file. You test every route from the built-in HTTP Client.

What you'll learn

  • How HTTP requests and responses work: methods, paths, status codes, headers, and JSON
  • What a Python server does underneath, by building a bare ASGI app
  • Writing FastAPI routes that return JSON
  • Reading path and query parameters, with type hints that convert and check them
  • Accepting request bodies and validating them with Pydantic models
  • Handling POST, PUT, and DELETE requests and sending honest status codes
  • Adding middleware, dependencies, and an API key check
  • Organizing a bigger API with routers and saving data to a JSON file

Prerequisites

Course instructor

BT

Brad Traversy

Founder of Traversy Media and an educator known for practical, project-focused web development courses.

Course content