{
  "openapi": "3.1.0",
  "info": {
    "title": "IP Intelligence API",
    "version": "1.0.0",
    "description": "Country, ASN, datacenter, cloud and Tor detection with an explainable risk score for any IP.\n\nFraud and abuse signals for any IPv4 or IPv6 address, from a self-hosted dataset of 1.37 million ranges: geolocated country, the AS number and organisation announcing the prefix, whether the address sits in published cloud or CDN address space (AWS, Azure, Google Cloud, Oracle, DigitalOcean, Cloudflare, Fastly, GitHub — 88,000 ranges across 8 operators), and whether it is a live Tor exit node. Two countries are returned, not one: where the block GEOLOCATES and where it is REGISTERED with its regional registry. Those disagree on about 16% of routed ranges, and the mismatch is itself a weak signal, so both are exposed along with a flag for whether they agree. Every answer carries a transparent risk score whose every point is attributed to a named, explained signal — there is no black box, because a fraud team has to justify the customers it blocks. Look up one address, up to 50 in a batch, or the caller's own address via /v1/ip/me; search 86,000 autonomous systems by name; list the prefixes an AS announces. Non-routable space (loopback, RFC1918, link-local, documentation) is labelled rather than returned empty, and IPv4-mapped IPv6 literals are unwrapped to the address they carry. Cloud ranges and the Tor exit list are refreshed daily. Built entirely on free, redistributable sources — RouteViews BGP via iptoasn (public domain), DB-IP Lite (CC-BY), and each operator's own published ranges — with no third-party calls at request time.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/ip-intelligence.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/ip-intelligence"
  },
  "servers": [
    {
      "url": "https://api-ip-intelligence.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Data",
      "description": "IP Intelligence API belongs to the Data category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/sources": {
      "get": {
        "operationId": "dataSources",
        "summary": "Data Sources",
        "description": "Data Sources endpoint of the IP Intelligence API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/ip-intelligence/data-sources"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "count": 11,
                  "attribution": [
                    "IP geolocation by DB-IP (https://db-ip.com)"
                  ],
                  "sources": [
                    {
                      "slug": "dbip-country-lite",
                      "name": "DB-IP IP to Country Lite 2026-08",
                      "publisher": "DB-IP",
                      "licence": "Creative Commons Attribution 4.0",
                      "attribution": "IP geolocation by DB-IP (https://db-ip.com)",
                      "source_url": "https://db-ip.com/db/download/ip-to-country-lite",
                      "file_url": "https://download.db-ip.com/free/dbip-country-lite-2026-08.csv.gz",
                      "cadence": "monthly",
                      "record_count": 706484,
                      "retrieved_at": "2026-08-28",
                      "updated_at": "2026-08-28 02:53:53"
                    },
                    {
                      "slug": "iptoasn",
                      "name": "IP to ASN database",
                      "publisher": "iptoasn.com (Frank Denis)",
                      "licence": "Public Domain (PDDL v1.0)",
                      "attribution": null,
                      "source_url": "https://iptoasn.com/",
                      "file_url": "https://iptoasn.com/data/ip2asn-v4.tsv.gz",
                      "cadence": "hourly",
                      "record_count": 578919,
                      "retrieved_at": "2026-08-28",
                      "updated_at": "2026-08-28 02:53:53"
                    },
                    {
                      "slug": "ranges-aws",
                      "name": "AWS published IP ranges",
                      "publisher": "AWS",
                      "licence": "Published by the operator for public use",
                      "attribution": null,
                      "source_url": "https://ip-ranges.amazonaws.com/ip-ranges.json",
                      "file_url": "https://ip-ranges.amazonaws.com/ip-ranges.json",
                      "cadence": "daily-weekly",
                      "record_count": 16684,
                      "retrieved_at": "2026-08-28",
                      "updated_at": "2026-08-28 02:59:42"
                    },
                    {
                      "slug": "ranges-azure",
                      "name": "Azure published IP ranges",
                      "publisher": "Azure",
                      "licence": "Published by the operator for public use",
                      "attribution": null,
                      "source_url": "https://download.microsoft.com/download/7/1/d/71d86715-5596-4529-9b13-da13a5de5b63/ServiceTags_Public_20260824.json",
                      "file_url": "https://download.microsoft.com/download/7/1/d/71d86715-5596-4529-9b13-da13a5de5b63/ServiceTags_Public_20260824.json",
                      "cadence": "daily-weekly",
                      "record_count": 60758,
                      "retrieved_at": "2026-08-28",
                      "updated_at": "2026-08-28 02:59:48"
                    },
                    {
                      "slug": "ranges-cloudflare",
                      "name": "Cloudflare published IP ranges",
                      "publisher": "Cloudflare",
                      "licence": "Published by the operator for public use",
                      "attribution": null,
                      "source_url": "https://www.cloudflare.com/ips-v4",
                      "file_url": "https://www.cloudflare.com/ips-v4",
                      "cadence": "daily-weekly",
                      "record_count": 22,
                      "retrieved_at": "2026-08-28",
                      "updated_at": "2026-08-28 02:59:44"
                    },
                    {
                      "slug": "ranges-digitalocean",
                      "name": "DigitalOcean published IP ranges",
                      "publisher": "DigitalOcean",
                      "licence": "Published by the operator for public use",
                      "attribution": null,
                      "source_url": "https://digitalocean.com/geo/google.csv",
                      "file_url": "https://digitalocean.com/geo/google.csv",
                      "cadence": "daily-weekly",
                      "record_count": 1228,
                      "retrieved_at": "2026-08-28",
                      "updated_at": "2026-08-28 02:59:44"
                    },
                    {
                      "slug": "ranges-fastly",
                      "name": "Fastly published IP ranges",
                      "publisher": "Fastly",
                      "licence": "Published by the operator for public use",
                      "attribution": null,
                      "source_url": "https://api.fastly.com/public-ip-list",
                      "file_url": "https://api.fastly.com/public-ip-list",
                      "cadence": "daily-weekly",
                      "record_count": 21,
                      "retrieved_at": "2026-08-28",
                      "updated_at": "2026-08-28 02:59:45"
                    },
                    {
                      "slug": "ranges-gcp",
                      "name": "GCP published IP ranges",
                      "publisher": "GCP",
                      "licence": "Published by the operator for public use",
                      "attribution": null,
                      "source_url": "https://www.gstatic.com/ipranges/cloud.json",
                      "file_url": "https://www.gstatic.com/ipranges/cloud.json",
                      "cadence": "daily-weekly",
                      "record_count": 1092,
                      "retrieved_at": "2026-08-28",
                      "updated_at": "2026-08-28 02:59:42"
                    },
                    {
                      "slug": "ranges-github",
                      "name": "GitHub published IP ranges",
                      "publisher": "GitHub",
                      "licence": "Published by the operator for public use",
                      "attribution": null,
                      "source_url": "https://api.github.com/meta",
                      "file_url": "https://api.github.com/meta",
                      "cadence": "daily-weekly",
                      "record_count": 7623,
                      "retrieved_at": "2026-08-28",
                      "updated_at": "2026-08-28 02:59:45"
                    },
                    {
                      "slug": "ranges-oracle",
                      "name": "Oracle published IP ranges",
                      "publisher": "Oracle",
                      "licence": "Published by the operator for public use",
                      "attribution": null,
                      "source_url": "https://docs.oracle.com/iaas/tools/public_ip_ranges.json",
                      "file_url": "https://docs.oracle.com/iaas/tools/public_ip_ranges.json",
                      "cadence": "daily-weekly",
                      "record_count": 1107,
                      "retrieved_at": "2026-08-28",
                      "updated_at": "2026-08-28 02:59:43"
                    },
                    {
                      "slug": "tor-exits",
                      "name": "Tor bulk exit list",
                      "publisher": "The Tor Project",
                      "licence": "Public",
                      "attribution": null,
                      "source_url": "https://check.torproject.org/",
                      "file_url": "https://check.torproject.org/torbulkexitlist",
                      "cadence": "~30 minutes",
                      "record_count": 1415,
                      "retrieved_at": "2026-08-28",
                      "updated_at": "2026-08-28 02:59:49"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/asns/{asn}": {
      "get": {
        "operationId": "getAutonomousSystem",
        "summary": "Get Autonomous System",
        "description": "Get Autonomous System endpoint of the IP Intelligence API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/ip-intelligence/get-autonomous-system"
        },
        "parameters": [
          {
            "name": "asn",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "15169"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "50"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "asn": 13335,
                  "organization": "CLOUDFLARENET",
                  "registry_country": "US",
                  "range_count": 1530,
                  "ranges": [
                    {
                      "family": "ipv4",
                      "start": "1.0.0.0",
                      "end": "1.0.0.255"
                    },
                    {
                      "family": "ipv4",
                      "start": "1.1.1.0",
                      "end": "1.1.1.255"
                    },
                    {
                      "family": "ipv4",
                      "start": "5.10.214.0",
                      "end": "5.10.215.255"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/providers": {
      "get": {
        "operationId": "hostingProviders",
        "summary": "Hosting Providers",
        "description": "Hosting Providers endpoint of the IP Intelligence API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/ip-intelligence/hosting-providers"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "count": 8,
                  "providers": [
                    {
                      "provider": "Azure",
                      "kind": "cloud",
                      "ipv4_ranges": 44008,
                      "ipv6_ranges": 16750,
                      "total": 60758
                    },
                    {
                      "provider": "AWS",
                      "kind": "cloud",
                      "ipv4_ranges": 10518,
                      "ipv6_ranges": 6166,
                      "total": 16684
                    },
                    {
                      "provider": "GitHub",
                      "kind": "cloud",
                      "ipv4_ranges": 5981,
                      "ipv6_ranges": 1642,
                      "total": 7623
                    },
                    {
                      "provider": "DigitalOcean",
                      "kind": "cloud",
                      "ipv4_ranges": 1080,
                      "ipv6_ranges": 148,
                      "total": 1228
                    },
                    {
                      "provider": "Oracle",
                      "kind": "cloud",
                      "ipv4_ranges": 1107,
                      "ipv6_ranges": 0,
                      "total": 1107
                    },
                    {
                      "provider": "GCP",
                      "kind": "cloud",
                      "ipv4_ranges": 997,
                      "ipv6_ranges": 95,
                      "total": 1092
                    },
                    {
                      "provider": "Cloudflare",
                      "kind": "cdn",
                      "ipv4_ranges": 15,
                      "ipv6_ranges": 7,
                      "total": 22
                    },
                    {
                      "provider": "Fastly",
                      "kind": "cdn",
                      "ipv4_ranges": 19,
                      "ipv6_ranges": 2,
                      "total": 21
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/ip/me": {
      "get": {
        "operationId": "lookupCallerIp",
        "summary": "Lookup Caller IP",
        "description": "Lookup Caller IP endpoint of the IP Intelligence API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/ip-intelligence/lookup-caller-ip"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "ip": "8.8.8.8",
                  "family": "ipv4",
                  "mapped_from": null,
                  "special_use": null,
                  "country": "US",
                  "registry_country": "US",
                  "country_matches_registry": true,
                  "asn": {
                    "number": 15169,
                    "organization": "GOOGLE",
                    "registry_country": "US",
                    "range": {
                      "start": "8.8.8.0",
                      "end": "8.8.8.255"
                    }
                  },
                  "hosting": null,
                  "is_datacenter": false,
                  "is_cdn": false,
                  "is_tor_exit": false,
                  "is_routed": true,
                  "risk": {
                    "score": 0,
                    "level": "none",
                    "reasons": []
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/ip/{address}": {
      "get": {
        "operationId": "lookupIp",
        "summary": "Lookup IP",
        "description": "Lookup IP endpoint of the IP Intelligence API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/ip-intelligence/lookup-ip"
        },
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "3.5.140.2"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "ip": "8.8.8.8",
                  "family": "ipv4",
                  "mapped_from": null,
                  "special_use": null,
                  "country": "US",
                  "registry_country": "US",
                  "country_matches_registry": true,
                  "asn": {
                    "number": 15169,
                    "organization": "GOOGLE",
                    "registry_country": "US",
                    "range": {
                      "start": "8.8.8.0",
                      "end": "8.8.8.255"
                    }
                  },
                  "hosting": null,
                  "is_datacenter": false,
                  "is_cdn": false,
                  "is_tor_exit": false,
                  "is_routed": true,
                  "risk": {
                    "score": 0,
                    "level": "none",
                    "reasons": []
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/ip": {
      "post": {
        "operationId": "lookupIpBatch",
        "summary": "Lookup IP Batch",
        "description": "Lookup IP Batch endpoint of the IP Intelligence API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/ip-intelligence/lookup-ip-batch"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "addresses": [
                  "8.8.8.8",
                  "2001:4860:4860::8888",
                  "3.5.140.10"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "count": 4,
                  "results": [
                    {
                      "ok": true,
                      "ip": "8.8.8.8",
                      "family": "ipv4",
                      "mapped_from": null,
                      "special_use": null,
                      "country": "US",
                      "registry_country": "US",
                      "country_matches_registry": true,
                      "asn": {
                        "number": 15169,
                        "organization": "GOOGLE",
                        "registry_country": "US",
                        "range": {
                          "start": "8.8.8.0",
                          "end": "8.8.8.255"
                        }
                      },
                      "hosting": null,
                      "is_datacenter": false,
                      "is_cdn": false,
                      "is_tor_exit": false,
                      "is_routed": true,
                      "risk": {
                        "score": 0,
                        "level": "none",
                        "reasons": []
                      }
                    },
                    {
                      "ok": true,
                      "ip": "2001:4860:4860::8888",
                      "family": "ipv6",
                      "mapped_from": null,
                      "special_use": null,
                      "country": "CA",
                      "registry_country": "US",
                      "country_matches_registry": false,
                      "asn": {
                        "number": 15169,
                        "organization": "GOOGLE",
                        "registry_country": "US",
                        "range": {
                          "start": "2001:4860:480d::",
                          "end": "2001:4860:4864:ffff:ffff:ffff:ffff:ffff"
                        }
                      },
                      "hosting": null,
                      "is_datacenter": false,
                      "is_cdn": false,
                      "is_tor_exit": false,
                      "is_routed": true,
                      "risk": {
                        "score": 10,
                        "level": "low",
                        "reasons": [
                          {
                            "signal": "country_mismatch",
                            "weight": 10,
                            "detail": "Geolocates to CA but the block is registered in US."
                          }
                        ]
                      }
                    },
                    {
                      "ok": true,
                      "ip": "127.0.0.1",
                      "family": "ipv4",
                      "mapped_from": null,
                      "special_use": "loopback",
                      "country": null,
                      "registry_country": null,
                      "country_matches_registry": null,
                      "asn": null,
                      "hosting": null,
                      "is_datacenter": false,
                      "is_cdn": false,
                      "is_tor_exit": false,
                      "is_routed": false,
                      "risk": {
                        "score": 0,
                        "level": "none",
                        "reasons": []
                      }
                    },
                    {
                      "ok": false,
                      "ip": "not-an-ip",
                      "message": "Not a valid IPv4 or IPv6 address."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/asns": {
      "get": {
        "operationId": "searchAutonomousSystems",
        "summary": "Search Autonomous Systems",
        "description": "Search Autonomous Systems endpoint of the IP Intelligence API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/ip-intelligence/search-autonomous-systems"
        },
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "DE"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "20"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "1"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "hetzner"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "total": 10,
                  "page": 1,
                  "limit": 5,
                  "count": 5,
                  "results": [
                    {
                      "asn": 13335,
                      "organization": "CLOUDFLARENET",
                      "registry_country": "US"
                    },
                    {
                      "asn": 14789,
                      "organization": "CLOUDFLARENET",
                      "registry_country": "US"
                    },
                    {
                      "asn": 132892,
                      "organization": "CLOUDFLARE Cloudflare, Inc.",
                      "registry_country": "US"
                    },
                    {
                      "asn": 139242,
                      "organization": "CSL-AS-AP Cloudflare Sydney, LLC",
                      "registry_country": "US"
                    },
                    {
                      "asn": 202623,
                      "organization": "CLOUDFLARENET-CORE Cloudflare, Inc.",
                      "registry_country": "US"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 1 token per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}