# YouTube Music Albums Scraper (`googleapi/youtube-music-albums-scraper`) Actor

Search current YouTube Music album results and retrieve rich album and optional track metadata through YouTube Music's first-party youtubei endpoints.

- **URL**: https://apify.com/googleapi/youtube-music-albums-scraper.md
- **Developed by:** [Google API](https://apify.com/googleapi) (community)
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 1,000 results

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

Search YouTube Music for albums, EPs, and singles. The dataset includes public release and artist information, with optional descriptions, track lists, and related releases from public album pages.

### Input

- **searchQueries**: Artist, album, or genre phrases.
- **startUrls**: YouTube Music search URLs. When supplied, they take precedence over generated searches.
- **maxItems**: Global limit of unique albums; defaults to 20 and can be set from 1 to 100.
- **page / maxPages**: Starting page and pages to collect per source; defaults to page 1 and up to 3 pages.
- **deduplicate**: Remove duplicate albums across sources; enabled by default.
- **sortBy**: Keep source order or sort by title or release year.
- **albumTypes**: Optionally limit results to Album, EP, or Single.
- **artistKeywords**: Optionally keep albums whose public artist names match supplied terms.
- **minYear / maxYear**: Inclusive release-year limits.
- **language / country / locale**: Search language and region; defaults to en and US. You can provide a locale instead.

### Album details

- **includeAlbumDetails**: Fetch public album descriptions, release information, and related releases; off by default.
- **includeTracks**: Include a bounded list of public tracks; off by default. This also fetches the album page.
- **maxTracks**: Maximum tracks per album; defaults to 100 and can be set up to 200.
- **includeMedia**: Include artwork URLs and dimensions; enabled by default.
- **proxyConfiguration**: Optional Apify Proxy settings for public requests.

### Dataset

Each record represents an album, EP, or single and requires `browseId`. It can also include its playlist ID, title, release type, artist credits, displayed release year, URL, artwork, full description, attribution links, explicit/clean labels, track counts and duration, tracks, and related releases.

Release years are not expanded into more precise dates. Counts and details depend on what YouTube Music publicly displays. Run output includes the dataset and run information.

### Responsible use

This Actor reads public YouTube Music catalog information. Follow YouTube's terms, applicable law, and your data-protection obligations. This independent Actor is not affiliated with or endorsed by YouTube or Google.

# Changelog

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

# Actor input Schema

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

Artist, album, or genre searches. This is the preferred query field; compatibility aliases are queries, searchKeywords, and searchQuery.

## `queries` (type: `array`):

Compatibility alias for searchQueries. When both are present their values are combined and deduplicated case-insensitively.

## `searchKeywords` (type: `array`):

Compatibility alias for searchQueries.

## `searchQuery` (type: `string`):

Compatibility alias for one searchQueries value.

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

Optional HTTPS music.youtube.com/search URLs with a q parameter. When supplied, custom URLs take precedence over generated query URLs. Legacy string entries are accepted by runtime validation.

## `sourceUrls` (type: `array`):

Compatibility alias for startUrls; only YouTube Music search URLs are accepted.

## `searchUrls` (type: `array`):

Compatibility alias for startUrls.

## `urls` (type: `array`):

Compatibility alias for search URLs.

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

Global maximum number of unique album records emitted across all queries or source URLs (1–100).

## `maxPages` (type: `integer`):

Maximum continuation pages to inspect for each query or custom search URL (1–10).

## `deduplicate` (type: `boolean`):

Deduplicate globally by YouTube Music browse ID across pages and sources.

## `sortBy` (type: `string`):

source_order emits source order; the year and title options sort the bounded collected candidate set globally before maxItems is applied.

## `albumTypes` (type: `array`):

Optional allow-list of Album, EP, and/or Single.

## `artistKeywords` (type: `array`):

Optional case-insensitive terms matched against the public artist name(s). Missing artist names do not match.

## `minYear` (type: `integer`):

Optional inclusive lower bound for a four-digit release year.

## `maxYear` (type: `integer`):

Optional inclusive upper bound for a four-digit release year; must be at least minYear when both are set.

## `includeAlbumDetails` (type: `boolean`):

Fetch one public album page per selected result for descriptions, release metadata and related catalog entries. Disabled by default. Enabling includeTracks also enables this request.

## `includeTracks` (type: `boolean`):

Fetch each selected album's public browse page and include its bounded track list. The compatibility alias includeAttributes controls the same option when includeTracks is omitted.

## `includeAttributes` (type: `boolean`):

Compatibility alias for includeTracks. When both fields are supplied, this alias takes precedence so Console defaults do not override an explicit compatibility input.

## `includeMedia` (type: `boolean`):

Include product-associated artwork URL(s) and dimensions when exposed.

## `maxTracks` (type: `integer`):

Maximum public tracks retained for one album (1–200).

## `language` (type: `string`):

Two-letter language code sent to YouTube Music.

## `country` (type: `string`):

Two-letter country code sent to YouTube Music.

## `locale` (type: `string`):

Optional ll or ll-CC locale alias. When language or country is also provided, conflicting components are rejected.

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

Bounded delay before each first-party request (0–5000 ms).

## `maxConcurrency` (type: `integer`):

Maximum concurrent album detail requests after ordered search collection (1–3).

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

Retries for transient network, timeout, 429, and 5xx failures (0–5). Access boundaries are not retried indefinitely.

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

Timeout for one YouTube Music request (10–120 seconds).

## `maxResponseBytes` (type: `integer`):

Bounded response size accepted from a first-party request.

## `userAgent` (type: `string`):

Optional ordinary browser user-agent string; no stealth or fingerprint-evasion behavior is used.

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

Optional standard Apify proxy configuration. It is wired into the HTTPS transport when supplied; proxy credentials are never logged or emitted.

## `page` (type: `integer`):

One-based page at which to start collecting. Earlier continuation pages are traversed and discarded; maxPages counts pages collected after this starting page (1–100).

## Actor input object example

```json
{
  "searchQueries": [
    "Adele"
  ],
  "searchQuery": "Adele",
  "maxItems": 20,
  "maxPages": 3,
  "deduplicate": true,
  "sortBy": "source_order",
  "includeAlbumDetails": false,
  "includeTracks": false,
  "includeMedia": true,
  "maxTracks": 100,
  "language": "en",
  "country": "US",
  "locale": "en-US",
  "requestDelayMs": 150,
  "maxConcurrency": 1,
  "maxRetries": 2,
  "requestTimeoutSecs": 30,
  "maxResponseBytes": 8000000,
  "page": 1
}
```

# Actor output Schema

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

No description

## `output` (type: `string`):

No description

## `runHealth` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("googleapi/youtube-music-albums-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("googleapi/youtube-music-albums-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 '{}' |
apify call googleapi/youtube-music-albums-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,googleapi/youtube-music-albums-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/m6WbRM2J5ugjFGamX/builds/47G6c1wJTfs4D32vz/openapi.json
