Skip to content

dinalllll/thumbapi-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ThumbAPI Examples

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.

Quick start

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 }
}

Examples in this repo

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

Getting an API key

  1. Sign up at app.thumbapi.dev (free tier: 5 generations/month, no credit card).
  2. Copy your API key from the dashboard.
  3. Set it as THUMBAPI_KEY in your environment, or pass it directly via the x-api-key header.

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.

Supported formats

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

Supported image styles

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.

Use cases

Workflow integrations

Documentation

License

Examples in this repository are released under the MIT license — use them freely in your own projects. See LICENSE.

Contributing

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.

About

Code samples for ThumbAPI — generate YouTube, Instagram, X, LinkedIn, blog/OG thumbnails from any title via REST API. Node.js, Python, cURL, Wordpress , n8n examples.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors