Skip to the content

Scraper API

YouTube

youtube.music_searchAvailable

YouTube Music search

The top result and the songs, videos, albums, singles, artists, playlists and episodes YouTube Music lists, each with its kind, title, artists, the plays or audience shown, the year for an album, and its address.

Give it Words to search YouTube Music for: a song, an artist, an album.

1 unit a record, for runs that return data. Runs that fail cost nothing. How units work

Counted
1 unit a record
Inputs
1, 1 required
Record
12 fields
A run takes
up to 5 minutes
Records kept
7 days
Measured
its success, on the status page

POST/v1/scrapers/youtube.music_search/runs

{
"input": {
"query": "daft punk"
}
}

sent, and answered

a record of the run12 fields

{
position: 1
top_result: true
kind: "artist"
title: "Daft Punk"
id: "UCRr1xG_2WIDs18a6cIiCxeA"
url: "https://music.youtube.com/channel/UCRr1xG_2WIDs18a6cIiCxeA"
artists: []
album: null
duration_text: null
… 3 more fields

ok1 unit a record

A record this scraper returned for this input. The first 9 of its 12 fields are set down here; the whole record is below.

music.youtube.com
The page YouTube Music search reads, as a browser shows it
The page this scraper reads, photographed in a browser on 20 November 2026. It belongs to its publisher, who has no part in this service.

What it is used for

Find an artist's catalogue
Search an artist and get their albums, singles and songs with the year and plays YouTube Music shows.
Track what is played
count_text gives the plays or monthly audience YouTube Music shows; read the same search on a schedule to follow it.
Match songs to YouTube
Each song comes with its video id and address, so a track list can be matched to what YouTube Music plays.

What you send

Words to search YouTube Music for: a song, an artist, an album. It is the one input.

querystring Required
What to search YouTube Music for: a song, an artist, an album.

A request, ready to send

It starts a run with the input shown at the top of this page, waits up to 60 seconds for it, and reads its records. Put your key in the variable it reads.

# Start a run and wait up to 60 seconds for it to finish
curl -X POST "https://api.enrichednow.com/v1/scrapers/youtube.music_search/runs?wait=60" \
  -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"query":"daft punk"}}'

# Read its records, with the id the first call answered
curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
  -H "Authorization: Bearer $ENRICHEDNOW_API_KEY"
from enrichednow import EnrichedNow

client = EnrichedNow()  # reads ENRICHEDNOW_API_KEY

# Start a run, wait for it to end, and get its records
result = client.scrape("youtube.music_search", {"query": "daft punk"})
print(result.run.id, result.run.status, result.run.record_count)

# Read its records: pages are fetched as you go
for record in result.records:
    print(record)

Install it with pip install enrichednow, then save as run.py and run python3 run.py

import EnrichedNow from "enrichednow";

const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY

// Start a run, wait for it to end, and get its records
const { run, records } = await client.scrape("youtube.music_search", { query: "daft punk" });
console.log(run.id, run.status, run.record_count);

// Read its records: pages are fetched as you go
for await (const record of records) console.log(record);

Install it with npm install enrichednow, then save as run.mjs and run node run.mjs

package main

import (
	"context"
	"fmt"
	"log"
	"time"

	enrichednow "github.com/enrichednow/enrichednow-go"
)

func main() {
	client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
	if err != nil {
		log.Fatal(err)
	}
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
	defer cancel()

	// Start a run, wait for it to end, and get its records
	run, records, err := client.Scrape(ctx, "youtube.music_search", map[string]any{"query": "daft punk"})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(run.ID, run.Status, run.RecordCount)

	// Read its records: pages are fetched as you go
	for records.Next() {
		fmt.Println(string(records.Current()))
	}
	if err := records.Err(); err != nil {
		log.Fatal(err)
	}
}

Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go

import com.enrichednow.EnrichedNowClient;
import com.enrichednow.ScrapeResult;
import java.util.Map;

public class Run {
    public static void main(String[] args) {
        EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY

        // Start a run, wait for it to end, and get its records
        ScrapeResult result = client.scrape("youtube.music_search", Map.of("query", "daft punk"));
        System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());

        // Read its records: pages are fetched as you go
        for (Map<String, Object> record : result.records()) {
            System.out.println(record);
        }
    }
}

Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java

enrichednow run youtube.music_search --input 'query=daft punk'

Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh

What comes back

The top result and the songs, videos, albums, singles, artists, playlists and episodes YouTube Music lists, each with its kind, title, artists, the plays or audience shown, the year for an album, and its address. A record has 12 fields. One we could not read is null, never an empty string or a zero.

