Trending
Tags appearing disproportionately often in recent posts compared to their baseline rate.
Window
Category
How this works: API calls behind this demo
This page combines two endpoints. The trending endpoint requires an API key; the search endpoint does not.
1. Fetch trending tags
curl -H "X-API-Key: YOUR_KEY" \ "https://lagoon.io/api/v1/trending?window=24h&limit=15"
Filter to a category with the category param (character, copyright, general, species):
curl -H "X-API-Key: YOUR_KEY" \ "https://lagoon.io/api/v1/trending?window=24h&category=character"
2. Get recent posts for a trending tag
curl "https://lagoon.io/api/v1/search?tag=character_name&sort=newest&limit=6"
3. Load thumbnails
Each search result includes an id. Use the thumbnail endpoint for scaled WebP images:
<img src="https://lagoon.io/api/v1/thumb?id=12345" alt="Post thumbnail">
Minimal example: trending discovery pipeline
fetch("https://lagoon.io/api/v1/trending?window=24h&limit=5", {
headers: { "X-API-Key": "YOUR_KEY" }
})
.then(r => r.json())
.then(data => {
data.tags.forEach(t => {
console.log(t.tag, "x" + t.trend_score, t.recent_count + " recent");
// fetch posts: /api/v1/search?tag= + t.normalized + &sort=newest
// thumbnails: /api/v1/thumb?id= + post.id
});
});
Response shape
{
"ok": true,
"window": "24h",
"count": 5,
"tags": [
{
"tag": "character:sessyoin kiara (heaven's hole)",
"normalized": "character_sessyoin_kiara_heaven_s_hole",
"category": "character",
"recent_count": 29,
"total_count": 46,
"trend_score": 36.0
}
]
}
Full parameter reference: API docs, /trending.