FastAPI is one of the fastest ways to build lightweight, production-ready APIs using Python.
In this post, I’ll show you how to create a minimal FastAPI service in under 10 minutes, perfect for automation workflows, internal tools, or integrations with platforms like n8n, Make.com, and Zapier.
This is part of my ongoing effort to build in public while constructing the technical backbone of my one-person company.
If you know basic Python, you can follow this — no backend experience required.
🚀 What We’re Building
A tiny FastAPI service that:
- Exposes a simple
/pingendpoint - Accepts JSON input
- Returns structured JSON output
- Runs locally or inside n8n / Make webhooks
- Can be deployed later to Fly.io, Render, Vercel, etc.
The goal is to create something simple, reliable, automation-friendly, and easily extendable.
📦 Requirements
You’ll need:
- Python 3.8+
fastapiuvicorn
Install dependencies:
pip install fastapi uvicorn
🧪 Minimal Working Code Example
Create a file named main.py:
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class Message(BaseModel):
text: str
@app.get("/ping")
def ping():
return {"status": "ok", "message": "FastAPI is running!"}
@app.post("/echo")
def echo(message: Message):
return {"received": message.text}
Run the service:
uvicorn main:app --reload
Your API is now running at:
http://127.0.0.1:8000
Try these URLs:
-
GET /ping→ Health check -
POST /echowith JSON payload
Example:
{
"text": "Hello FastAPI"
}
You’ll get back:
{
"received": "Hello FastAPI"
}
🧩 Why This Tiny Service Is Powerful
Even this minimal version can be used to:
- Build automation steps for n8n
- Create custom webhooks for Make.com
- Build simple bots
- Add Python logic to no-code workflows
- Serve as a microservice in your personal stack
- Prototype AI tools
- Power internal dashboards
This small piece becomes the foundation for larger engineering blocks.
🛠️ Optional: Connecting to n8n or Make.com
If you want to integrate immediately:
In n8n:
- Add an HTTP Request node
- Set method to POST
- URL:
http://127.0.0.1:8000/echo - Send JSON payload
In Make.com:
- Add an HTTP module
- POST JSON to the same endpoint
Instant custom automation.
📚 Full Code + Future Examples
I’ll publish the full FastAPI template repo (including logging, config, and deployment options) on GitHub soon.
👉 (GitHub repo link placeholder — to be added)
💬 Want More Tutorials?
Let me know if you'd like:
- A FastAPI + Notion API microservice
- A FastAPI + n8n workflow
- Deploying FastAPI to Fly.io / Render
- Turning this into a CLI + API hybrid tool
- Full automation stack breakdown for one-person companies
Thanks for reading — and happy building! 🚀
Top comments (0)