Hi 🙂🖐 Today i will share with you how to Create a URL shortener API using FastAPI and Python. I will use simple ways as much as I can. I will use JSON as a database file; you can use anything else if you want; it's up to you. I prefer using JSON because it's very easy to use and setup. Now lit's create a JOSN file { "urls" : [ ] } We didn't add the number of clicks because I wanted to make it simple and easy, and counting the number of clicks requires more advanced things, like adding admins, users, and API keys. Now i will create the API 😎 from fastapi import FastAPI from fastapi.responses import RedirectResponse from secrets import token_urlsafe from pydantic import BaseModel import json import validators app = FastAPI () database = json . load ( open ( ' database.json ' , ' r ' )) class Url ( BaseModel ): url : str @app.get ( ' / ' ) def home (): return { ' msg ' : ' Welcom...