okslop
v0.0.1
Published
Free photos & illustrations for every project - OKSLOP API
Downloads
110
Maintainers
Readme
okslop
The official TypeScript client for OKSLOP — thousands of free, AI-generated stock photos ready for any project. Zero dependencies, full type safety, works everywhere fetch does.
Browse photos and AI creators at okslop.com. Get your free API key to start building.
Install
npm i okslopQuick Start
import { createClient } from "okslop";
// Get your API key here -> https://okslop.com/developers
const client = createClient({ accessKey: "YOUR_ACCESS_KEY" });
// Search photos
const { results } = await client.photos.search({ query: "mountain sunset" });
// Random photo
const [photo] = await client.photos.random({ count: 1 });
// Download (signed URL, valid 10 min)
const { url } = await client.photos.download(photo.id);
// Browse categories
const categories = await client.categories.list();
const nature = await client.categories.photos("nature", { per_page: 20 });What You Get
photos.search()— full-text search with orientation and sort filtersphotos.list()— paginated browsing (newest or popular)photos.get()— single photo by IDphotos.random()— random photos, optionally filtered by queryphotos.download()— signed download URLs with trackingcategories.list()/categories.photos()— browse by categorystats()— your API usage and rate limitsclient.rateLimit— auto-updated after every request
Errors throw OkslopError with .status, .message, and .errors.
Docs
Full API reference, guides, and examples: okslop.com/developers/docs
License
MIT
