Random Image API - JSON responses & client-side redirects
Get a random image as JSON (truly random, different result each call):
curl https://acg-api.pages.dev/api/random
Get a random image as JSON (static file, same result):
curl https://username.github.io/acg-api/api/random.json
Jump directly to a random image:
https://username.github.io/acg-api/img/random.html
# Cloudflare Pages - truly random (different result each call) curl https://acg-api.pages.dev/api/random curl https://acg-api.pages.dev/api/random?size=5 curl https://acg-api.pages.dev/api/anime curl https://acg-api.pages.dev/api/categories # GitHub Pages - static files (same result) curl https://username.github.io/acg-api/api/random.json curl https://username.github.io/acg-api/api/anime.json curl https://username.github.io/acg-api/api/categories.json # Browser batch requests (requires JavaScript) https://username.github.io/acg-api/?api=random&size=5 https://username.github.io/acg-api/?api=random&category=anime&size=3
1. Place images in images/category/ directory
2. Push to master branch
3. GitHub Actions auto-updates the index