
Every Developer Needs a Side API — Here Are 10 You Can Build This Weekend
Stop Building Todo Apps You learn more building a small API that solves a real problem than another tutorial project. Here are 10 APIs you can build in a weekend that people actually use. 1. URL Shortener API from fastapi import FastAPI import hashlib , json app = FastAPI () db = {} @app.post ( " /shorten " ) def shorten ( url : str ): short = hashlib . md5 ( url . encode ()). hexdigest ()[: 6 ] db [ short ] = url return { " short " : f " https://yourdomain/ { short } " } @app.get ( " /{code} " ) def redirect ( code : str ): return { " redirect " : db . get ( code , " not found " )} 2. QR Code Generator import qrcode , io from fastapi.responses import StreamingResponse @app.get ( " /qr " ) def generate_qr ( text : str ): img = qrcode . make ( text ) buf = io . BytesIO () img . save ( buf , format = " PNG " ) buf . seek ( 0 ) return StreamingResponse ( buf , media_type = " image/png " ) 3. Markdown to HTML Converter import markdown @app.post ( " /convert " ) def md_to_html ( text : str
Continue reading on Dev.to Tutorial
Opens in a new tab




