Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Start Building With FastAPI (Summary)

You’ve just scratched the surface of what FastAPI can do and learned the essentials of creating a Python API, from installation to interactive documentation.

In this video course, you’ve learned how to:

  • Install FastAPI with the recommended standard extras for a complete development environment
  • Create minimal API endpoints that automatically handle JSON serialization
  • Use automatic documentation to test and share your API specifications

FastAPI’s simplicity, performance, and built-in features make it an excellent choice for modern Python APIs. The automatic validation through Pydantic models saves you from writing boilerplate code, while the interactive documentation helps your API consumers understand and test endpoints without extra effort.

Resources mentioned in this lesson:

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

00:00 In the previous lesson, I showed you the FastAPI Swagger UI tool. This lesson summarizes the course, and in it I’ll point you at some places where you can learn some more.

00:10 FastAPI is a powerful framework for creating a REST-based API application. To use it, you define functions for each API endpoint in your app, mapping the functions to a URL.

00:22 You do this mapping through decorators, and there is a decorator for each of the various HTTP methods. FastAPI processes URL arguments as well as query parameters for you, passing them in as arguments to your function.

00:36 You can type-hint those arguments with Pydantic classes, so that FastAPI will validate and cast data into a Python class. To help with debugging and documenting your API, you also get a Swagger UI-based web tool built in.

00:52 There’s always more content at Real Python. This course and tutorial use the same concepts you’ve learned here to implement a URL shortener. Since a regular web server is just one that implements GET, you can build a website using FastAPI as well.

01:07 This tutorial shows you how to combine FastAPI with the HTML template toolkit, Jinja2, in order to render webpages.

01:16 If instead, like me, you’re a Django person, you might want to add API features to it as well. The Ninja library is heavily inspired by FastAPI, bringing all the decorator goodness to your existing Django projects.

01:32 That’s all for now. I hope you enjoyed the course. Thanks for your attention.

Become a Member to join the conversation.