# Search sound in Youtube sound library

**Action ID:** `search_sound_in_yt_sound_lib`

## Description

Search sound in Youtube sound library.

## Input Parameters

| Name         | Type    | Required | Default | Description                                                             |
| ------------ | ------- | :------: | ------- | ----------------------------------------------------------------------- |
| query        | string  |     ✓    | -       | The search query for finding sounds (e.g., "Ocean", "Tigers", "Upbeat") |
| num\_results | integer |     -    | 10      | Number of results to return. Range: 1 to 20                             |

<details>

<summary>View JSON Schema</summary>

```json
{
  "description": "Search sound in youtube sound lib node input.",
  "properties": {
    "query": {
      "description": "The search query. Ocean, Tigers, Pears, etc.",
      "title": "The search query.",
      "type": "string"
    },
    "num_results": {
      "default": 10,
      "description": "Number of results to return",
      "exclusiveMaximum": 21,
      "exclusiveMinimum": 0,
      "title": "Number of results",
      "type": "integer"
    }
  },
  "required": [
    "query"
  ],
  "title": "SearchSoundInYoutubeSoundLibNodeInput",
  "type": "object"
}
```

</details>

## Output Parameters

| Name   | Type  | Description                                           |
| ------ | ----- | ----------------------------------------------------- |
| sounds | array | Array of sound results from the YouTube Audio Library |

**SoundResult Object:**

| Field    | Type            | Description                                     |
| -------- | --------------- | ----------------------------------------------- |
| id       | string          | Unique identifier for the sound                 |
| name     | string          | The name or title of the sound track            |
| genre    | string or null  | Music genre (e.g., "Electronic", "Acoustic")    |
| duration | integer or null | Duration of the sound in seconds                |
| mood     | string or null  | Mood descriptor (e.g., "Happy", "Dramatic")     |
| url      | string          | Direct URL to download or access the sound file |
| artist   | string or null  | The artist or composer name                     |

<details>

<summary>View JSON Schema</summary>

```json
{
  "$defs": {
    "SoundResult": {
      "description": "Sound result model.",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "genre": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Genre"
        },
        "duration": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Duration"
        },
        "mood": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Mood"
        },
        "url": {
          "title": "Url",
          "type": "string"
        },
        "artist": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Artist"
        }
      },
      "required": [
        "id",
        "name",
        "url"
      ],
      "title": "SoundResult",
      "type": "object"
    }
  },
  "description": "Search sound in YT sound lib node output.",
  "properties": {
    "sounds": {
      "description": "List of sounds",
      "items": {
        "$ref": "#/$defs/SoundResult"
      },
      "title": "Sounds",
      "type": "array"
    }
  },
  "required": [
    "sounds"
  ],
  "title": "SearchSoundInYoutubeSoundLibNodeOutput",
  "type": "object"
}
```

</details>

## How It Works

This node searches the YouTube Audio Library, a collection of royalty-free music and sound effects provided by YouTube, using your specified query terms. It retrieves matching sounds with metadata including genre, mood, duration, and artist information, then returns downloadable URLs for each result, making it easy to find copyright-free audio for video production and content creation.

## Usage Examples

### Example 1: Search for Background Music

**Input:**

```
query: "Upbeat Corporate"
num_results: 5
```

**Output:**

```
sounds: [
  {
    "id": "yt_audio_12345",
    "name": "Inspiring Corporate",
    "genre": "Corporate",
    "duration": 180,
    "mood": "Happy",
    "url": "https://audio-library.youtube.com/download/inspiring-corporate.mp3",
    "artist": "Music Ventures"
  },
  {
    "id": "yt_audio_12346",
    "name": "Modern Technology",
    "genre": "Electronic",
    "duration": 145,
    "mood": "Bright",
    "url": "https://audio-library.youtube.com/download/modern-technology.mp3",
    "artist": "Kevin MacLeod"
  },
  {
    "id": "yt_audio_12347",
    "name": "Business Success",
    "genre": "Corporate",
    "duration": 210,
    "mood": "Uplifting",
    "url": "https://audio-library.youtube.com/download/business-success.mp3",
    "artist": "AShamaluevMusic"
  }
]
```

