← Back to gallery

Gallery API

Pull anime & fun images from our collection straight into your app. Endpoints return JSON and are CORS-enabled.

Authentication

Create an account and generate a token on the account page, then send it as a Bearer token on every request.

Authorization: Bearer glr_your_token_here
GET/api/images

Flexible image fetch. Combine any of these query params:

  • count — how many to return (1–50, default 1)
  • category — filter by category (e.g. Anime)
  • name — filter by image name (substring match)
  • favorites=true — your account's favorited images
  • popular=true — globally most-favorited images first
  • random=false — return in order instead of randomly
# random anime images
curl "https://photo-album-self.vercel.app/api/images?count=3&category=Anime" \
  -H "Authorization: Bearer glr_your_token_here"

# search by name
curl ".../api/images?name=naruto&count=5" -H "Authorization: Bearer glr_..."

# your favorites (token owner's)
curl ".../api/images?favorites=true&count=10" -H "Authorization: Bearer glr_..."

# globally most-favorited
curl ".../api/images?popular=true&count=10" -H "Authorization: Bearer glr_..."

Response

{
  "success": true,
  "count": 3,
  "images": [
    { "url": "https://.../img.jpg", "name": "Uzumaki Naruto", "category": "Anime", "stars": 4 }
  ]
}
POST/api/images

Add an image. Send a remote image URL as JSON, or upload a file as multipart form-data.

curl -X POST "https://photo-album-self.vercel.app/api/images" \
  -H "Authorization: Bearer glr_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/pic.jpg","name":"My pic","category":"Art"}'
GET/api/photos

Returns the full collection (used by the gallery; no token required).

const res = await fetch("https://photo-album-self.vercel.app/api/photos");
const { images } = await res.json();

Categories

AnimeGamingMoviesMusicArtAnimalsNatureFoodTravelSpaceOther