https://github.com/raspi/youtubeapi
YouTube REST API client for Go
https://github.com/raspi/youtubeapi
go golang golang-library google google-api rest-api youtube youtube-api
Last synced: about 1 month ago
JSON representation
YouTube REST API client for Go
- Host: GitHub
- URL: https://github.com/raspi/youtubeapi
- Owner: raspi
- License: apache-2.0
- Created: 2023-06-30T16:46:09.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-07T16:00:30.000Z (almost 3 years ago)
- Last Synced: 2025-01-08T11:42:21.662Z (over 1 year ago)
- Topics: go, golang, golang-library, google, google-api, rest-api, youtube, youtube-api
- Language: Go
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# youtubeapi


[](https://goreportcard.com/report/github.com/raspi/youtubeapi)
YouTube REST API v3 client for Go.
For searching and getting details of YouTube videos, channels and playlists.
## Currently implemented
* Video details
* Channel details
* Search
* Playlists
## Example
```go
yt := youtubeapi.New(httpc, apiKey)
item, err := yt.GetVideo(`dQw4w9WgXcQ`)
if err != nil {
panic(err)
}
fmt.Printf(`%v %v %v`, item.Snippet.ChannelID, item.Snippet.PublishedAt, item.Snippet.Title)
ch, err := yt.GetChannel(`UCuAXFkgsw1L7xaCfnd5JJOw`)
if err != nil {
panic(err)
}
fmt.Printf(`%v %v %v`, ch.Snippet.PublishedAt, ch.Snippet.Title, ch.Snippet.Description)
custom := map[string]string{
`regionCode`: `US`,
`relevanceLanguage`: `en`,
}
res, err := yt.Search(`never gonna give you up`, custom)
if err != nil {
panic(err)
}
fmt.Printf(`%v`, res)
```
## References
* https://developers.google.com/youtube/v3
* [internal/video](internal/video) - https://developers.google.com/youtube/v3/docs/videos/list
* [internal/channel](internal/channel) - https://developers.google.com/youtube/v3/docs/channels
* [internal/search](internal/search) - https://developers.google.com/youtube/v3/docs/search/list
* [internal/playlist](internal/playlist) - https://developers.google.com/youtube/v3/docs/playlists/list
* [internal/playlistitem](internal/playlistitem) - https://developers.google.com/youtube/v3/docs/playlistItems/list
* https://console.cloud.google.com/apis/api/youtube.googleapis.com