NodeJS API Client

Welcome to our NodeJS Client Library for interacting with our API!

This library streamlines the process of integrating and utilising our services within your Node applications. Whether you're working on a web app, a data analysis project, or any other software that requires interaction with our API, this guide will help you get started quickly and efficiently.

View source and usage instructions >

Installation

Install with NPM
npm install @bigdatacloudapi/client

Example usage


    const client = require('@bigdatacloudapi/client')('XXX'); // XXX being your api key found at: https://www.bigdatacloud.com/account
    /*
     * All api endpoints can be accessed via magic methods in the following camelised format:
     * method | endpoint
     * For example: an asynchronous "GET" call to the "ip-geolocation-full" endpoint would be: client.getIpGeolocationFull();
     * All endpoints return a promise
     */

    //Asynchronous example using 'then':
    client
    .getIpGeolocationFull({ip:'8.8.8.8'})
    .then((jsonResult=> {
        console.log('Asynchronous "then" result:',jsonResult);
    })
    .catch(function(error) {
        console.error('Asynchronous "then" error:', error);
    });

    //Asynchronous example using 'await':
    (async function() {
        try {
            var jsonResult = await client.getIpGeolocationFull({ip:'8.8.8.8'});
            console.log('Asynchronous "await" result:',jsonResult);
        } catch (error) {
            console.error('Asynchronous "await" error:', error);
        }
    })();

Contact support

If you have any further queries, feel free to contact our email support on our contact us page .


Topics

Was this page helpful?