DEV Community

Alex Spinov
Alex Spinov

Posted on

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")}
Enter fullscreen mode Exit fullscreen mode

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")
Enter fullscreen mode Exit fullscreen mode

3. Markdown to HTML Converter

import markdown

@app.post("/convert")
def md_to_html(text: str):
    return {"html": markdown.markdown(text)}
Enter fullscreen mode Exit fullscreen mode

4. JSON Formatter/Validator

@app.post("/format")
def format_json(raw: str):
    try:
        parsed = json.loads(raw)
        return {"valid": True, "formatted": json.dumps(parsed, indent=2)}
    except json.JSONDecodeError as e:
        return {"valid": False, "error": str(e)}
Enter fullscreen mode Exit fullscreen mode

5. Password Strength Checker

import re

@app.get("/password-strength")
def check_strength(password: str):
    score = 0
    if len(password) >= 8: score += 1
    if len(password) >= 12: score += 1
    if re.search(r"[A-Z]", password): score += 1
    if re.search(r"[0-9]", password): score += 1
    if re.search(r"[^A-Za-z0-9]", password): score += 1
    levels = ["very weak", "weak", "fair", "strong", "very strong"]
    return {"score": score, "level": levels[min(score, 4)]}
Enter fullscreen mode Exit fullscreen mode

6-10 (Quick Ideas)

  1. Color palette generator — input a hex color, get complementary colors
  2. Text summarizer — count words, sentences, reading time
  3. IP info — wrap ip-api.com with caching
  4. Diff checker — compare two texts, return differences
  5. Placeholder image — generate colored placeholder images with text

Why Build APIs?

  • APIs are portfolio pieces that other developers can actually test
  • They teach you HTTP, authentication, error handling, and deployment
  • A useful API can get users on RapidAPI or your own hosting
  • You learn to think about rate limiting, documentation, and versioning

Deploy for Free

  • Deno Deploy — 100K requests/day
  • Railway — $5 free credit/month
  • Render — free tier with 750 hours/month
  • Fly.io — 3 shared VMs free

Which API would you build first?


More tutorials | GitHub


More from me: 10 Dev Tools I Use Daily | 77 Scrapers on a Schedule | 150+ Free APIs

Top comments (0)