A record youtube.music_search returned
{
  "position": 1,
  "top_result": true,
  "kind": "artist",
  "title": "Daft Punk",
  "id": "UCRr1xG_2WIDs18a6cIiCxeA",
  "url": "https://music.youtube.com/channel/UCRr1xG_2WIDs18a6cIiCxeA",
  "artists": [],
  "album": null,
  "duration_text": null,
  "count_text": "65.6M monthly audience",
  "year": null,
  "thumbnails": [
    {
      "url": "https://lh3.googleusercontent.com/qLhu6Py_4_xoBsoubKQsXlhOQGqU9YU1ZRAbFusF0LlrPkXbbpu7bEh-k_ZtE4JwLgubvucAQqcK1hRk=w60-h60-p-l90-rj",
      "width": 60,
      "height": 60
    },
    {
      "url": "https://lh3.googleusercontent.com/qLhu6Py_4_xoBsoubKQsXlhOQGqU9YU1ZRAbFusF0LlrPkXbbpu7bEh-k_ZtE4JwLgubvucAQqcK1hRk=w120-h120-p-l90-rj",
      "width": 120,
      "height": 120
    }
  ]
}

The scraper returned this record for the input above, reading a saved copy of the page, not the live site.

The fields of a record

positioninteger
Its place in the results, from 1; the top result first.
top_resultboolean
True for the result YouTube Music shows on its own above the list.
kindstring
What it is, as YouTube Music labels it, in lower case: song, video, album, single, ep, artist, playlist, episode, podcast or profile; other for a result it labels otherwise.
titlestring
Its title; for an artist, the name.
idstring or null
Its id on YouTube: a video id for a song, a video or an episode; an album's, artist's or playlist's own id otherwise.
urlstring or null
Its address on music.youtube.com.
artistslist of strings
The artists it names.
albumstring or null
For a song: the album it is on, where it names one.
duration_textstring or null
The length as shown ("4:30").
count_textstring or null
The plays, views or audience as shown ("1.2B plays", "65.6M monthly audience").
yearinteger or null
For an album, a single or an EP: the year it shows.
thumbnailslist of objects
Its picture, in the sizes the page lists, smallest first.Each holds url, width, height.

The whole schema, in its reference

Units and limits

Counted per record
Billed per record: a run that returns data costs 1 unit for each record it returns.
A miss costs nothing
A run that fails, that meets something not supported yet, or that you cancel costs nothing. You pay for runs that return data.
What bounds a run
A run may take up to 5 minutes. Its records are read in pages of up to 1,000 and are kept for 7 days.

What it does not do

  • The results on YouTube Music's first screen, about 30.

Scraper API pricing: how units workThe five ways a run ends

Questions

What does YouTube Music search return?

The top result and the songs, videos, albums, singles, artists, playlists and episodes YouTube Music lists, each with its kind, title, artists, the plays or audience shown, the year for an album, and its address. A record has 12 fields, among them position, top_result, kind, title, id and url. A value that could not be read is null, never an empty string or a zero.

What do I send?

Words to search YouTube Music for: a song, an artist, an album. The input query is required.

How is it counted?

Billed per record: a run that returns data costs 1 unit for each record it returns. A run that fails, that meets something not supported yet, or that you cancel costs nothing. The first 1,000 units each month are free.

What does it not do?

The results on YouTube Music's first screen, about 30.

How long are the records kept, and in what format do they come?

Records are kept for 7 days after the run ended, and read in pages of up to 1,000. They come as JSON, as NDJSON with one record a line, or as CSV with a column for each field.

Can an AI assistant call it?

Yes. Through the EnrichedNow MCP server an assistant calls the tool run_scraper with the scraper_id youtube.music_search and the same input. It costs what the same API call costs.

YouTube

YouTube's public pages, as a visitor who is not signed in sees them.

  • YouTube search

    youtube.search

    A search query. The videos, Shorts, channels and playlists YouTube lists for the query, in its order; or, with type movie, the films of YouTube Movies & TV with their genre, year and credits.

  • YouTube video

    youtube.video

    A YouTube video's address, or its id. Its title, description, channel, dates, length, views, likes, comment count, tags, hashtags, chapters and caption languages.

  • YouTube channel

    youtube.channel

    A YouTube channel's address, handle or id. Its name, description, subscribers, video count, country, join date, total views, links, avatar and banner.

  • YouTube channel videos

    youtube.channel_videos

    A YouTube channel's address, handle or id. The videos on the channel's Videos tab, newest first.

  • YouTube channel Shorts

    youtube.channel_shorts

    A YouTube channel's address, handle or id. The Shorts on the channel's Shorts tab, newest first: title, views and cover image.

  • YouTube channel live streams

    youtube.channel_streams

    A YouTube channel's address, handle or id. The streams on the channel's Live tab: on air now, scheduled and past, with viewers, views and length.

  • YouTube channel playlists

    youtube.channel_playlists

    A YouTube channel's address, handle or id. The playlists the channel lists on its Playlists tab: title, number of videos and cover image.

  • YouTube playlist

    youtube.playlist

    A YouTube playlist's address, or its id. The videos in the playlist, in its order: title, length, views, age and thumbnail.

  • YouTube transcript

    youtube.transcript

    A YouTube video's address, or its id, and optionally a language. The video's captions as timed segments and as one text, with the language, whether they are auto-generated, and every language the video offers.

  • YouTube comments

    youtube.comments

    A YouTube video's address, or its id. The comments under the video, top or newest first, with replies if you ask for them: text, likes, reply count, time, pinned and hearted marks, and the author's channel.

YouTube on the line-up

Where
Worldwide

Run it on an input of your own.

Create an account, make a key, and send the request above with your own input. The first 1,000 units each month are free.