ytm-api-ts
v1.2.2
Published
YouTube Music API with TypeScript support
Readme
YTM API TS
This package is a fork of zS1L3NT/ts-npm-ytmusic-api adapted for my specific needs. The original project was itself inspired by youtube-music-api and rewritten with TypeScript support by zS1L3NT.
YouTube Music API (Unofficial) is a YouTube Music data scraper with TypeScript support. The NPM package can be found here
Credits
This project follows this evolution:
- Original youtube-music-api package
- Rewritten with TypeScript by zS1L3NT as ts-npm-ytmusic-api
- Current fork maintained by zokiasu
Features
- TypeScript Support for data return types
- Data from YouTube can be inconsistent but YTMusic API has been tested and the data matches the TypeScript types 95% of the time
- Scrape information directly from YouTube Music API
- Search Suggestions
- Songs
- Videos
- Artists
- Albums
- Playlists
- Lyrics
Usage
import YTMusic from "ytm-api-ts"
const ytmusic = new YTMusic()
await ytmusic.initialize(/* Optional: Custom cookies */)
ytmusic.search("Never gonna give you up").then(songs => {
console.log(songs)
})Testing
YTMusic API's data return types are tested with Bun Test. To run the tests, run the command
$ bun test