Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Node.js examples

Working Node.js examples for the ThumbAPI generate endpoint.

Setup

# Requires Node.js 18+ (built-in fetch). Tested on Node 20 and 22.
export THUMBAPI_KEY="your_api_key_here"

Get an API key at app.thumbapi.dev — free tier is 5 generations/month, no credit card required.

Examples

  • basic-generate.js — minimal POST request, save the WebP to disk.
  • with-personal-image.jswith-image style: include a person's face from a local JPEG.
  • batch-from-csv.js — read titles from a CSV, generate one thumbnail per row with retry + concurrency control.

Run

node basic-generate.js
node with-personal-image.js
node batch-from-csv.js titles.csv

See also