# YouTube Music Profile Scraper (`w3crawler/youtube-music-profile-scraper`) Actor

Find and collect public artist, channel, and profile data from YouTube Music through its first-party web endpoints.

- **URL**: https://apify.com/w3crawler/youtube-music-profile-scraper.md
- **Developed by:** [w3crawler](https://apify.com/w3crawler) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 profiles

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## YouTube Music Profile Scraper

Collect rich public artist and channel profiles from ordinary YouTube HTML pages. The actor searches the public channel filter, opens each selected public profile page, and parses the embedded page data that is already delivered to an unauthenticated visitor.

The dataset includes profile identity, handle, canonical URLs, description, keywords, subscriber and video counts, verification/official-artist state, avatar and banner image dimensions, RSS feed URL, safety metadata, visible tabs, and bounded shelves containing public videos, playlists, channels, and posts. Signed media URLs, private account data, request identity data, and authentication material are not retained.

### Input

At least one of `searchQueries` or `startUrls` is required.

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `searchQueries` | string array | — | Public artist or channel names to search. |
| `startUrls` | URL array | — | Public YouTube channel or handle pages, such as `https://www.youtube.com/@adele`. |
| `maxItems` | integer | `10` | Maximum unique profiles across the run, from 1 to 50. |
| `maxSections` | integer | `25` | Maximum visible shelves retained per profile. |
| `maxSectionItems` | integer | `20` | Maximum visible items retained in each shelf. |
| `maxSearchPages` | integer | `1` | Bounded public search pages per query, from 1 to 3. |
| `maxRetries` | integer | `1` | Bounded retries for a page request. |
| `requestTimeoutSecs` | integer | `60` | Timeout for a public HTML request. |
| `requestDelayMs` | integer | `250` | Delay between requests. |
| `countryCode` / `languageCode` | string | `US` / `en` | Public-page locale context. |
| `includeSections` | boolean | `true` | Include visible shelves and their linked items. |
| `includeDiagnostics` | boolean | `true` | Write exact four-field diagnostics for failed pages. |
| `enableProxyFallback` | boolean | `true` | Try one configured Apify Proxy request after a direct request fails. |
| `proxyConfiguration` | object | omitted | Optional account-authorized Apify Proxy settings. |

Example:

```json
{
  "searchQueries": ["Adele"],
  "maxItems": 2,
  "maxSections": 10,
  "maxSectionItems": 12,
  "includeSections": true,
  "includeDiagnostics": true,
  "enableProxyFallback": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

### Output and reliability

Each profile is one `youtube_music_profile` record. `OUTPUT` contains counts for page attempts, profiles, visible shelf items, continuation markers, failures, blocked pages, and proxy configuration. A continuation marker is reported as metadata; the actor does not call undocumented continuation requests.

If a direct public page fails and fallback is enabled, one configured Apify Proxy request is attempted. Explicit proxy input uses the requested Apify Proxy configuration. Retries and pacing are bounded. A page that cannot be parsed produces an exact `{ url, error, errorCode, scrapedAt }` diagnostic when diagnostics are enabled.

The actor uses no login, CAPTCHA bypass, stealth browser, fingerprint spoofing, alternate/private request client, or signed media extraction. Optional profile shelves are limited to data visible in the returned public page.

### Local verification

```bash
npx apify validate-schema
npm test
npx apify run --purge --input-file INPUT.json
node validate-datasets.js
```

Deploy with `npx apify push`, then call the same bounded input in Apify Console or with the Apify CLI and inspect both the dataset and `OUTPUT` record.

# Changelog

This Actor's version history is a separate document: https://apify.com/w3crawler/youtube-music-profile-scraper/changelog.md

# Actor input Schema

## `searchQueries` (type: `array`):

Optional. One to 25 distinct public artist, channel, or profile names.

## `startUrls` (type: `array`):

Optional. Public YouTube channel or handle pages such as https://www.youtube.com/@adele.

## `maxItems` (type: `integer`):

Maximum unique channel/profile records saved across the run (1–50).

## `maxSections` (type: `integer`):

Maximum visible profile shelves stored per profile (1–30).

## `maxSectionItems` (type: `integer`):

Maximum visible content items stored in each shelf (1–50).

## `maxSearchPages` (type: `integer`):

Bounded public search-page depth per query (1–3). Continuation tokens are reported but not called.

## `maxRetries` (type: `integer`):

Bounded retries after a public page request fails (0–3).

## `requestTimeoutSecs` (type: `integer`):

Timeout for each public HTML page request (15–180 seconds).

## `requestDelayMs` (type: `integer`):

Bounded pacing delay between public page requests (0–5000 ms).

## `countryCode` (type: `string`):

Two-letter country context used for public pages.

## `languageCode` (type: `string`):

Two- or three-letter language context used for public pages.

## `includeSections` (type: `boolean`):

Store bounded public profile shelves and their linked videos, playlists, channels, and posts.

## `includeDiagnostics` (type: `boolean`):

Write bounded four-field access and extraction diagnostics.

## `enableProxyFallback` (type: `boolean`):

Try one configured Apify Proxy request after a direct public-page failure.

## `proxyConfiguration` (type: `object`):

Optional account-authorized Apify Proxy configuration or credential-free HTTP/SOCKS URLs.

## Actor input object example

```json
{
  "searchQueries": [
    "Adele"
  ],
  "maxItems": 10,
  "maxSections": 25,
  "maxSectionItems": 20,
  "maxSearchPages": 1,
  "maxRetries": 1,
  "requestTimeoutSecs": 60,
  "requestDelayMs": 250,
  "countryCode": "US",
  "languageCode": "en",
  "includeSections": true,
  "includeDiagnostics": true,
  "enableProxyFallback": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `keyValueStore` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchQueries": [
        "Adele"
    ],
    "maxItems": 10,
    "maxSections": 25,
    "maxSectionItems": 20,
    "maxSearchPages": 1,
    "maxRetries": 1,
    "requestTimeoutSecs": 60,
    "requestDelayMs": 250,
    "countryCode": "US",
    "languageCode": "en",
    "includeSections": true,
    "includeDiagnostics": true,
    "enableProxyFallback": true,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/youtube-music-profile-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchQueries": ["Adele"],
    "maxItems": 10,
    "maxSections": 25,
    "maxSectionItems": 20,
    "maxSearchPages": 1,
    "maxRetries": 1,
    "requestTimeoutSecs": 60,
    "requestDelayMs": 250,
    "countryCode": "US",
    "languageCode": "en",
    "includeSections": True,
    "includeDiagnostics": True,
    "enableProxyFallback": True,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("w3crawler/youtube-music-profile-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchQueries": [
    "Adele"
  ],
  "maxItems": 10,
  "maxSections": 25,
  "maxSectionItems": 20,
  "maxSearchPages": 1,
  "maxRetries": 1,
  "requestTimeoutSecs": 60,
  "requestDelayMs": 250,
  "countryCode": "US",
  "languageCode": "en",
  "includeSections": true,
  "includeDiagnostics": true,
  "enableProxyFallback": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call w3crawler/youtube-music-profile-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,w3crawler/youtube-music-profile-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/lfuRrYYMCvg9vBVba/builds/qC4O21tH5pKoTfJkw/openapi.json
