YouTube Data Builder Error: "The Query Is Not Supported" (400 badRequest)

YouTube Data Builder Error: "The Query Is Not Supported" (400 badRequest)

Info
This article explains the YouTube Analytics error "The query is not supported" (400 badRequest) that can appear in Data Builder, why it happens, and how to build a data table that returns your data.

What you're seeing

When you build a YouTube Analytics data table in Data Builder, choose the video (content) dimensions and metrics you want, and preview the table, no data is returned. Instead, you see this error:

"Code: 400; Message: The query is not supported. Check the documentation for a list of supported queries. (badRequest)"

The fields were available to select, so the error can be confusing: nothing in the field picker flags which of your selected fields are in conflict.


Why it happens

YouTube Analytics organizes its data into separate report types, which behave like separate tables. Channel and time-based reporting lives in one set of report types, and video (content-level) reporting lives in another. Video-level metrics (views, likes, comments, and so on, for each video) are lifetime totals for that video, and the only date that belongs next to a video is its publish date.

Because those fields live in different report types, YouTube's API cannot answer a single query that mixes them: for example, a per-video metric combined with a reporting date, or a video-level field combined with a channel-level or time-level field. When Data Builder sends that combination to YouTube, YouTube returns the 400 "The query is not supported" error and no rows come back.

This is the same idea behind the Data Studio "Can't mix and match fields from different tables" error. In Data Builder you see YouTube's own wording instead of ours, but the cause and the fix are the same: your fields need to come from one compatible report type.


How to fix it

Use Schema Explorer to find a set of YouTube fields that work together, then rebuild your data table from that set:

  1. In your hub, go to Tools > Schema Explorer, or open it directly for YouTube Analytics: https://hub.powermyanalytics.com/resources/schema/google_youtube
  2. Select a video-level field first (for example, a per-video metric). Schema Explorer immediately narrows the list to the fields that are compatible with your selection.
  3. Build your Data Builder data table using only the fields that remain available together. Keep video-level fields in one data table, and channel-level or time-level fields in another.
  4. Preview the table again. With a compatible set of fields, your data is returned.

If you need per-video numbers by day

Video-level metrics are lifetime totals, so a single data table cannot break them down by a reporting date. To build a daily trend for each video, use one of these approaches:

  • Run a per-video report for a single day, then repeat it each day and stack the rows in Data Builder. A scheduled daily snapshot builds the trend over time.
  • Send your YouTube data to BigQuery or Google Sheets with the Data Exports Addon, and build the daily series in that destination.


Notes
The Power My Analytics Spreadsheets Addon (Google Sheets and Microsoft Excel) removes incompatible fields as you build a report, so you will not run into this error when building YouTube reports there.