Read a show’s Outlinks click report from code — people, filtered clicks, last click and clicks by episode
GET /benecaster-outlinks/v1/shows/{show_id}/report is the route the Show Settings → Outlinks tab’s table reads. It needs manage_options (send an X-WP-Nonce for wp_rest from a browser) and Outlinks on for {show_id}, else 403 benecaster_outlinks_not_active.
It answers { items, link_health }, one item per tracked link of the show. Each item has id, slug, label, reference_id, destination_url, go_url, clicks, bot_clicks, last_clicked_at, last_clicked, episodes (each { episode_id, title, clicks }), status and http_status.
clicks,last_clicked_atand each episode’sclickscount people only;bot_clickscounts the filtered clicks. A crawler visit never moveslast_clicked_at.last_clicked_atis ISO 8601 UTC (2026-10-21T10:30:00Z), for sorting;last_clickedis the same moment in the site’s date and time format, for showing. Both are null until a person clicks.labelis the Reference Library item’s label, or null for a standalone link or a blank label.episodesis most clicks first. Anepisode_idof null groups clicks that named no episode; a deleted episode keeps its id and is titled Deleted episode #ID.titleis raw, so escape it when you print it.statusis the link’s Link Health status:healthy,broken,expired,uncheckedorexcluded, with the saved exclusions applied. A link dismissed in Link Health still reports its real status here.http_statusis the code of its worst counted check, null when none answered or none has run.link_healthis site-wide, not the show’s.brokencounts every show’s broken tracked links and broken site links, leaving out dismissed and excluded ones (the same count as the Link Health notice), andpage_urlis the Settings → Link Health page.
Code
<?php
$request = new WP_REST_Request( 'GET', '/benecaster-outlinks/v1/shows/12/report' );
$response = rest_do_request( $request ); // As a user with manage_options.
foreach ( $response->get_data()['items'] as $link ) {
printf( "%s: %d people, %d filtered\n", esc_html( $link['label'] ?? $link['slug'] ), $link['clicks'], $link['bot_clicks'] );
}
Need this built rather than just documented? See our services →