qdb-api

    2.0.0 • Public • Published

    qdb-api

    NPM FOSSA Status

    An API wrapper for qdb.us.

    Looking for a REST API? See qdb-rest-api

    npm install qdb-api

    const qdb = require('qdb-api')

    APIs available

    • Get a random quote
    • Get the latest quote
    • Get specific quote by it's id
    • Search for a quote

    Get a random quote

    qdb.random()
        .then(quote => {
            console.log(quote);
        })
        .catch(reason => {
            console.log(reason);
        });

    Get the latest quote

    qdb.latest()
        .then(quote => {
            console.log(quote);
        })
        .catch(reason => {
            console.log(reason);
        });

    Get a specific quote by it's id

    qdb.get(4680)
        .then(quote => {
            console.log(quote);
        })
        .catch(reason => {
            console.log(reason);
        });

    Search for a quote

    qdb.search('tom')
        .then(quotes => {
            quotes.forEach(quote => {
                console.log(quote);
            });
        })
        .catch(reason => {
            console.log(reason);
        });

    Disclaimer

    Please note that is an unofficial API.

    License

    FOSSA Status

    Install

    npm i qdb-api

    DownloadsWeekly Downloads

    5

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    13.8 kB

    Total Files

    7

    Last publish

    Collaborators

    • marknjunge