https://github.com/ppalone/ytmsearch
🔍 Search Songs & Videos from Youtube Music
https://github.com/ppalone/ytmsearch
Last synced: 5 months ago
JSON representation
🔍 Search Songs & Videos from Youtube Music
- Host: GitHub
- URL: https://github.com/ppalone/ytmsearch
- Owner: ppalone
- Created: 2025-11-24T18:59:54.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-11-28T16:54:42.000Z (7 months ago)
- Last Synced: 2025-11-30T17:25:04.730Z (7 months ago)
- Language: Go
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# YTMSearch
Search Songs & Videos from Youtube Music
## Installing
```bash
go get github.com/ppalone/ytmsearch
```
## Usage
### Creating a client
```go
// pass your http.Client if required
c := ytmsearch.NewClient(nil)
```
### Searching songs
Use `.Search()` with no filters or explicitly providing `ytmsearch.WithSearchType(ytmsearch.SONGS)` filter
```go
q := "nocopyrightsounds"
res, err := c.Search(context.Background(), q)
// or with explicit "songs" filter
// res, err := c.Search(context.Background(), q, ytmsearch.WithSearchType(ytmsearch.SONGS))
if err != nil {
// handle error
}
// res.Results contains search results
for _, song := range res.Results {
fmt.Println(song)
}
```
### Searching video songs
Use `.Search()` by providing `ytmsearch.WithSearchType(ytmsearch.VIDEOS)` filter
```go
q := "nocopyrightsounds"
res, err := c.Search(context.Background(), q, ytmsearch.WithSearchType(ytmsearch.VIDEOS))
```
### Pagination
If the result set has more results, use `.HasNext` and `.Continuation`:
```go
if res.HasNext {
resNext, err := c.SearchNext(context.Background(), res.Continuation)
// Use resNext.Results...
}
```
## Author
Pranjal
## LICENSE
MIT