惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
有赞技术团队
有赞技术团队
J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Hugging Face - Blog
Hugging Face - Blog
人人都是产品经理
人人都是产品经理
酷 壳 – CoolShell
酷 壳 – CoolShell
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
Check Point Blog
博客园 - 【当耐特】
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
The Cloudflare Blog
Microsoft Azure Blog
Microsoft Azure Blog
腾讯CDC
Vercel News
Vercel News
IT之家
IT之家
MyScale Blog
MyScale Blog
博客园_首页
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
罗磊的独立博客

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I Built a Free Meme API with 2,300+ Templates on Cloudfla...
CodeLong888 · 2026-05-17 · via DEV Community

Last month I wanted to add meme generation to a side project. Every meme API I found was either paid, rate-limited to hell, or had maybe 50 templates.

So I built my own. justmeme.wtf has 2,300+ meme templates, a free API, and runs entirely on Cloudflare Workers + D1.

Here's how it works and what I learned.

The Stack

  • Cloudflare Workers — handles all routing, SSR, and image generation
  • Cloudflare D1 — stores 2,300+ meme templates with metadata
  • Canvas API — server-side text rendering on meme images
  • No framework — vanilla JS, single index.js file

Total monthly cost: $0 (Cloudflare free tier covers it).

The API

The API is completely free, no auth required. Here's what you can do:

Get all templates

curl https://justmeme.wtf/api/v1/templates

Returns every template with its slug, name, text box count, and dimensions.

Get a specific template

curl https://justmeme.wtf/api/v1/templates/drake-hotline-bling

Returns template details including image URL and text box positions.

Search templates

curl "https://justmeme.wtf/api/v1/templates/search?q=brain"

Trending memes

curl https://justmeme.wtf/api/v1/trending

AI meme generation

curl -X POST https://justmeme.wtf/api/v1/ai-generate -H "Content-Type: application/json" -d '{"prompt":"a cat coding"}'

Full API docs: justmeme.wtf/api-docs

Architecture Decisions

Why Cloudflare Workers?

I wanted zero cold starts and global edge deployment without managing servers. Workers spin up in less than 1ms and run in 300+ locations. For an image API that needs to be fast, this matters.

Why D1 over KV?

KV is great for simple key-value lookups, but I needed to query templates by category, search by name, and paginate results. D1 gives me SQL for free.

Image generation without Node Canvas

The tricky part was rendering text on images without node-canvas (which doesn't work in Workers). I used the built-in Canvas API available in Cloudflare Workers with the Browser Rendering binding. For simpler cases, I pre-compute text positions and overlay them on the fly.

SEO: Making Memes Indexable

Each of the 2,300+ templates has its own page at /meme/{slug} with:

  • Unique title and meta description (not just the template name)
  • Schema.org structured data
  • OG image that's the actual meme template
  • How-to content for each template
  • Related templates for internal linking

The sitemap splits across multiple files to stay under the 50MB limit.

What I'd Do Differently

  1. Start with fewer templates. I loaded 2,300 on day one. Google flagged a lot as "discovered but not indexed" because the pages looked too similar. Starting with 200 high-quality pages and growing would have been smarter.

  2. Add user-generated content earlier. Google values pages that change. A comment section or "trending memes made with this template" would help.

  3. Build the API first. The website gets traffic, but the API is what developers actually link to. I should have launched the API on its own and marketed it to dev communities.

Try It

The whole thing is a Cloudflare Worker. If you're building something that needs meme generation, the API is free. Use it.