Our YouTube Music API allows you to scrape results from the YouTube Music search page.

A search returns the Top Result and the Organic Results of all types on one page. To get results of one type, and the next pages of them, use the filter parameter. See Filtering and Pagination.


The API endpoint is https://serpapi.com/search?engine=youtube_music

Head to the playground for a live and interactive demo.

API parameters

Search query

q

Required

Parameter defines the search query. You can use anything that you would use in a regular YouTube Music search: a song, an artist, an album, a playlist, a podcast, etc. Either a q or a next_page_token parameter is required.

Localization

gl

Optional

Parameter defines the country to use for the YouTube Music search. It's a two-letter country code. (e.g., us for the United States, uk for United Kingdom, or fr for France)

hl

Optional

Parameter defines the language to use for the YouTube Music search. It's a two or three-letter language code. (e.g., en for English, es for Spanish, or fr for French), optionally followed by a two-letter or three-digit region code (e.g., pt-br for Brazilian Portuguese, or es-419 for Latin American Spanish).

Pagination

next_page_token

Optional

Parameter defines the next page token. It is used for retrieving the next page of results. It should be a value of next_page_token from the serpapi_pagination of the search results. Pagination is only available when the filter parameter is set.

Advanced parameters

filter

Optional

Parameter defines the type of results to return in organic_results. Available options:

songs - Songs, with the type: song
videos - Videos, with the type: video
albums - Albums, with the type: album
artists - Artists, with the type: artist
community_playlists - Community playlists, with the type: playlist
featured_playlists - Featured playlists, with the type: playlist
podcasts - Podcasts, with the type: podcast
episodes - Episodes, with the type: episode
profiles - Profiles, with the type: profile

YouTube Music sometimes mixes in results of another type, e.g. episodes among videos, audiobooks among albums or audiobook tracks among songs. They keep their own type, e.g. episode, audiobook or track.

When it's not set, the top results of all types are returned, and there is no next page.

SerpApi parameters

engine

Required

Set parameter to youtube_music to use the YouTube Music API engine.

no_cache

Optional

Parameter will force SerpApi to fetch the YouTube Music results even if a cached version is already present. A cache is served only if the query and all parameters are exactly the same. Cache expires after 1h. Cached searches are free, and are not counted towards your searches per month. It can be set to false (default) to allow results from the cache, or true to disallow results from the cache. no_cache and async parameters should not be used together.

async

Optional

Parameter defines the way you want to submit your search to SerpApi. It can be set to false (default) to open an HTTP connection and keep it open until you got your search results, or true to just submit your search to SerpApi and retrieve them later. In this case, you'll need to use our Searches Archive API to retrieve your results. async and no_cache parameters should not be used together. async should not be used on accounts with Ludicrous Speed enabled.

zero_trace

Optional

Enterprise only. Parameter enables ZeroTrace mode. It can be set to false (default) or true. Enable this mode to skip storing search parameters, search files, and search metadata on our servers. This may make debugging more difficult.

api_key

Required

Parameter defines the SerpApi private key to use.

output

Optional

Parameter defines the format of the result. It can be set to json (default) to get a structured JSON of the results, html to get the raw HTML retrieved, or md to get a Markdown-formatted version optimized for LLMs and AI agents.

json_restrictor

Optional

Parameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details.

API results

JSON results

JSON output includes structured data for Top Result and Organic Results.

A search status is accessible through search_metadata.status. It flows this way: Processing -> Success || Error. If a search has failed, error will contain an error message. search_metadata.id is the search ID inside SerpApi.

HTML results

This API does not have a full HTML response, only text. search_metadata.prettify_html_file contains a link to the prettified version of the result. It is displayed in the playground.

Markdown results

Markdown output is optimized for LLMs and AI agents. It provides a curated view of the JSON results in a token-efficient format using tables, markdown links, and YAML frontmatter.

To access, use the output=md parameter, the /search.md endpoint, or request header Accept: text/markdown.

API examples

Example results for q: Taylor Swift

Example results for q: Taylor Swift

