📍 IP Validation

Validate IP.

A better, simpler way to validate IP with Dymo API in a single line of code!

About IP Validation

What is IP Validation?

Please note that this feature may depend on plugins to function correctly.

Usage

Once we have created and configured our API object, it is quite simple, we just need to execute the following code.

import DymoAPI from "dymo-api";

const dymoClient = new DymoAPI({
  apiKey: ""
});

const decision = await dymoClient.isValidIP("52.94.236.248");
import DymoAPI from "dymo-api";

const dymoClient = new DymoAPI({
  apiKey: "",
  rules: {
      ip: {
          // These are the default rules defined for IP validation.
          deny: ["FRAUD", "INVALID", "VPN", "TOR_NETWORK"]
      }
  }
});

const decision = await dymoClient.isValidIP("52.94.236.248");
import DymoAPI from "dymo-api";

const dymoClient = new DymoAPI({
  apiKey: "",
  rules: {
      ip: {
          // These are the default rules defined for IP validation.
          deny: ["FRAUD", "INVALID", "VPN", "TOR_NETWORK"]
      }
  }
});

// You can overwrite the predefined rules at any time.
const decision = await dymoClient.isValidIP("52.94.236.248", { deny: ["COUNTRY:RU"] });

IP Rules

RuleDefaultPremiumDescription
FRAUDFraud detection
INVALIDInvalid IP format
VPNVPN detection
PROXYProxy detection
TOR_NETWORKTor network detection
COUNTRY:<COUNTRY_CODE>Block an IP based on its country; you must use ISO 3166-1 alpha-2.
HIGH_RISK_SCOREHigh risk score detection

Response

The more data types you add, the longer the response time will be.
{
    ip: "52.94.236.248",
    allow: true,
    reasons: [],
    response: {
        valid: true,
        type: "IPv4",
        class: "A",
        fraud: false,
        ip: "52.94.236.248",
        continent: "North America",
        continentCode: "NA",
        country: "United States",
        countryCode: "US",
        region: "VA",
        regionName: "Virginia",
        city: "Ashburn",
        district: "",
        zipCode: "20149",
        lat: 39.0438,
        lon: -77.4874,
        timezone: "America/New_York",
        offset: -18000,
        currency: "USD",
        isp: "Amazon.com, Inc.",
        org: "Amazon Technologies Inc. (us-east-1)",
        as: "AS16509 Amazon.com, Inc.",
        asname: "AMAZON-02",
        mobile: false,
        vpn: true, // BETA - Also used to indicate that it comes from a Data Center.
        proxy: false,
        hosting: true,
        plugins: {...}
    }
}