DEV Community

2x lazymac
2x lazymac

Posted on

How I Built a /Users/lazymac_2x/lazymac/scripts/devto-daily-publish.sh/Month API Business on Cloudflare Workers Free Tier

I run 30+ APIs in production and pay $0/month in infrastructure. Here's the exact setup.

The Free Tier Stack

Cloudflare Workers Free Plan:

  • 100,000 requests/day
  • 10ms CPU time per request
  • Global edge network
  • KV storage: 100k reads/day free

For most side projects, this never runs out.

Deploying Your First API in 5 Minutes

# Install Wrangler
npm install -g wrangler
wrangler login

# Create a new worker
wrangler init my-api
cd my-api
Enter fullscreen mode Exit fullscreen mode
// src/index.js — your entire API
export default {
  async fetch(request, env) {
    const url = new URL(request.url);

    if (url.pathname === '/calculate') {
      const n = parseInt(url.searchParams.get('n') || '0');
      return Response.json({ result: n * n, timestamp: Date.now() });
    }

    return Response.json({ error: 'Not found' }, { status: 404 });
  }
};
Enter fullscreen mode Exit fullscreen mode
wrangler deploy
# ✅ Deployed to: https://my-api.YOUR_SUBDOMAIN.workers.dev
Enter fullscreen mode Exit fullscreen mode

The Revenue Model

  1. Deploy API to Cloudflare Workers (free)
  2. List on Gumroad as a digital product with API key delivery
  3. List on RapidAPI for marketplace discovery
  4. Write one Dev.to tutorial targeting the exact search query your buyer types

My first API made $29 in month 2. Nothing changed except the Dev.to article.

The Numbers

  • Infrastructure: $0
  • Domain (api.lazy-mac.com): $12/year
  • Time to first deployment: ~1 hour
  • Time to first sale: 2-4 weeks (content dependent)

Browse the API store | Live API hub

Top comments (0)