JSON Example

{
  "search_metadata": {
    "id": "6ade541afd6b6f8eb21c2fed",
    "status": "Success",
    "json_endpoint": "https://serpapi.com/searches/sj_rQViF2T_HG_dqv0TghUt0Eq9Ypu2G_mVrLCH9S6M/6ade541afd6b6f8eb21c2fed.json",
    "markdown_endpoint": "https://serpapi.com/searches/sj_rQViF2T_HG_dqv0TghUt0Eq9Ypu2G_mVrLCH9S6M/6ade541afd6b6f8eb21c2fed.md",
    "created_at": "2026-10-25 19:10:18 UTC",
    "processed_at": "2026-10-25 19:10:18 UTC",
    "youtube_music_url": "https://music.youtube.com/search?q=Taylor+Swift",
    "raw_html_file": "https://serpapi.com/searches/sj_rQViF2T_HG_dqv0TghUt0Eq9Ypu2G_mVrLCH9S6M/6ade541afd6b6f8eb21c2fed.html",
    "prettify_html_file": "https://serpapi.com/searches/sj_rQViF2T_HG_dqv0TghUt0Eq9Ypu2G_mVrLCH9S6M/6ade541afd6b6f8eb21c2fed.prettify",
    "total_time_taken": 1.19
  },
  "search_parameters": {
    "engine": "youtube_music",
    "q": "Taylor Swift"
  },
  "search_information": {
    "results_state": "Results for exact spelling"
  },
  "top_result": {
    "type": "artist",
    "title": "Taylor Swift",
    "link": "https://music.youtube.com/channel/UCPC0L1d253x-KuMNwa05TpA",
    "channel": {
      "name": "Taylor Swift",
      "channel_id": "UCPC0L1d253x-KuMNwa05TpA",
      "link": "https://music.youtube.com/channel/UCPC0L1d253x-KuMNwa05TpA",
      "serpapi_youtube_channel_link": "https://serpapi.com/search.json?channel_id=UCPC0L1d253x-KuMNwa05TpA&engine=youtube_channel",
      "audience": "442M monthly audience",
      "extracted_audience": 442000000
    },
    "thumbnail": "https://yt3.googleusercontent.com/RCpTA6EXJQyjVFDosWOKa2SMmqkua_lA9mHPDWWciLwgqpZLz-k8rXWRF_367trrQ7up9BUwCbk6kRk=w120-h120-p-l90-rj",
    "items": [
      {
        "type": "song",
        "title": "Blank Space",
        "link": "https://music.youtube.com/watch?v=dC9QIUKviJU",
        "serpapi_youtube_video_link": "https://serpapi.com/search.json?engine=youtube_video&v=dC9QIUKviJU",
        "video_id": "dC9QIUKviJU",
        "album": {
          "album_id": "MPREb_JiAQrbUtBdP",
          "link": "https://music.youtube.com/browse/MPREb_JiAQrbUtBdP"
        },
        "length": "3:52",
        "plays": "4.5B plays",
        "extracted_plays": 4500000000,
        "thumbnail": "https://yt3.googleusercontent.com/GcrDhHXqrPm4BjS-4L1c0OHC9iz0ZxmFeRur2A6Aqo9Vm7OfFCBOSVbRzp1M1D1s_3rsvKaC7w6kku0=w120-h120-l90-rj"
      },
      {
        "type": "song",
        "title": "cardigan",
        "link": "https://music.youtube.com/watch?v=M_lVZIpgnjU",
        "serpapi_youtube_video_link": "https://serpapi.com/search.json?engine=youtube_video&v=M_lVZIpgnjU",
        "video_id": "M_lVZIpgnjU",
        "album": {
          "album_id": "MPREb_VLEl8SjepHO",
          "link": "https://music.youtube.com/browse/MPREb_VLEl8SjepHO"
        },
        "length": "4:00",
        "plays": "444M plays",
        "extracted_plays": 444000000,
        "thumbnail": "https://yt3.googleusercontent.com/q7JVahTldHxztLXfCJfgjf5DHr9mi18m2HKpS_IJqBqvvzfAJKPCh_rg-9v-aoGqp-Cc6PHW3ceFMlIQ=w120-h120-l90-rj"
      },
      ...
    ]
  },
  "organic_results": [
    {
      "type": "song",
      "title": "Don’t Blame Me",
      "link": "https://music.youtube.com/watch?v=kRJKB291Z1g",
      "serpapi_youtube_video_link": "https://serpapi.com/search.json?engine=youtube_video&v=kRJKB291Z1g",
      "video_id": "kRJKB291Z1g",
      "channels": [
        {
          "name": "Taylor Swift",
          "channel_id": "UCPC0L1d253x-KuMNwa05TpA",
          "link": "https://music.youtube.com/channel/UCPC0L1d253x-KuMNwa05TpA",
          "serpapi_youtube_channel_link": "https://serpapi.com/search.json?channel_id=UCPC0L1d253x-KuMNwa05TpA&engine=youtube_channel"
        }
      ],
      "album": {
        "album_id": "MPREb_BdDqjcHkOwb",
        "link": "https://music.youtube.com/browse/MPREb_BdDqjcHkOwb"
      },
      "plays": "290M plays",
      "extracted_plays": 290000000,
      "thumbnail": "https://yt3.googleusercontent.com/RuKPkn6LLmXNOUcyRqh0zQbMWTpZDhHnkxHEZHrv6J8AbxLwemm9F0xaPpHX51WB_Xlj00My9vpZ_zRh=w120-h120-l90-rj"
    },
    {
      "type": "song",
      "title": "I Did Something Bad",
      "link": "https://music.youtube.com/watch?v=xYLxUJ9v6KU",
      "serpapi_youtube_video_link": "https://serpapi.com/search.json?engine=youtube_video&v=xYLxUJ9v6KU",
      "video_id": "xYLxUJ9v6KU",
      "channels": [
        {
          "name": "Taylor Swift",
          "channel_id": "UCPC0L1d253x-KuMNwa05TpA",
          "link": "https://music.youtube.com/channel/UCPC0L1d253x-KuMNwa05TpA",
          "serpapi_youtube_channel_link": "https://serpapi.com/search.json?channel_id=UCPC0L1d253x-KuMNwa05TpA&engine=youtube_channel"
        }
      ],
      "album": {
        "album_id": "MPREb_BdDqjcHkOwb",
        "link": "https://music.youtube.com/browse/MPREb_BdDqjcHkOwb"
      },
      "plays": "97M plays",
      "extracted_plays": 97000000,
      "thumbnail": "https://yt3.googleusercontent.com/RuKPkn6LLmXNOUcyRqh0zQbMWTpZDhHnkxHEZHrv6J8AbxLwemm9F0xaPpHX51WB_Xlj00My9vpZ_zRh=w120-h120-l90-rj"
    },
    ...
    {
      "type": "artist",
      "title": "Sabrina Carpenter",
      "link": "https://music.youtube.com/channel/UCz51ZodJbYUNfkdPHOjJKKw",
      "channel": {
        "name": "Sabrina Carpenter",
        "channel_id": "UCz51ZodJbYUNfkdPHOjJKKw",
        "link": "https://music.youtube.com/channel/UCz51ZodJbYUNfkdPHOjJKKw",
        "serpapi_youtube_channel_link": "https://serpapi.com/search.json?channel_id=UCz51ZodJbYUNfkdPHOjJKKw&engine=youtube_channel",
        "audience": "171M monthly audience",
        "extracted_audience": 171000000
      },
      "thumbnail": "https://lh3.googleusercontent.com/FMh1mOI0ufvUCAkbUM6aUmU5WK7O5PnndyyXKP1-DCEip20SQz5eeYn3lZ29p-ASb-19ZfBVc_NKe5Ko=w120-h120-p-l90-rj"
    },
    ...
    {
      "type": "album",
      "title": "reputation (Big Machine Radio Release Special)",
      "link": "https://music.youtube.com/browse/MPREb_WKAJORp9ECS",
      "album_id": "MPREb_WKAJORp9ECS",
      "playlist_id": "OLAK5uy_kx0okxcxSpw_UX7U5JaIy8_j1MbYAaIy0",
      "album_type": "Album",
      "channels": [
        {
          "name": "Taylor Swift",
          "channel_id": "UCPC0L1d253x-KuMNwa05TpA",
          "link": "https://music.youtube.com/channel/UCPC0L1d253x-KuMNwa05TpA",
          "serpapi_youtube_channel_link": "https://serpapi.com/search.json?channel_id=UCPC0L1d253x-KuMNwa05TpA&engine=youtube_channel"
        }
      ],
      "year": 2017,
      "thumbnail": "https://yt3.googleusercontent.com/fx6kz_AXXbWVglzvmChcvFRTwV_nFmSAjuyYUO2XTqO_Es9hv4Fe6scz1pTfNWw6hSWob6gtpsft3vZm=w544-h544-l90-rj"
    },
    ...
  ],
  ...
}

