The skill
Pexels — Stock Photo Search & Retrieval
What It Does
Searches and retrieves stock photos from the Pexels API. Returns structured photo data with multiple resolution URLs.
Engine API (programmatic)
const pexels = require('./engine');
// Search
const res = await pexels.searchPhotos({ query: 'mountain landscape', perPage: 10, orientation: 'landscape' });
// Returns: { ok, data: { photos: [...], total_results, page }, meta: { skill, command, duration_ms } }
// Get single photo
const photo = await pexels.getPhoto({ id: 12345 });
Photo Object Shape
{ id, url, photographer, photographer_url, avg_color, width, height, alt, src: { original, large2x, large, medium, small, tiny } }
Critical Rules
- Every function returns
{ ok, data, error, meta }— universal result contract. - Always credit photographer when using images.
Env Vars
PEXELS_API_KEY— Pexels API key (required)