ytscrape is a YouTube scraper search library, with a REST API available at yt.mbaraa.xyz
IDK, it would be really nice of you to contribute, check the poorly written CONTRIBUTING.md for more info.
- Search YouTube for Videos
- Search YouTube for Channels
- Search YouTube for Playlists
- Search YouTube for Radios
import "github.com/mbaraa/ytscrape"
func main() {
// results is of type []ytscrape.VideoResult
results, err := ytscrape.Search("Volkswagon das auto")
if err != nil {
// handle error
}
// do something with the results
}
Well there's only has a single endpoint:
GET /search
: accepts a queryq
that has the search term, and responds with a body like this one whenq=Lana del rey
{
"id": "TdrL3QxjyVw",
"title": "Lana Del Rey - Summertime Sadness (Official Music Video)",
"url": "https://youtube.com/watch?v=TdrL3QxjyVw",
"duration": 266,
"thumbnail_src": "https://i.ytimg.com/vi/TdrL3QxjyVw/hq720.jpg",
"views": 574902158,
"uploader": {
"title": "Lana Del Rey",
"url": "https://www.youtube.com/channel/UCqk3CdGN_j8IR9z4uBbVPSg"
}
}
- Clone the repo.
git clone https://github.com/mbaraa/ytscrape
- Run it with docker compose.
docker compose up
- Visit http://localhost:20256
- Don't ask why I chose this weird port.
Made with 🧉 by Baraa Al-Masri