YouTube Analytics ACTION
List Channel Reports
- Action
- Read only
- OAuth
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's YouTube Analytics account once, then configure and run List Channel Reports from your backend or agent.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "youtube_analytics_api-list-channel-reports",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
youtube_analytics_api: { authProvisionId: "apn_xxxxxxx" },
startDate: "Start Date",
endDate: "End Date",
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "youtube_analytics_api-list-channel-reports",
"configured_props": {
"youtube_analytics_api": { "authProvisionId": "apn_xxxxxxx" },
"startDate": "Start Date",
"endDate": "End Date"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "youtube_analytics_api",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "youtube_analytics_api-list-channel-reports",
arguments: {
startDate: "Start Date",
endDate: "End Date",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
startDate Start Date | string | The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format. Required |
endDate End Date | string | The end date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format. The API response contains data up until the last day for which all metrics in the query are available at the time of the query. So, for example, if the request specifies an end date of July 5, 2017, and values for all of the requested metrics are only available through July 3, 2017, that will be the last date for which data is included in the response. (That is true even if data for some of the requested metrics is available for July 4, 2017.) Required |
dimensions Dimensions | string[] | A list of YouTube Analytics dimensions, such as video or ageGroup, gender. See the documentation for channel reports or content owner reports for a list of the reports that you can retrieve and the dimensions used for those reports. (The Dimensions document contains definitions for all of the dimensions.). Optional |
sort Sort | string[] | A list of dimensions or metrics that determine the sort order for YouTube Analytics data. By default the sort order is ascending. The - prefix causes descending sort order. Eg. -views. Optional |
maxResults Max Results | integer | The maximum number of rows to include in the response. Optional |
idType ID Type | string | The type of ID to use for the query. This can be either My Channel, Channel ID, or Content Owner. Required |
ids Channel ID OR Content Owner Name | string | Required when ID Type is Channel ID (e.g. UC_x5XG1OV2P6uZZ5FSM9Ttw) or Content Owner (e.g. MyContentOwnerName or contentOwner@example.com), and unused when ID Type is My Channel. Optional |
channelReportType Channel Report Type | string | The type of report to fetch for the specified YouTube Channel. This selects default dimensions, metrics and filters. Required |
metrics Metrics | string[] | Metrics, such as views or likes, dislikes. Use the Get Channel Report Metrics action to get a list of the metrics available in each report. See the documentation for channel reports or content owner reports for a list of the reports that you can retrieve and the metrics available in each report. (The Metrics document contains definitions for all of the metrics.). Required |
filters Filters | object | A list of filters that should be applied when retrieving YouTube Analytics data. The documentation for channel reports and content owner reports identifies the dimensions that can be used to filter each report, and the Dimensions document defines those dimensions. If a request uses multiple filters the returned result table will satisfy both filters. For example, a filters parameter value of Specifying multiple values for a filter
The API supports the ability to specify multiple values for the video, playlist, and channel filters. To do so, specify a separated list of the video, playlist, or channel IDs for which the API response should be filtered. For example, a filters parameter value of Optional |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- youtube_analytics_api-list-channel-reports
- Version
- 0.0.5
- App
- YouTube Analytics
- Authentication
- OAuth
- Read-only
- Yes
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