https://github.com/ppalone/ytsearch
🔎 A simple Golang library to get video search results from YouTube
https://github.com/ppalone/ytsearch
Last synced: about 2 months ago
JSON representation
🔎 A simple Golang library to get video search results from YouTube
- Host: GitHub
- URL: https://github.com/ppalone/ytsearch
- Owner: ppalone
- Created: 2024-05-09T18:49:40.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-24T14:32:39.000Z (6 months ago)
- Last Synced: 2025-03-02T01:23:18.776Z (3 months ago)
- Language: Go
- Size: 23.4 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# YTSearch
🔎 A simple Golang libary for getting video search results from Youtube (without any kind of API key)
## Installation
```
go get -u github.com/ppalone/ytsearch
```## Usage
```go
package mainimport (
"fmt""github.com/ppalone/ytsearch"
)func main() {
// client
c := ytsearch.Client{}// search for "nocopyrightsounds"
res, err := c.Search("nocopyrightsounds")
if err != nil {
panic(err)
}fmt.Println("Search Results:")
// res.Results contains an array of Search results
for _, res := range res.Results {
fmt.Println("Video Title:", res.Title, "Channel:", res.Channel)
}fmt.Println("Next Search Results:")
// res.Continuation contains continuation token
// can be used to fetch next results
// since youtube limits the number of search results
res, err = c.Next(res.Continuation)
if err != nil {
panic(err)
}for _, res := range res.Results {
fmt.Println("Video Title:", res.Title, "Channel:", res.Channel)
}
}
```## Author
Pranjal
## LICENSE
MIT