Introduction to FastAPI
Build Python APIs with FastAPI: handle all four HTTP operations, validate requests, return status codes, use async and test a JSON CRUD API.
FastAPI is a Python web framework for building APIs that manage data on the web, and data and machine learning engineers use it for applications that handle data transactions and pipelines. You write endpoints for the four HTTP operations, validate incoming requests against schemas, answer failures with suitable status codes and messages, and run code asynchronously so an application can cope with heavier workloads. A small create, read, update and delete API, tested end to end, ties these pieces together.
What You Will Achieve
- Write FastAPI endpoints that read and change data through all four HTTP operations
- Define request and response schemas so incoming data is validated before your code acts on it
- Send back a fitting status code and message when a client request fails
- Test an API’s endpoints one at a time and as a working whole with Python’s requests module
Program Overview
FastAPI Basics: GET and POST Operations
Starts with what FastAPI is good at, runs a first application, and builds GET and POST endpoints that accept request parameters.
- Key features and core use cases of FastAPI
- FastAPI compared with Django
- A first application and GET endpoints
- POST operations with a Pydantic model
Advanced FastAPI Topics
Adds the remaining HTTP operations, careful error responses and asynchronous code for handling more requests at once.
- PUT and DELETE operations
- Error handling and status code classification
- Responding to a client error
- Async for concurrent work and when to use it
Building and Testing a JSON CRUD API
Puts the pieces into one JSON API that manages object lifecycles over HTTP, checked with automated and manual tests.
- Unit tests versus system tests
- HTTP operations mapped to CRUD steps
- A complete JSON CRUD API
- Manual functional tests
Certificate Awarded (Paid)
Job Outlook
FastAPI skills are used wherever Python applications need to expose data over HTTP, including data management services and the pipelines that serve machine learning models.
Good for: Python programmers who want to build and test their own APIs for data services or for serving machine learning models.
Keep in mind: Exercises run in the course environment with nothing to install; to build your own FastAPI projects afterwards you will want a local Python setup.
Bottom line: A compact walk through FastAPI’s request handling, error responses and async code that ends with a tested CRUD API you build yourself.
Frequently Asked Questions
Which other web framework is FastAPI compared with?
The first chapter sets FastAPI beside Django as part of a look at its key features and the core use cases where it fits among Python web frameworks.
What role does Pydantic play in the lessons?
A Pydantic model defines the schema for the data a POST request carries. The first chapter introduces the model and then puts it to work in a running POST endpoint.
What does the async lesson cover?
The second chapter shows how to use async so an application can serve concurrent requests and handle higher workloads, discusses when async is the right choice, and applies it to a DELETE operation.
What does the final JSON CRUD project involve?
You build a JSON API that manages objects over HTTP, mapping each HTTP operation to a create, read, update or delete step. System tests check single endpoints, and a manual functional test checks them working together.
User Reviews
Write your review
You must be logged in to post a review.
Reviews can only be posted by registered learners. Log in or create a free account, then you will return here to post.


There are no reviews yet.