### Example 2: Find Nature Sound Effects

**Input:**

```
query: "Ocean Waves"
num_results: 3
```

**Output:**

```
sounds: [
  {
    "id": "yt_audio_78901",
    "name": "Ocean Waves Crashing",
    "genre": "Sound Effects",
    "duration": 60,
    "mood": "Calm",
    "url": "https://audio-library.youtube.com/download/ocean-waves.mp3",
    "artist": null
  },
  {
    "id": "yt_audio_78902",
    "name": "Beach Ambience",
    "genre": "Ambient",
    "duration": 120,
    "mood": "Peaceful",
    "url": "https://audio-library.youtube.com/download/beach-ambience.mp3",
    "artist": "Nature Sounds"
  }
]
```

### Example 3: Search for Gaming Music

**Input:**

```
query: "Epic Action"
num_results: 10
```

**Output:**

```
sounds: [
  {
    "id": "yt_audio_45678",
    "name": "Epic Battle Theme",
    "genre": "Cinematic",
    "duration": 195,
    "mood": "Dramatic",
    "url": "https://audio-library.youtube.com/download/epic-battle-theme.mp3",
    "artist": "Yung Logos"
  },
  {
    "id": "yt_audio_45679",
    "name": "Action Hero",
    "genre": "Rock",
    "duration": 168,
    "mood": "Intense",
    "url": "https://audio-library.youtube.com/download/action-hero.mp3",
    "artist": "Riot"
  },
  // ... 8 more results
]
```

## Common Use Cases

* **Video Production**: Find royalty-free background music and sound effects for YouTube videos, tutorials, or vlogs
* **Podcast Intros**: Search for intro and outro music that matches your podcast's theme and mood
* **Content Creation Workflows**: Automatically source copyright-free audio for automated video generation workflows
* **Marketing Videos**: Find professional-sounding background tracks for promotional content and advertisements
* **Educational Content**: Locate appropriate background music for online courses and educational videos
* **Social Media Content**: Discover trending sounds and music for Instagram Reels, TikTok, or YouTube Shorts
* **Game Development**: Find sound effects and ambient music for indie game projects

## Error Handling

| Error Type              | Cause                                             | Solution                                                            |
| ----------------------- | ------------------------------------------------- | ------------------------------------------------------------------- |
| Empty Query             | Search query is empty or contains only whitespace | Provide a meaningful search term like "Happy", "Ocean", or "Piano"  |
| Invalid Num Results     | num\_results is outside the 1-20 range            | Set num\_results between 1 and 20                                   |
| No Results Found        | Query doesn't match any sounds in the library     | Try different search terms, broader keywords, or check spelling     |
| Connection Error        | Unable to connect to YouTube Audio Library        | Check your internet connection and try again                        |
| Rate Limited            | Too many search requests in a short period        | Wait a few moments before making another search request             |
| Service Unavailable     | YouTube Audio Library service is temporarily down | Retry after a few minutes or check YouTube's service status         |
| Invalid Response Format | Unexpected data format from the API               | Report the issue if it persists; the API structure may have changed |

## Notes

* **Royalty-Free**: All sounds from the YouTube Audio Library are royalty-free and can be used in your content without copyright concerns.
* **Attribution**: Some tracks may require attribution to the artist; check YouTube's guidelines for specific attribution requirements.
* **Search Terms**: Use descriptive keywords like mood (happy, sad), genre (electronic, acoustic), or themes (nature, corporate) for best results.
* **Result Limit**: The maximum number of results is capped at 20 to ensure reasonable response times and prevent excessive data transfer.
* **URL Availability**: The returned URLs provide direct access to download the audio files for use in your projects.
* **Metadata Quality**: Not all sounds have complete metadata; some may have null values for genre, mood, artist, or duration.
* **Search Optimization**: Combine multiple keywords (e.g., "upbeat electronic happy") for more specific results.
* **Download URLs**: The URLs are valid for immediate download but may expire; download and store files as needed for your workflow.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.agenticflow.ai/reference/nodes/search_sound_in_yt_sound_lib.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
