Packt
Mastering REST APIs with FastAPI
Packt

Mastering REST APIs with FastAPI

Included with Coursera Plus

Gain insight into a topic and learn the fundamentals.
Intermediate level

Recommended experience

12 hours to complete
3 weeks at 4 hours a week
Flexible schedule
Learn at your own pace
Gain insight into a topic and learn the fundamentals.
Intermediate level

Recommended experience

12 hours to complete
3 weeks at 4 hours a week
Flexible schedule
Learn at your own pace

What you'll learn

  • Build RESTful APIs with FastAPI, integrating advanced features like user authentication and async databases.

  • Implement comprehensive logging, testing, and debugging practices for secure and maintainable applications.

  • Leverage FastAPI features like background tasks for image generation and email processing.

  • Deploy applications to platforms like Render with continuous integration pipelines.

Details to know

Shareable certificate

Add to your LinkedIn profile

Recently updated!

February 2025

Assessments

11 assignments

Taught in English

See how employees at top companies are mastering in-demand skills

Placeholder
Placeholder

Earn a career certificate

Add this credential to your LinkedIn profile, resume, or CV

Share it on social media and in your performance review

Placeholder

There are 11 modules in this course

In this module, we will lay the foundation for your journey into mastering REST APIs with FastAPI. You will explore the importance of community in software development, gain clarity on what to expect from this course, and dive into the core concepts of APIs and REST, setting the stage for the practical lessons ahead.

What's included

4 videos1 reading

In this module, we will dive into the essentials of working with FastAPI, starting with creating your first application. You will learn how to configure a clean and maintainable setup, follow best practices for code formatting, and implement core features of a social media API. By the end of this section, you will also know how to manage a scalable codebase using APIRouter for modular development.

What's included

7 videos1 assignment

In this module, we will explore pytest, a robust testing framework for Python. You will start with its basics and then focus on writing and implementing tests for your FastAPI applications. By the end of this section, you will have built a suite of tests to ensure the reliability of the posts and comments features in your API, laying the groundwork for quality assurance in your projects.

What's included

6 videos1 assignment

In this module, we will delve into the integration of asynchronous databases with FastAPI. You will learn how to install necessary dependencies, create configuration files using Pydantic, and manage multiple environments. Additionally, you will set up an async database, handle connections using lifespan events, and integrate database operations into your API routers to enable seamless data persistence.

What's included

9 videos1 assignment

In this module, we will focus on implementing robust logging mechanisms in FastAPI applications. You will explore Python’s logging framework, configure multiple loggers, and add file handlers to persist logs. Advanced techniques like using filters, obfuscating sensitive data, and implementing correlation IDs will also be covered. Additionally, you’ll learn how to integrate and manage cloud-based logging tools like Logtail, enabling efficient monitoring and debugging in production.

What's included

14 videos1 assignment

In this module, we will cover user authentication in FastAPI, from the basics of creating a users table to advanced features like token generation and password hashing. You will implement user registration, retrieve the current user using tokens, and apply dependency injection for streamlined user management. Additionally, the module explores integrating user relationships with other tables and optional features like OAuth Password Bearer and Swagger for secure and well-documented APIs.

What's included

12 videos1 assignment

In this module, we will explore the implementation of many-to-many relationships in FastAPI using SQLAlchemy. You will learn how to set up a table for post likes, create API routes for interacting with posts, and streamline database operations with reusable queries. The module also covers advanced techniques like using query string arguments and Enums to enable data sorting and filtering, enhancing the functionality and user experience of your application.

What's included

4 videos1 assignment

In this module, we will implement user email confirmation in FastAPI. You will learn how to generate and decode confirmation tokens, create a confirmation endpoint, and enforce email verification for authenticated requests. Additionally, the module guides you through setting up Mailgun, sending confirmation emails, and optimizing email delivery using background tasks to ensure a seamless and efficient user experience.

What's included

8 videos1 assignment

In this module, we will focus on enabling file uploads in your FastAPI application. You'll learn how to set up and integrate Backblaze B2 as a file storage solution, implement a dedicated file upload endpoint, and write tests to ensure seamless and secure operation.

What's included

4 videos1 assignment

In this module, you will learn how to implement image generation features in FastAPI using background tasks. You will modify your application’s models and databases, configure DeepAI as a third-party service, and use background tasks to optimize image generation. By the end, you will have fully integrated image generation functionality into your FastAPI endpoints.

What's included

4 videos1 assignment

In this module, you will learn to deploy and manage FastAPI applications effectively. You will update your project to Pydantic v2, deploy your app to Render, and configure a PostgreSQL database. Additionally, the module covers integrating Sentry for error tracking and setting up GitHub Actions for continuous integration, ensuring a streamlined deployment and management process.

What's included

5 videos2 assignments

Instructor

Packt - Course Instructors
Packt
567 Courses49,058 learners

Offered by

Packt

Why people choose Coursera for their career

Felipe M.
Learner since 2018
"To be able to take courses at my own pace and rhythm has been an amazing experience. I can learn whenever it fits my schedule and mood."
Jennifer J.
Learner since 2020
"I directly applied the concepts and skills I learned from my courses to an exciting new project at work."
Larry W.
Learner since 2021
"When I need courses on topics that my university doesn't offer, Coursera is one of the best places to go."
Chaitanya A.
"Learning isn't just about being better at your job: it's so much more than that. Coursera allows me to learn without limits."

New to Software Development? Start here.

Placeholder

Open new doors with Coursera Plus

Unlimited access to 10,000+ world-class courses, hands-on projects, and job-ready certificate programs - all included in your subscription

Advance your career with an online degree

Earn a degree from world-class universities - 100% online

Join over 3,400 global companies that choose Coursera for Business

Upskill your employees to excel in the digital economy

Frequently asked questions