Random Discovery
Random posts from the index. Add a filter or pick a topic, or leave blank for anything. SFW filtering is on by default.
How this works: API calls behind this demo
This page makes two calls. Everything you see here is reproducible with the public API.
1. Fetch random posts
curl "https://lagoon.io/api/v1/random?limit=6"
Add a natural-language filter with the nl param:
curl "https://lagoon.io/api/v1/random?limit=6&nl=blue+hair+from+pixiv"
You can also use structured params: tag, platform, artist, rating, date_from, date_to.
curl "https://lagoon.io/api/v1/random?limit=6&tag=scenery&platform=pixiv"
2. Load thumbnails
Each result includes an id. The thumbnail endpoint returns a WebP image, max 360px.
curl "https://lagoon.io/api/v1/thumb?id=12345" -o thumb.webp
Or use it directly as an <img> src:
<img src="https://lagoon.io/api/v1/thumb?id=12345" alt="Post thumbnail">
Minimal example: recreate this demo
fetch("https://lagoon.io/api/v1/random?limit=6&nl=dragon")
.then(r => r.json())
.then(data => {
data.results.forEach(post => {
console.log(post.title, post.artist_handle, post.source_url);
// thumbnail: /api/v1/thumb?id= + post.id
// tags: post.tags (array of "category:name" strings)
});
});
Response shape
{
"ok": true,
"results": [
{
"id": 12345,
"title": "Summer breeze",
"source_url": "https://...",
"platform": "pixiv",
"platform_name": "Pixiv",
"artist_handle": "artist_name",
"artist_name": "Artist Name",
"posted_at": "2025-03-15T12:00:00Z",
"tags": ["character:original", "scenery", "sky"]
}
]
}
Full parameter reference: API docs, /random.