Skip to content

wrapping you tube music and sql through express to a unified whole

License

Notifications You must be signed in to change notification settings

WeeHorse/node-music-web-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This api is based on: https://github.com/emresenyuva/youtube-music-api

Getting started

Run npm install and then npm start

Visit http://localhost:4000/ for documentation and examples.

Prefix the endpoints below with the domain where you publish the API. If you run this api locally, the domain will by default be http://localhost:4000/

MIT License

This api is purely for educational and personal projects and is not meant to be used commercially. If you want to create a commercial application you'll have to find another way.

The author of this api does not take responsibility for how you use it.

/api/yt

This part of the API exposes the YouTube music API. Below is a list of endpoints you can use, with a non-exhaustive list of properties.

next page

All responses returns a limit of 20 results. To get the next page you simply add the response.next string from the last search as a '?next=' query.

'/api/yt/songs/nothing%20else%20matters?next=' + response.next

This response will result in the next 20 items, and a new response.next string that you can use to get the next page.

endpoints

/api/yt/search/search+string

contains any (songs, albums, singles, artists, playlists, videos)

method: GET
response:
{
    "content": [
        {
            "type": "song",
            "videoId": String,
            "name": String,
            "artist": {
                "name": String,
                "browseId": String
            },
            "album": {
                "name": String,
                "browseId": String
            },
            "duration": Number,
            "thumbnails": [
                {
                    "url": String,
                    "width": Number,
                    "height": Number
                }
            ],
            "params": "wAEB"
        }
    ]
}

/api/yt/suggestions/search+string

contains suggestions (for autocomplete)

method: GET
response:
[
    String,
    String
]

/api/yt/songs/search+string

contains songs

method: GET
response:
{
    "content": [
        {
            "type": "song",
            "videoId": String,
            "name": String,
            "artist": {
                "name": String,
                "browseId": String
            },
            "album": {
                "name": String,
                "browseId": String
            },
            "duration": Number,
            "thumbnails": [
                {
                    "url": String,
                    "width": Number,
                    "height": Number
                }
            ],
            "params": "wAEB"
        }
    ],
    "next": String
}

/api/yt/song/videoId

get one song by id

method: GET
response:
{
    "type": "song",
    "videoId": String,
    "name": String,
    "artist": {
        "name": String,
        "browseId": String
    },
    "album": {
        "name": String,
        "browseId": String
    },
    "duration": Number,
    "thumbnails": [
        {
            "url": String,
            "width": Number,
            "height": Number
        }
    ],
    "params": "wAEB"
}

/api/yt/artists/search+string

contains offical artists

method: GET
response:
{
    "content": [
        {
            "type": "artist",
            "browseId": String,
            "name": String,
            "thumbnails": [
                {
                    "url": String,
                    "width": Number,
                    "height": Number
                }
            ]
        }
    ],
    "next": String
}

/api/yt/artist/browseId

get one artist by id

method: GET
response:
{
    "name": String,
    "description": String,
    "views": Number,
    "products": {
        "songs": {
            "content": [],
            "browseId": String,
            "params": String
        },
        "albums": {
            "content": [],
            "browseId": String,
            "params": String
        },
        "singles": {
            "content": [],
            "browseId": String,
            "params": String
        },
        "videos": {
            "content": [],
            "browseId": String,
            "params": String
        }
    },
    "thumbnails": [
        {
            "url": String,
            "width": Number,
            "height": Number
        }
    ]
}

/api/yt/albums/search+string

contains offical albums

method: GET
response:
{
    "content": [
        {
            "type": "album",
            "browseId": String,
            "name": String,
            "artist": String,
            "year": String,
            "thumbnails": [
                {
                    "url": String,
                    "width": Number,
                    "height": Number
                }
            ]
        }
    ],
    "next": String
}

/api/yt/album/browseId

get one album by id

method: GET
response:
{
    "title": String,
    "description": String,
    "trackCount": Number,
    "year": String
    "duration": Number,
    "artist": [
        {
            "name": String,
            "browseId": String,
            "thumbnails": [
                 {
                    "url": String,
                    "width": Number,
                    "height": Number
                }
            ]
        }
    ],
    "tracks": [
        {
            "name": String,
            "videoId": String,
            "duration": Number
        }
    ],
    "thumbnails": [
        {
            "url": String,
            "width": Number,
            "height": Number
        }
    ]
}

/api/yt/videos/search+string

contains youtube videos

method: GET
response:
{
    "content": [
        {
            "type": String,
            "videoId": String,
            "name": String,
            "author": String,
            "views": String,
            "duration": Number,
            "thumbnails": {
                "url": String,
                "width": Number,
                "height": Number
            },
            "params": String
        }
    ],
    "next": String
}

/api/yt/video/videoId

get one video by id

method: GET
response:
{
    "type": String,
    "videoId": String,
    "name": String,
    "author": String,
    "views": String,
    "duration": Number,
    "thumbnails": {
        "url": String,
        "width": Number,
        "height": Number
    },
    "params": String
}

/api/yt/playlists/search+string

contains youtube playlists

method: GET
response:
{
    "content": [
        {
            "type": String,
            "browseId": String,
            "title": String,
            "author": String,
            "trackCount": Number,
            "thumbnails": [
                {
                    "url": String,
                    "width": Number,
                    "height": Number
                }
            ]
        }
    ],
    "next": String
}

/api/yt/playlist/browseId

get one playlist by id

method: GET
response:
{
    "title": String,
    "owner": String,
    "trackCount": Number,
    "year": String,
    "content": [
        {
            "videoId": String,
            "name": String,
            "author": {
                "name": String,
                "browseId": String
            },
            "duration": Number,
            "thumbnails": {
                "url": String,
                "width": Number,
                "height": Number
            }
        }
    ],
    "thumbnails": [
        {
            "url": String,
            "width": Number,
            "height": Number
        }
    ]
}

About

wrapping you tube music and sql through express to a unified whole

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published