> For the complete documentation index, see [llms.txt](https://documentation.botghost.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.botghost.com/custom-commands-and-events/actions/music-actions/search-tracks.md).

# Search Tracks

{% hint style="warning" %}
This action requires a [Premium Subscription](/premium/premium-and-priority-hosting-plans.md#premium-plans) to function.
{% endhint %}

<figure><img src="/files/O93kx5ALas4Xh7ZH5BTV" alt="" width="335"><figcaption></figcaption></figure>

The Search Tracks action allows you to search tracks without adding them to the queue, and make the results available via the `{MusicSearch.*}` [object variable](/custom-commands-and-events/variables.md#music-objects).

## **Search Query or URL**

<figure><img src="/files/d7YBz51lyk8wMf3QJQ8S" alt="" width="371"><figcaption></figcaption></figure>

This field allows you to input a song name, artist, or direct URL to a supported platform.  This includes playlist and album links from Spotify or Apple Music, as well as individual track URLs from other platforms. Variables can be used in this field.

## Max Results

<figure><img src="/files/Xp4PXBkjFVjLlGNCHIok" alt="" width="369"><figcaption></figcaption></figure>

This field allows you to set the maximum amount of results that the search will return. This can be a natural number from 1-25. Variables that return numbers can be used here.

## Playlist Load Limit

<figure><img src="/files/FG1AKXBQwi1CXaLPanup" alt="" width="374"><figcaption></figcaption></figure>

This field allows you to specify the maximum amount of songs that will be loaded from a playlist or album. This can be a natural number from 1-250. Variables that return numbers can be used here.

## Optional Variable

<figure><img src="/files/85fEEDxXKtXuX1js2uRX" alt="" width="369"><figcaption></figcaption></figure>

This field allows you to specify a custom variable to use instead of the default `{MusicSearch.*}` variable. The tracks will be accessible through dot notation as `{yourVariableName_0.title}`, `{yourVariableName_1.title}`, etc.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://documentation.botghost.com/custom-commands-and-events/actions/music-actions/search-tracks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
