Skip to content

Greipio/node

Repository files navigation

Greip Node.js Library

The official Node.js library for the Greip API.

Report Issue · Request Feature · Greip Website · Documentation

NPM Package of Greip Github Repository

npm version    GitHub code size in bytes    License: Apache 2.0    API Status


Installation

Install the package using npm or yarn:

npm install greip-node --save

or

yarn add greip-node

Usage

Import the Greip library and initialize it with your API token:

const { Greip } = require("greip-node");
const greip = new Greip(process.env.GREIP_TOKEN);

IP Lookup

Available Options

Option Type Required Description
ip string Yes The IP address to lookup
params string[] No Modules to include: location, security, timezone, currency, device
format string No Response format: JSON, XML, CSV, Newline
lang string No Language: EN, AR, DE, FR, ES, JA, ZH, RU
mode string No Mode: live, test
greip
    .Lookup({ ip: "1.1.1.1" })
    .then((res) => {
        console.log(res.data);
    })
    .catch((error) => {
        console.error(error);
    });

IP Threats

Available Options

Option Type Required Description
ip string Yes The IP address to check for threats
format string No Response format: JSON, XML, CSV, Newline
mode string No Mode: live, test
greip
    .Threats({ ip: "1.1.1.1" })
    .then((res) => {
        console.log(res.data);
    })
    .catch((error) => {
        console.error(error);
    });

Bulk IP Lookup

Available Options

Option Type Required Description
ips string[] Yes Array of IP addresses to lookup
params string[] No Modules to include: location, security, timezone, currency, device
format string No Response format: JSON, XML, CSV, Newline
lang string No Language: EN, AR, DE, FR, ES, JA, ZH, RU
mode string No Mode: live, test
greip
    .BulkLookup({ ips: ["1.1.1.1", "2.2.2.2"] })
    .then((res) => {
        console.log(res.data);
    })
    .catch((error) => {
        console.error(error);
    });

ASN Lookup

Available Options

Option Type Required Description
asn string Yes The ASN to lookup
mode string No Mode: live, test
greip
    .ASN({ asn: "AS01" })
    .then((res) => {
        console.log(res.data);
    })
    .catch((error) => {
        console.error(error);
    });

Profanity Detection

Available Options

Option Type Required Description
text string Yes The text to check for profanity
params string[] No Additional parameters (see docs)
format string No Response format: JSON, XML, CSV
lang string No Language: EN, AR, DE, FR, ES, JA, ZH, RU
mode string No Mode: live, test
greip
    .Profanity({ text: "This is just normal sample text." })
    .then((res) => {
        console.log(res.data);
    })
    .catch((error) => {
        console.error(error);
    });

Country Lookup

Available Options

Option Type Required Description
countryCode string Yes ISO 3166-1 alpha-2 country code
params string[] No Modules: language, flag, currency, timezone
format string No Response format: JSON, XML, CSV, Newline
lang string No Language: EN, AR, DE, FR, ES, JA, ZH, RU
mode string No Mode: live, test
greip
    .Country({ countryCode: "SA" })
    .then((res) => {
        console.log(res.data);
    })
    .catch((error) => {
        console.error(error);
    });

Email Validation

Available Options

Option Type Required Description
email string Yes The email address to validate
mode string No Mode: live, test
greip
    .EmailValidation({ email: "[email protected]" })
    .then((res) => {
        console.log(res.data);
    })
    .catch((error) => {
        console.error(error);
    });

Phone Validation

Available Options

Option Type Required Description
phone string Yes The phone number to validate
countryCode string Yes Country code (ISO 3166-1 alpha-2)
mode string No Mode: live, test
greip
    .PhoneValidation({
        phone: "123123123",
        countryCode: "US"
    })
    .then((res) => {
        console.log(res.data);
    })
    .catch((error) => {
        console.error(error);
    });

Payment Fraud Prevention

Available Options

Option Type Required Description
data object Yes Transaction data (see all fields)
mode string No Mode: live, test
greip
    .PaymentFraud({
        data: {
            // ...transaction and customer details...
        }
    })
    .then((res) => {
        console.log(res.data);
    })
    .catch((error) => {
        console.error(error);
    });

IBAN Validation

Available Options

Option Type Required Description
iban string Yes The IBAN to validate
mode string No Mode: live, test
greip
    .IBANValidation({ iban: "BY86AKBB10100000002966000000" })
    .then((res) => {
        console.log(res.data);
    })
    .catch((error) => {
        console.error(error);
    });

Documentation

For detailed API documentation and advanced usage, visit the Greip Documentation.


Credits


Repository Activity

Alt