Hello! This article is a short introduction to FastAPI, a high-performance Python framework used to prototype fast production-ready APIs. Thanks for reading!
As posted on the official website, FastAPI key features are listed below:
- Very high performance - thanks to Starlette and Pydantic
- Fast-to-code and intuitive
- Robust - provides interactive documentation
- Standards-based - fully compatible with
In other words, FastAPI helps us to code faster and easier a production-ready API with autogenerated docs.
✨ Simple FastAPI Project
FastAPI requires Python 3.6 (or above) to execute successfully. For most of the Unix environments, Python3 might be already installed. To check the version, open a terminal and type:
If the version is 3.6 or above we can move forward and create a virtual environment for our first project powered by FastAPI.
Create/activate a Virtual Environment (Unix systems)
Create/activate a Virtual Environment for Windows Systems
Save the file and start the project using
At this point we should be able to visit the API in the browser:
- API Root:
- OpenAPI Specs:
Thanks for reading! For more resources, please access: