You can retrieve key performance metrics for your products participating in the YouTube Affiliate Program using the Reports API. This guide explains how to query YouTube-specific affiliate data, such as sales, commissions, orders, views, and clicks, attributed to different creators, video content, and individual products.
You can use MCQL to select metrics and dimensions from dedicated YouTube Affiliate "views," which function like tables in your queries.
Prerequisites
Before using this guide, ensure that:
- The account used to authenticate API calls has the Performance and insights role that grants access to performance metrics.
- Your Google Merchant Center account participates in the YouTube Affiliate Program.
Query the alpha endpoint
Note that given this is in public alpha, the endpoint differs. To retrieve
YouTube Affiliate performance data, you need to send the POST request to the
v1alpha
endpoint.
Here's a sample request:
HTTP
POST https://merchantapi.googleapis.com/reports/v1alpha/accounts/{ACCOUNT_ID}/reports:search
cURL
curl -X POST \
'https://merchantapi.googleapis.com/reports/v1alpha/accounts/{ACCOUNT_ID}/reports:search?key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
See performance by creator
To understand which YouTube creators are driving the most engagement and sales,
you can query the youtube_creator_performance_view
.
This view aggregates metrics by individual YouTube creators and includes creator
titles and channel IDs.
Here is an MCQL SELECT statement example you can use to get the top 3 performing creators by sales between May 1st and May 2nd, 2025.
SELECT
title,
channel_id,
sales,
commissions,
orders,
clicks,
views
FROM youtube_creator_performance_view
WHERE date BETWEEN '2025-05-01' AND '2025-05-02'
ORDER BY sales DESC LIMIT 3
This query fetches the creator title, channel ID, and key performance metrics for the top 3 creators ranked by the sales metric within the specified date range.
See performance by content
To see which specific YouTube videos are performing best, you can query the
youtube_content_performance_view
.
This view aggregates metrics by individual
YouTube videos and includes video titles and IDs.
Here is an MCQL SELECT statement example you can use to get the top 3 videos by views between May 1st and May 2nd, 2025.
SELECT
title,
video_id,
views,
clicks,
sales
FROM youtube_content_performance_view
WHERE date BETWEEN '2025-05-01' AND '2025-05-02'
ORDER BY views DESC LIMIT 3
This query retrieves the video title, video ID, and key metrics for the top 3
videos ranked by the total number of views
in the specified date range.
See performance by product
To analyze the performance of individual products within the YouTube Affiliate
Program, you can query the youtube_product_performance_view
.
This view aggregates metrics by product and includes product titles and offer
IDs.
Here is an MCQL SELECT statement example you can use to find the top 3 products by sales amount between May 1st and May 2nd, 2025:
SELECT
title,
offer_id,
sales,
commissions,
orders,
clicks
FROM youtube_product_performance_view
WHERE date BETWEEN '2025-05-01' AND '2025-05-02'
ORDER BY sales DESC LIMIT 3
This query returns the product title, offer ID, and performance metrics for the
top 3 products, ordered by the sales
metric, during the specified period.
Important considerations
- Dates: Always filter your queries by
date
usingWHERE
clauses to specify the reporting period. Dates are inYYYY-MM-DD
format. - Latency: The latency of queries will depend on the volume of data requested. Large queries will take longer and may cause timeouts.