Trending, Random and Related: Three Video Widgets That Keep Visitors on an Adult Site Longer
The average visitor to a small adult site arrives on one video page, watches, and leaves. Every extra page they open is another ad impression, another chance to bookmark the site, and a signal to search engines that the page answered the visit. The cheapest way to get that extra page is what you show around the video. This post covers three widgets that work, the Porn API calls behind them, and the details that decide whether they get clicked.
1. Related videos under the player
This is the widget that matters most, because it's in front of every visitor at the moment they finish watching.
GET /api/v1/videos/{id}/related?limit=12
The API ranks related videos by same performers first, then by the most specific shared tags. The order matters: someone who watched a performer usually wants more of her, and someone who watched a narrow niche wants that niche, not the broad "Blonde" or "HD" tag every second video has. Generic tags make related lists that look random.
Details that raise clicks:
- Show it directly under the player, before comments or long descriptions. On phones, the first row must be visible right after the video.
- Thumbnail, duration and title on every card. Duration is the second thing people look at.
- Twelve cards, not four; people scroll on phones.
- Link to your own video pages, not to the embed. Your page has your ads and the next set of related videos.
2. A trending strip
GET /api/v1/videos/trending?period=day&per_page=12
GET /api/v1/videos/trending?period=week&orientation=gay&per_page=12
Trending takes the same filters as search, so a niche site can show what's trending in its niche rather than across the whole catalogue. Use it on the homepage ("Trending today") and as a fallback row on video pages with few related videos. Cache it for 15 to 30 minutes; it doesn't need to be live to the second.
A trending row also keeps the homepage different every day, which gives crawlers a reason to come back. We covered why that matters in how fresh content affects SEO.
3. A "surprise me" button
GET /api/v1/videos/random?count=1&orientation=trans&min_duration=300
A random button sounds like a gimmick and gets used a lot, especially by returning visitors who've seen your newest videos. Filter it: random within your niche, with a minimum length so it never lands on a 20-second clip. The same endpoint feeds bots; see the Telegram bot guide.
A small, cached widget in PHP
function api_cached($path, $ttl = 1800) {
$file = sys_get_temp_dir() . '/pz_' . md5($path) . '.json';
if (is_file($file) && time() - filemtime($file) < $ttl) return json_decode(file_get_contents($file), true);
$data = json_decode(@file_get_contents('https://pornalizer.app/api/v1' . $path), true);
if ($data) file_put_contents($file, json_encode($data));
return $data;
}
$rel = api_cached("/videos/$id/related?limit=12", 3600);
echo '<section class="related"><h2>More like this</h2>';
foreach ($rel['results'] ?? [] as $v) {
printf('<a href="/video/%d/"><img src="%s" alt="%s" loading="lazy" width="320" height="180"><span>%s</span><b>%s</b></a>',
$v['id'], $v['thumbnail'], htmlspecialchars($v['title']), $v['duration'], htmlspecialchars($v['title']));
}
echo '</section>';
Set width and height on thumbnails so the page doesn't jump while they load, and use loading="lazy" for rows below the fold.
Render on the server, not in the browser
Widgets built in JavaScript after the page loads are invisible to some crawlers and arrive late on slow phones. Render related videos in the HTML. They're internal links, and internal links are how crawlers find your other video pages; on our own sites, video pages that weren't linked from anywhere were simply never crawled.
Measure it
Count pages per visit before and after adding a widget, and clicks per widget. A related row that gets fewer clicks than the trending row is usually ranking by generic tags, or sitting too low on the page.
More ideas for keeping visitors and turning them into revenue: monetising without hosting costs and common mistakes new tube owners make. All endpoints: API documentation.
Frequently asked questions
How are related videos chosen?
The Porn API ranks related videos by shared performers first, then by the most specific tags the videos have in common, so narrow niches beat generic tags like HD or Blonde.
Should related videos be loaded with JavaScript?
Render them in the page HTML when you can. Server-rendered related links are visible to crawlers and help them discover your other video pages.
How often should a trending widget update?
Every 15 to 30 minutes is enough. Cache the API response and refresh it on that schedule.
Want a WordPress tube site that fills itself with tagged, categorized video — free?
Get your API key →