The official Node.js library for the Greip API.
Report Issue · Request Feature · Greip Website · Documentation
Install the package using npm or yarn:
npm install greip-node --saveor
yarn add greip-nodeImport the Greip library and initialize it with your API token:
const { Greip } = require("greip-node");
const greip = new Greip(process.env.GREIP_TOKEN);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);
});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);
});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);
});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);
});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);
});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);
});Available Options
| Option | Type | Required | Description |
|---|---|---|---|
| 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);
});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);
});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);
});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);
});For detailed API documentation and advanced usage, visit the Greip Documentation.