Skip to content

๐Ÿ”Ž A simple Golang library to get video search results from YouTube

Notifications You must be signed in to change notification settings

ppalone/ytsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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

package main

import (
	"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

About

๐Ÿ”Ž A simple Golang library to get video search results from YouTube

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages