How To Create a Python API With FastAPI - Full Tutorial

32,007
0
Published 2024-05-23
Host your API with Hostinger by going to: hostinger.com/TechwithTim and using my code TECHWITHTIM

In today's video I'm going to be showing you guys how you can create your own API using Python for web applications. API (application programming interface) essentially allows one piece of software to request data from another and receive a response.

If you want to land a developer job: techwithtim.net/dev

🎞 Video Resources 🎞
How to host this FastAPI: fastapi.tiangolo.com/vi/deployment/manually/
Finished Code: github.com/techwithtim/Fast-API-CRUD-App/tree/main
Fix Pip (MacOS):    • How to Install Pygame on Mac OSX (Fas...  
Fix Pip (Windows):    • How to Install Pygame (Windows 8/10)  

⏳ Timestamps ⏳
00:00 | What is an API?
00:40 | CRUD
01:19 | Request/Response
01:38 | JSON
04:15 | FastAPI Overview
04:44 | Install/Setup
05:35 | Running FastAPI
09:00 | Pydantic Models
12:02 | Post Request
13:39 | Get Requests
15:57 | Path Parameters
17:45 | Put Requests
20:30 | Delete Requests
22:10 | Testing the API
23:41 | Small Fix To Delete Request

Hashtags
#api #pythonprogramming #techwithtim

All Comments (21)
  • Thanks tim, i was having trouble with with this API thing, turned out much simpler than what i expected
  • @utrodus
    Thanks tim 🎉 you’re the best 😊
  • Awesome tutorial, always a pleasure to enhance coding skills by watching your videos.
  • @iSteadyTech
    To anyone seeing this comment, Just know you are capable of making it it's all on what you tell and teach yourself <3
  • @SandyLearner
    Hi @Tim, Very much appreciated for putting such Project based videos on Python. A earnest Request can you post Python Automation for DevOps Automation with Microservice Dev. It's very rare in YouTube to see such videos . Usage of adv 3rd party modules , Virtual Env for Task Automation 🎉🎉
  • @RishavKundu
    great video. just to note, imo you never want to set a root pass for your deployment. always always setup keys initially!! it'll save you the trouble down the line :)
  • Hi Tim this was an amazing video , is it possible to have some go-lang videos in the future ? you have a talent for teaching and i would love to learn more about go from you
  • @Sarvesh_Ganesan
    Hey Tim. Nice video! Is it possible for you to make a video on how to build agent frameworks from scratch using python?
  • @IOSARBX
    Tech With Tim, Subscribed because your videos are always awesome!
  • @Anonymous-dy2te
    I finished the API, but instead of using an in-memory implementation, If you used any database. It's even a good project.
  • @faru2301
    Love from kerala 🌴🌴🌴🌴🌴🌴
  • Hi! Nice video!! Where do you recommend deploying a fastapi serverless? I tried vercel but its not very python friendly yet apparently. Thanks!! 😄
  • @basomiddin
    Of course nice tutorial. However everyone would like to get information about templating like flask. Tim, I know you can make that kind of tutorials as well for your subscribers)))
  • @adarmawan117
    Hi, Tim Can you please make a video how to up this project online,? Thankss
  • @disispeter
    hey Tim just checking in for issues im having on my end as a new programmer learning python...I had fastapi imported and unicorn imported awhile ago following one of ur old videos, but apparently I was having trouble in the editor claiming module could not be found... so I spend 3 days learning how to properly setup a folder to organize files and learned how to setup venv and how to properly activate it just for ip link not to work in my browser...I haven't gotten past the 8:08 mark yet..I get it im a beginner and dont know how to setup everything up from scratch but im still trying