GithubHelp home page GithubHelp logo

weehorse / youtube-music-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aarkan1/youtube-music-api

0.0 1.0 0.0 362 KB

A small Express server providing YouTube music search results.

License: MIT License

JavaScript 75.03% HTML 20.30% CSS 4.67%

youtube-music-api's Introduction

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

Prefix the endpoints below with https://yt-music-api.herokuapp.com/

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.

'https://yt-music-api.herokuapp.com/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
        }
    ]
}

youtube-music-api's People

Contributors

aarkan1 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.