Working code samples for the ThumbAPI thumbnail generation REST API. Generate AI-powered, platform-optimized thumbnails for YouTube, Instagram, X, LinkedIn, blog posts, and Open Graph images from any title with a single POST request.
What is ThumbAPI? One REST endpoint, multiple platform formats, three styles (faceless / with-image / with-logo). Production-ready images returned in under 25 seconds. Free tier available — no credit card required. See thumbapi.dev/docs for full reference.
curl -X POST https://api.thumbapi.dev/v1/generate \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "10 Tips to Grow Your Channel",
"format": "youtube",
"imageStyle": "faceless"
}'Response:
{
"image": "data:image/webp;base64,UklGR...",
"format": "youtube",
"outputFormat": "webp",
"dimensions": { "width": 1280, "height": 720 }
}| Language / tool | What it shows |
|---|---|
| Node.js | Basic generate, with-image style, batch from CSV |
| Python | Basic generate, batch with concurrency + retry |
| cURL | Minimal shell examples for every style and format |
| WordPress | Single-file plugin: auto-generate the featured image on post publish |
| n8n | Importable workflow JSON: YouTube RSS → ThumbAPI → Google Drive |
- Sign up at app.thumbapi.dev (free tier: 5 generations/month, no credit card).
- Copy your API key from the dashboard.
- Set it as
THUMBAPI_KEYin your environment, or pass it directly via thex-api-keyheader.
A public test key thumbapi_test is available that returns a static placeholder image — useful for wiring up integrations before you've signed up. See thumbapi.dev/integrations/n8n for an example.
format |
Dimensions | Use case |
|---|---|---|
youtube |
1280×720 | YouTube video thumbnails |
instagram |
1080×1080 | Instagram feed posts |
x |
1200×675 | X (Twitter) link previews |
linkedin |
1200×627 | LinkedIn post images |
blogpost |
1200×630 | Blog cover images, OG/Twitter cards |
imageStyle |
Description |
|---|---|
faceless |
Text-and-graphic design, no people. Best for automated content and faceless channels. |
with-image |
Composites a person's photo into the thumbnail. Send personImage as base64 or use a saved asset with usePersonalPhoto: true. |
with-logo |
Overlays a brand logo. Send personImage as base64 PNG or use a saved asset. |
- YouTube Thumbnail API — 1280×720 thumbnails from a title.
- OG Image API — 1200×630 Open Graph and Twitter cards.
- Blog Cover API — Cover images for articles.
- Personalized Thumbnails — Your face on every image.
- Branded Thumbnails — Brand logo on every image.
- Faceless Thumbnails — Text-only thumbnail designs.
- n8n integration guide — copy/paste workflow JSON included in this repo.
- Make.com integration guide
- Zapier integration guide
- Full API reference
- Authentication
- Rate limits
- Custom asset datasets — upload reference images for brand-consistent generation
- Error codes
- Changelog
Examples in this repository are released under the MIT license — use them freely in your own projects. See LICENSE.
Found a bug in an example, or want to add a sample in a new language (Go, Rust, PHP, Ruby)? Open a pull request. Or open an issue if you'd like to see a specific integration example.
Built and maintained by Aldin Kozica, creator of ThumbAPI.