Skip to content

ThomasBeHappy/NodeMusicAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@gaming_frame/musicapi

npm (scoped) npm npm bundle size (scoped)

A npm package for the Music API from Cato Studios

Install

$ npm install @gaming_frame/musicapi

Usage

const musicAPI = require("@gaming_frame/musicapi");

var MusicAPI = new musicAPI();

async function doStuff() {
    let song = await MusicAPI.random();
    console.log(song);
    // {"id":72,"title":"Firecracker","url":"https:\/\/www.youtube.com\/watch?v=_AQvXd-4tD0","genre":"fantasy bard","author":"Cami-Cat (feat. Khamydrian and more)","created_at":"2021-07-22T21:40:27.000000Z","updated_at":"2021-07-22T21:40:27.000000Z"}
}

Methods

random()

search(string)

genres()

randomFromGenre(string)

add(song) - TOKEN REQUIRED

Example of adding a song

const musicAPI = require("@gaming_frame/musicapi");

var MusicAPI = new musicAPI("secret");

async function doStuff() {

    let song = {
        title: "example",
        url: "https://www.youtube.com/watch/dQw4w9WgXcQ",
        genre: "edm",
        author: "the author"
    }

    let response = await MusicAPI.add(song);
    console.log(response);
    /*
    message: 'Successfully added music video',
    data: {
        title: 'example',
        url: 'https://www.youtube.com/watch/dQw4w9WgXcQ',
        genre: 'edm',
        author: 'the author',
        updated_at: '2021-08-10T11:28:23.000000Z',
        created_at: '2021-08-10T11:28:23.000000Z',
        id: 666
     } */
}

About

A npm package for the Music API from Cato Studios

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published