Example results for q: Taylor Swift and filter: songs

Filtered results include more details, e.g. songs include the album title and the length. Use next_page_token from serpapi_pagination to get the next page.

Example results for q: Taylor Swift and filter: songs

JSON Example

{
  ...
  "organic_results": [
    {
      "type": "song",
      "title": "The Fate of Ophelia",
      "link": "https://music.youtube.com/watch?v=7nVctvQVz0U",
      "serpapi_youtube_video_link": "https://serpapi.com/search.json?engine=youtube_video&v=7nVctvQVz0U",
      "video_id": "7nVctvQVz0U",
      "channels": [
        {
          "name": "Taylor Swift",
          "channel_id": "UCPC0L1d253x-KuMNwa05TpA",
          "link": "https://music.youtube.com/channel/UCPC0L1d253x-KuMNwa05TpA",
          "serpapi_youtube_channel_link": "https://serpapi.com/search.json?channel_id=UCPC0L1d253x-KuMNwa05TpA&engine=youtube_channel"
        }
      ],
      "album": {
        "title": "The Life of a Showgirl",
        "album_id": "MPREb_p6BGcsuOpGt",
        "link": "https://music.youtube.com/browse/MPREb_p6BGcsuOpGt"
      },
      "length": "3:47",
      "plays": "858M plays",
      "extracted_plays": 858000000,
      "thumbnail": "https://yt3.googleusercontent.com/ZpWD37EEQE_LVuQ_O03cRmz5mZA7jG0gKGLt-49uHNDX6DycysijGGSOX9woU-OfQR5jyahz3aEdmBmm3A=w120-h120-l90-rj"
    },
    {
      "type": "song",
      "title": "Patient Zero",
      "link": "https://music.youtube.com/watch?v=V-uIp-WuD60",
      "serpapi_youtube_video_link": "https://serpapi.com/search.json?engine=youtube_video&v=V-uIp-WuD60",
      "video_id": "V-uIp-WuD60",
      "channels": [
        {
          "name": "Taylor Swift",
          "channel_id": "UCPC0L1d253x-KuMNwa05TpA",
          "link": "https://music.youtube.com/channel/UCPC0L1d253x-KuMNwa05TpA",
          "serpapi_youtube_channel_link": "https://serpapi.com/search.json?channel_id=UCPC0L1d253x-KuMNwa05TpA&engine=youtube_channel"
        }
      ],
      "album": {
        "title": "The Life of a Showgirl: The Encore",
        "album_id": "MPREb_L64BnYDQpHZ",
        "link": "https://music.youtube.com/browse/MPREb_L64BnYDQpHZ"
      },
      "length": "3:46",
      "plays": "55M plays",
      "extracted_plays": 55000000,
      "thumbnail": "https://yt3.googleusercontent.com/DNFuGZeuZ7vGTxa49zFs3YNAwA-TOTVXYRFqPt3RQGmq0vK2zbLyTxJHxc88dShIoQrfQUiIugawXoK_=w120-h120-l90-rj"
    },
    ...
  ],
  "serpapi_pagination": {
    "next_page_token": "Eq0DEgxUYXlsb3IgU3dpZnQanANFZ1dLQVFJSUFVZ1VhaElRQlJBREVBa1FDaEFRRUFRUURoQVJFQldDQVFzM2JsWmpkSFpSVm5vd1ZZSUJDMVl0ZFVsd0xWZDFSRFl3Z2dFTFNGSkRibEowVDBKV1JtdUNBUXR1Vm5WSmRYWnBTMkZSWjRJQkMyRlFibkY0TlRaV09DMHdnZ0VMUmpoS2VHOHhOVlptYVdPQ0FRc3hkMmR5TVVKcWVITTNSWUlCQzNWRU9HUXhTM0pFVVdOWmdnRUxNMWxuZEdwSVdubERTVkdDQVF0RGMybFdkbXQ2UTJSVFNZSUJDMjFWY0dJemJXbFBkbTh3Z2dFTGVYbDNSM3B2VERaWFNWR0NBUXRGVERjeVZXTkVXa3hUYTRJQkMyZEhkMDR5TlhvM1JuSkZnZ0VMTlZVM1lrWTJPSGhqVW1lQ0FRc3hTMW8yYkRjemMwb3dRWUlCQzBONFkwVnhhSGswZVV0bmdnRUxVVkZZV25sbU1FOUtjRW1DQVF0a1l6WnNiSFY1V2tFNFFZSUJDMjlIYTFOdFVteEViMGRSGPHq0C4%3D",
    "next": "https://serpapi.com/search.json?engine=youtube_music&filter=songs&next_page_token=Eq0DEgxUYXlsb3IgU3dpZnQanANFZ1dLQVFJSUFVZ1VhaElRQlJBREVBa1FDaEFRRUFRUURoQVJFQldDQVFzM2JsWmpkSFpSVm5vd1ZZSUJDMVl0ZFVsd0xWZDFSRFl3Z2dFTFNGSkRibEowVDBKV1JtdUNBUXR1Vm5WSmRYWnBTMkZSWjRJQkMyRlFibkY0TlRaV09DMHdnZ0VMUmpoS2VHOHhOVlptYVdPQ0FRc3hkMmR5TVVKcWVITTNSWUlCQzNWRU9HUXhTM0pFVVdOWmdnRUxNMWxuZEdwSVdubERTVkdDQVF0RGMybFdkbXQ2UTJSVFNZSUJDMjFWY0dJemJXbFBkbTh3Z2dFTGVYbDNSM3B2VERaWFNWR0NBUXRGVERjeVZXTkVXa3hUYTRJQkMyZEhkMDR5TlhvM1JuSkZnZ0VMTlZVM1lrWTJPSGhqVW1lQ0FRc3hTMW8yYkRjemMwb3dRWUlCQzBONFkwVnhhSGswZVV0bmdnRUxVVkZZV25sbU1FOUtjRW1DQVF0a1l6WnNiSFY1V2tFNFFZSUJDMjlIYTFOdFVteEViMGRSGPHq0C4%253D&q=Taylor+Swift"
  }
}

JSON structure overview

{
  ...
  "search_information": {
    "results_state": "String - State of the results",
    // Supported values:
    // - `Results for exact spelling`
    // - `Some results for exact spelling but showing fixed spelling`
    // - `Showing results for exact spelling despite spelling suggestion`

    "query_displayed": "String - Original query, when YouTube Music shows results for the fixed spelling",
    "spelling_fix": "String - Spelling fix from 'Did you mean' or directly fixed search",
    "showing_results_for": "String - Directly fixed search",
  },
  "top_result": {
    // please refer to Top Result page for the detailed structure
  },
  "organic_results": [
    // please refer to Organic Results page for the detailed structure
  ],
  "serpapi_pagination": {
    "next_page_token": "String - Token to get the next page of results (only with the `filter`)",
    "next": "String - YouTube Music API link to get the next page of results",
  },
}