{
  "openapi": "3.1.0",
  "info": {
    "title": "FFraud API",
    "version": "1.0.0",
    "summary": "Free, open IP and email fraud intelligence.",
    "description": "Check any IP or email for fraud, VPN, proxy, Tor, datacenter, and abuse history. Free for everyone, no usage caps. The public endpoints need no API key; a free key adds batch lookups, usage stats, and the community reporting API. The database behind this API is published daily as MIT-licensed open data at https://github.com/FFraud-com .\n\nDrop-in compatibility endpoints let you migrate off AbuseIPDB, IPQualityScore, or ipinfo by changing one URL.",
    "contact": { "name": "FFraud", "url": "https://ffraud.com", "email": "team@ffraud.com" },
    "license": { "name": "MIT", "url": "https://github.com/FFraud-com/ip-fraud-database/blob/main/LICENSE" }
  },
  "servers": [
    { "url": "https://api.ffraud.com", "description": "Production" }
  ],
  "externalDocs": { "description": "Full docs", "url": "https://ffraud.com/docs" },
  "tags": [
    { "name": "IP", "description": "IP fraud intelligence lookups." },
    { "name": "Email", "description": "Temporary, alias and abusive email detection, typo suggestions and mail servers." },
    { "name": "Domain", "description": "Domain reputation." },
    { "name": "Device", "description": "A stable ID and a risk score for every device on your site." },
    { "name": "Community", "description": "Report abusive IPs and read the community database. No account needed to report." },
    { "name": "Account", "description": "API keys and usage. Requires a free account." },
    { "name": "Compatibility", "description": "Drop-in replacements for AbuseIPDB, IPQualityScore, and ipinfo." },
    { "name": "System", "description": "Health and live counts." }
  ],
  "security": [ {}, { "ApiKeyHeader": [] } ],
  "paths": {
    "/public/ip/{ip}": {
      "get": {
        "tags": ["IP"],
        "summary": "Check an IP (public, no key)",
        "description": "Full fraud intelligence for a single IP. No API key required, no usage caps, edge-cached for 5 minutes. This returns the same body as POST /v1/ip/check.",
        "operationId": "publicIpCheck",
        "security": [ {} ],
        "parameters": [
          { "name": "ip", "in": "path", "required": true, "schema": { "type": "string" }, "example": "80.82.77.33", "description": "IPv4 or IPv6 address." }
        ],
        "responses": {
          "200": { "description": "IP intelligence.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IpResponse" } } } },
          "400": { "$ref": "#/components/responses/Error" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/v1/ip/check": {
      "post": {
        "tags": ["IP"],
        "summary": "Check an IP (with key)",
        "description": "Full fraud intelligence for a single IP. Requires an API key.",
        "operationId": "ipCheck",
        "security": [ { "ApiKeyHeader": [] } ],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IpCheckRequest" } } }
        },
        "responses": {
          "200": { "description": "IP intelligence.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IpResponse" } } } },
          "400": { "$ref": "#/components/responses/Error" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/v1/ip/batch": {
      "post": {
        "tags": ["IP"],
        "summary": "Check up to 100 IPs",
        "operationId": "ipBatch",
        "security": [ { "ApiKeyHeader": [] } ],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchIpRequest" } } }
        },
        "responses": {
          "200": {
            "description": "Results in request order.",
            "content": { "application/json": { "schema": {
              "type": "object",
              "properties": {
                "results": { "type": "array", "items": { "$ref": "#/components/schemas/IpResponse" } },
                "total": { "type": "integer", "example": 3 }
              }
            } } }
          },
          "400": { "$ref": "#/components/responses/Error" },
          "401": { "$ref": "#/components/responses/Unauthorized" }
        }
      }
    },
    "/public/email/check": {
      "post": {
        "tags": ["Email"],
        "summary": "Check an email (public, no key)",
        "operationId": "publicEmailCheck",
        "security": [ {} ],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmailCheckRequest" } } }
        },
        "responses": {
          "200": { "description": "Email intelligence.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmailResponse" } } } },
          "400": { "$ref": "#/components/responses/Error" }
        }
      }
    },
    "/v1/email/check": {
      "post": {
        "tags": ["Email"],
        "summary": "Check an email (with key)",
        "operationId": "emailCheck",
        "security": [ { "ApiKeyHeader": [] } ],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmailCheckRequest" } } }
        },
        "responses": {
          "200": { "description": "Email intelligence.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmailResponse" } } } },
          "400": { "$ref": "#/components/responses/Error" },
          "401": { "$ref": "#/components/responses/Unauthorized" }
        }
      }
    },
    "/v1/email/batch": {
      "post": {
        "tags": ["Email"],
        "summary": "Check up to 100 emails (with key)",
        "description": "One result per address, in the order sent, each with every field of the single check. The whole batch shares one request_id.",
        "operationId": "emailBatch",
        "security": [ { "ApiKeyHeader": [] } ],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchEmailRequest" } } }
        },
        "responses": {
          "200": { "description": "One result per address.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchEmailResponse" } } } },
          "400": { "$ref": "#/components/responses/Error" },
          "401": { "$ref": "#/components/responses/Unauthorized" }
        }
      }
    },
    "/v1/email/report": {
      "post": {
        "tags": ["Email"],
        "summary": "Report an abusive email (with key)",
        "description": "Adds the address to the community blacklist. Every merchant who checks it afterwards sees the report count and categories; who reported it stays private.",
        "operationId": "emailReport",
        "security": [ { "ApiKeyHeader": [] } ],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmailReportRequest" } } }
        },
        "responses": {
          "200": { "description": "Report recorded.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmailReportResponse" } } } },
          "400": { "$ref": "#/components/responses/Error" },
          "401": { "$ref": "#/components/responses/Unauthorized" }
        }
      }
    },
    "/v1/email/lists": {
      "get": {
        "tags": ["Email"],
        "summary": "Your allow and block lists (with key)",
        "description": "The calling account's own lists of domains. They decide blocked on its keyed email checks; an entry covers the domain and every domain under it, and the more specific entry wins.",
        "operationId": "emailListsGet",
        "security": [ { "ApiKeyHeader": [] } ],
        "responses": {
          "200": { "description": "The two lists.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmailLists" } } } },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Error" }
        }
      }
    },
    "/v1/email/lists/{domain}": {
      "put": {
        "tags": ["Email"],
        "summary": "Allow or block a domain (with key)",
        "description": "Puts the domain on the allow or the block list, or moves it from the other one. Idempotent. Reaches every answer within 30 seconds; up to 1,000 entries per account.",
        "operationId": "emailListsPut",
        "security": [ { "ApiKeyHeader": [] } ],
        "parameters": [
          { "name": "domain", "in": "path", "required": true, "schema": { "type": "string" }, "example": "partner.com" }
        ],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmailListRequest" } } }
        },
        "responses": {
          "200": { "description": "The entry as stored.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmailListEntry" } } } },
          "400": { "$ref": "#/components/responses/Error" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Error" }
        }
      },
      "delete": {
        "tags": ["Email"],
        "summary": "Take a domain off your lists (with key)",
        "operationId": "emailListsDelete",
        "security": [ { "ApiKeyHeader": [] } ],
        "parameters": [
          { "name": "domain", "in": "path", "required": true, "schema": { "type": "string" }, "example": "partner.com" }
        ],
        "responses": {
          "200": { "description": "Whether there was an entry to remove.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmailListRemoved" } } } },
          "400": { "$ref": "#/components/responses/Error" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Error" }
        }
      }
    },
    "/public/domain/{domain}": {
      "get": {
        "tags": ["Domain"],
        "summary": "Domain reputation (public, no key)",
        "operationId": "publicDomainReputation",
        "security": [ {} ],
        "parameters": [
          { "name": "domain", "in": "path", "required": true, "schema": { "type": "string" }, "example": "mailinator.com" }
        ],
        "responses": {
          "200": { "description": "Domain reputation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DomainResponse" } } } },
          "400": { "$ref": "#/components/responses/Error" }
        }
      }
    },
    "/public/ip/{ip}/report": {
      "post": {
        "tags": ["Community"],
        "summary": "Report an abusive IP (no account)",
        "description": "Add a community report for an IP. No API key required. Confirmed reports roll into the next daily open-data build.",
        "operationId": "reportIp",
        "security": [ {} ],
        "parameters": [
          { "name": "ip", "in": "path", "required": true, "schema": { "type": "string" }, "example": "80.82.77.33" }
        ],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReportRequest" } } }
        },
        "responses": {
          "200": { "description": "Report accepted." },
          "400": { "$ref": "#/components/responses/Error" }
        }
      }
    },
    "/public/ip/{ip}/reports": {
      "get": {
        "tags": ["Community"],
        "summary": "List community reports for an IP",
        "operationId": "listReports",
        "security": [ {} ],
        "parameters": [
          { "name": "ip", "in": "path", "required": true, "schema": { "type": "string" }, "example": "80.82.77.33" }
        ],
        "responses": {
          "200": {
            "description": "Reports, ranked by vote score then recency (max 50).",
            "content": { "application/json": { "schema": {
              "type": "object",
              "properties": {
                "total": { "type": "integer" },
                "reports": { "type": "array", "items": { "$ref": "#/components/schemas/Report" } }
              }
            } } }
          }
        }
      }
    },
    "/public/ip/{ip}/reports/{report_id}/vote": {
      "post": {
        "tags": ["Community"],
        "summary": "Vote a report up or down",
        "operationId": "voteReport",
        "security": [ {} ],
        "parameters": [
          { "name": "ip", "in": "path", "required": true, "schema": { "type": "string" } },
          { "name": "report_id", "in": "path", "required": true, "schema": { "type": "integer" } }
        ],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": {
            "type": "object",
            "properties": { "vote": { "type": "string", "enum": ["up", "down"] } },
            "required": ["vote"]
          } } }
        },
        "responses": { "200": { "description": "Vote recorded." } }
      }
    },
    "/public/reporters/leaderboard": {
      "get": {
        "tags": ["Community"],
        "summary": "Top reporters",
        "operationId": "reportersLeaderboard",
        "security": [ {} ],
        "responses": { "200": { "description": "Ranked reporters with trust tiers." } }
      }
    },
    "/public/reporters/stats": {
      "get": {
        "tags": ["Community"],
        "summary": "Community reporting stats",
        "operationId": "reportersStats",
        "security": [ {} ],
        "responses": {
          "200": {
            "description": "Aggregate reporting activity.",
            "content": { "application/json": { "schema": {
              "type": "object",
              "properties": {
                "total_reports": { "type": "integer" },
                "reports_last_24h": { "type": "integer" },
                "reports_last_7d": { "type": "integer" },
                "unique_ips_reported": { "type": "integer" }
              }
            } } }
          }
        }
      }
    },
    "/v1/report/bulk": {
      "post": {
        "tags": ["Community"],
        "summary": "Bulk-report up to 1000 IPs",
        "description": "Trust-weighted bulk reporting for teams running honeypots, fail2ban, or WAFs.",
        "operationId": "bulkReport",
        "security": [ { "ApiKeyHeader": [] } ],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": {
            "type": "object",
            "properties": {
              "ips": {
                "type": "array",
                "maxItems": 1000,
                "items": {
                  "type": "object",
                  "properties": {
                    "ip": { "type": "string" },
                    "category": { "$ref": "#/components/schemas/ReportCategory" },
                    "comment": { "type": "string" }
                  },
                  "required": ["ip", "category"]
                }
              }
            },
            "required": ["ips"]
          } } }
        },
        "responses": { "200": { "description": "Accepted count." }, "401": { "$ref": "#/components/responses/Unauthorized" } }
      }
    },
    "/v1/keys": {
      "get": {
        "tags": ["Account"],
        "summary": "List your API keys",
        "operationId": "listKeys",
        "security": [ { "ApiKeyHeader": [] } ],
        "responses": { "200": { "description": "Your keys (prefixes only)." }, "401": { "$ref": "#/components/responses/Unauthorized" } }
      }
    },
    "/v1/events": {
      "get": {
        "tags": [
          "Device"
        ],
        "summary": "Your latest device events",
        "description": "The newest device events of your account, newest first.",
        "operationId": "deviceEvents",
        "security": [
          {
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The events."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/events/{id}": {
      "get": {
        "tags": [
          "Device"
        ],
        "summary": "One device event",
        "description": "The verdict for one event: the device, a score from 0 to 100, and its flags. Use your secret key, from your server. The browser gets the event id from the SDK.",
        "operationId": "deviceEvent",
        "security": [
          {
            "ApiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The verdict."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No event with this id for your account."
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "tags": ["Account"],
        "summary": "Your usage stats",
        "description": "30-day daily time series plus per-key and per-endpoint breakdowns.",
        "operationId": "usage",
        "security": [ { "ApiKeyHeader": [] } ],
        "responses": { "200": { "description": "Usage stats." }, "401": { "$ref": "#/components/responses/Unauthorized" } }
      }
    },
    "/compat/abuseipdb/v2/check": {
      "get": {
        "tags": ["Compatibility"],
        "summary": "AbuseIPDB-compatible check",
        "description": "Drop-in replacement for GET https://api.abuseipdb.com/api/v2/check . Point your existing AbuseIPDB client or fail2ban action at this URL and pass your FFraud key in the `Key` header. Response matches AbuseIPDB's `data` envelope, plus an `ffraud_extras` object.",
        "operationId": "compatAbuseipdbCheck",
        "security": [ { "AbuseIpdbKey": [] } ],
        "parameters": [
          { "name": "ipAddress", "in": "query", "required": true, "schema": { "type": "string" }, "example": "80.82.77.33" },
          { "name": "maxAgeInDays", "in": "query", "schema": { "type": "integer", "default": 90 } }
        ],
        "responses": { "200": { "description": "AbuseIPDB-shaped response." }, "401": { "$ref": "#/components/responses/Unauthorized" } }
      }
    },
    "/compat/ipqs/json/{key}/{ip}": {
      "get": {
        "tags": ["Compatibility"],
        "summary": "IPQualityScore-compatible check",
        "description": "Drop-in replacement for GET https://ipqualityscore.com/api/json/{key}/{ip} . Response mirrors IPQS's proxy-detection fields, plus an `ffraud_extras` object.",
        "operationId": "compatIpqsCheck",
        "security": [ {} ],
        "parameters": [
          { "name": "key", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Your FFraud API key, in the URL like IPQS." },
          { "name": "ip", "in": "path", "required": true, "schema": { "type": "string" }, "example": "80.82.77.33" }
        ],
        "responses": { "200": { "description": "IPQS-shaped response." }, "401": { "$ref": "#/components/responses/Unauthorized" } }
      }
    },
    "/compat/ipinfo/{ip}": {
      "get": {
        "tags": ["Compatibility"],
        "summary": "ipinfo-compatible lookup",
        "description": "Drop-in replacement for GET https://ipinfo.io/{ip} . Response mirrors ipinfo's flat geo + privacy format, plus an `ffraud_extras` object. Pass your key as `?token=` or `Authorization: Bearer`.",
        "operationId": "compatIpinfoCheck",
        "security": [ { "IpinfoToken": [] } ],
        "parameters": [
          { "name": "ip", "in": "path", "required": true, "schema": { "type": "string" }, "example": "8.8.8.8" },
          { "name": "token", "in": "query", "schema": { "type": "string" }, "description": "Your FFraud API key." }
        ],
        "responses": { "200": { "description": "ipinfo-shaped response." }, "401": { "$ref": "#/components/responses/Unauthorized" } }
      }
    },
    "/health": {
      "get": {
        "tags": ["System"],
        "summary": "Health and live counts",
        "operationId": "health",
        "security": [ {} ],
        "responses": {
          "200": {
            "description": "Engine status and live dataset counts.",
            "content": { "application/json": { "schema": {
              "type": "object",
              "properties": {
                "ip_entries": { "type": "integer" },
                "disposable_domains": { "type": "integer" },
                "geo_ranges": { "type": "integer" },
                "uptime_seconds": { "type": "integer" },
                "version": { "type": "string" }
              }
            } } }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": { "type": "apiKey", "in": "header", "name": "X-API-Key", "description": "Your FFraud API key (ff_live_...). Create one free at https://ffraud.com/register ." },
      "AbuseIpdbKey": { "type": "apiKey", "in": "header", "name": "Key", "description": "Your FFraud API key, sent in AbuseIPDB's `Key` header for the compatibility endpoint." },
      "IpinfoToken": { "type": "apiKey", "in": "query", "name": "token", "description": "Your FFraud API key, sent as ipinfo's `token` query param." }
    },
    "responses": {
      "Error": {
        "description": "Bad request.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      },
      "Unauthorized": {
        "description": "Missing or invalid API key.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      },
      "RateLimited": {
        "description": "Fair-use burst limit hit. Retry shortly. There are no daily or monthly caps; email team@ffraud.com to raise sustained throughput.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      }
    },
    "schemas": {
      "IpCheckRequest": {
        "type": "object",
        "required": ["ip"],
        "properties": { "ip": { "type": "string", "example": "80.82.77.33" } }
      },
      "BatchIpRequest": {
        "type": "object",
        "required": ["ips"],
        "properties": { "ips": { "type": "array", "maxItems": 100, "items": { "type": "string" }, "example": ["80.82.77.33", "8.8.8.8"] } }
      },
      "EmailCheckRequest": {
        "type": "object",
        "required": ["email"],
        "properties": { "email": { "type": "string", "example": "test@mailinator.com" } }
      },
      "BatchEmailRequest": {
        "type": "object",
        "required": ["emails"],
        "properties": { "emails": { "type": "array", "minItems": 1, "maxItems": 100, "items": { "type": "string" }, "example": ["jane@gmail.com", "jane@passmail.com"] } }
      },
      "BatchEmailResponse": {
        "type": "object",
        "properties": {
          "request_id": { "type": "string", "example": "req_1a186b7a91c40f2e8d3b5a6" },
          "results": { "type": "array", "items": { "$ref": "#/components/schemas/EmailResponse" }, "description": "One result per address, in the order sent." },
          "total": { "type": "integer", "example": 2 }
        }
      },
      "EmailReportRequest": {
        "type": "object",
        "required": ["email"],
        "properties": {
          "email": { "type": "string", "example": "scammer@example.org" },
          "category": { "type": "string", "enum": ["chargebacks", "carding", "account_abuse", "refund_fraud", "identity_theft", "spam", "phishing", "other"], "default": "other" },
          "comment": { "type": "string", "description": "A short note for our review." }
        }
      },
      "EmailLists": {
        "type": "object",
        "properties": {
          "allow": { "type": "array", "items": { "type": "string" }, "example": ["partner.com"] },
          "block": { "type": "array", "items": { "type": "string" }, "example": ["unwanted-domain.com"] },
          "limit": { "type": "integer", "example": 1000, "description": "Entries one account may hold across both lists." }
        }
      },
      "EmailListRequest": {
        "type": "object",
        "required": ["list"],
        "properties": { "list": { "type": "string", "enum": ["allow", "block"] } }
      },
      "EmailListEntry": {
        "type": "object",
        "properties": {
          "domain": { "type": "string", "example": "partner.com" },
          "list": { "type": "string", "enum": ["allow", "block"] }
        }
      },
      "EmailListRemoved": {
        "type": "object",
        "properties": {
          "domain": { "type": "string", "example": "partner.com" },
          "removed": { "type": "boolean" }
        }
      },
      "EmailReportResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "example": true },
          "email": { "type": "string", "example": "scammer@example.org" },
          "total_reports": { "type": "integer", "example": 3 }
        }
      },
      "ReportRequest": {
        "type": "object",
        "required": ["category"],
        "properties": {
          "category": { "$ref": "#/components/schemas/ReportCategory" },
          "comment": { "type": "string", "example": "Brute-forced /login 10k times overnight." },
          "evidence_url": { "type": "string", "example": "https://gist.github.com/..." },
          "reporter": { "type": "string", "description": "Optional handle for leaderboard credit." }
        }
      },
      "ReportCategory": {
        "type": "string",
        "enum": ["brute_force", "spam", "vpn", "tor", "fraud", "port_scan", "web_attack", "phishing", "malware", "bot", "scraping", "other"]
      },
      "Report": {
        "type": "object",
        "properties": {
          "id": { "type": "integer" },
          "reporter": { "type": "string" },
          "category": { "$ref": "#/components/schemas/ReportCategory" },
          "comment": { "type": "string" },
          "evidence_url": { "type": "string" },
          "created_at": { "type": "string", "format": "date-time" },
          "votes_up": { "type": "integer" },
          "votes_down": { "type": "integer" }
        }
      },
      "IpResponse": {
        "type": "object",
        "description": "Flat structure for easy consumption. Optional fields are omitted when we have no data (no null soup).",
        "required": ["success", "ip", "fraud_score", "risk", "proxy", "vpn", "tor", "relay", "hosting", "mobile", "is_abuser", "is_crawler", "recent_abuse", "connection_type", "is_residential_proxy", "shared_connection", "is_private", "confidence", "data_completeness"],
        "properties": {
          "request_id": { "type": "string", "example": "req_1a186e8e3c657e922f10d8a", "description": "Keyed calls only: the id of this request; quote it to support. A batch shares one. The public answer is cached and carries none." },
          "success": { "type": "boolean" },
          "ip": { "type": "string", "example": "80.82.77.33" },
          "fraud_score": { "type": "integer", "minimum": 0, "maximum": 100, "example": 95 },
          "risk": { "type": "string", "enum": ["none", "low", "medium", "high", "critical"] },
          "reason": { "type": "string", "description": "Plain-English explanation of the score.", "example": "Active command & control (C2) server. Persistent high-severity threat, confirmed repeatedly by our honeypot sensors and community reports." },
          "proxy": { "type": "boolean" },
          "vpn": { "type": "boolean" },
          "tor": { "type": "boolean" },
          "relay": { "type": "boolean" },
          "hosting": { "type": "boolean" },
          "mobile": { "type": "boolean" },
          "is_abuser": { "type": "boolean" },
          "is_crawler": { "type": "boolean" },
          "recent_abuse": { "type": "boolean", "description": "Abuse confirmed within the last 30 days." },
          "connection_type": { "type": "string", "example": "Data Center" },
          "proxy_type": { "type": "string", "description": "Raw IP2Proxy PX12 class: PUB, VPN, WEB, RES, DCH, SES." },
          "is_residential_proxy": { "type": "boolean" },
          "shared_connection": { "type": "boolean" },
          "ISP": { "type": "string" },
          "organization": { "type": "string" },
          "ASN": { "type": "integer", "example": 15169 },
          "leased_through": { "type": "object", "description": "The IP leasing marketplace or IPv4 broker whose geofeed places this address block; the lessee sets that location, so geo keeps the estimate. Information only, not part of the score.", "properties": { "name": { "type": "string", "example": "IPXO" }, "type": { "type": "string", "enum": ["leasing marketplace", "IPv4 broker"] } } },
          "tunnel": { "type": "object", "description": "For a 6to4 or Teredo IPv6 address: the IPv4 address it carries. The verdict is that IPv4's own.", "properties": { "type": { "type": "string", "enum": ["6to4", "teredo"] }, "ipv4": { "type": "string", "example": "87.149.28.42" } } },
          "asn_registered": { "type": "string", "format": "date", "example": "2000-03-30", "description": "When the network (ASN) got its current registration at its regional registry; a number passed to a new holder shows that date. Context only, not part of the score." },
          "vpn_provider": { "type": "string", "example": "NordVPN" },
          "cloud_provider": { "type": "string", "example": "Google Cloud" },
          "relay_service": { "type": "string", "example": "Apple iCloud Private Relay" },
          "threat_type": { "type": "string", "description": "PX12 threat class: SPAM, SCANNER, BOTNET." },
          "threat_tags": { "type": "array", "items": { "type": "string" }, "example": ["c2_server", "ssh_brute_force"] },
          "is_private": { "type": "boolean" },
          "subnet_abuse_ratio": { "type": "number", "format": "float", "description": "Fraction of the /24 flagged abusive (0.0-1.0)." },
          "subnet_total_ips": { "type": "integer" },
          "subnet_abuser_count": { "type": "integer" },
          "confidence": { "type": "string", "enum": ["high", "medium", "low"] },
          "data_completeness": { "type": "number", "format": "float", "description": "Fraction of data layers that returned data (0.0-1.0)." },
          "rdns_classification": { "type": "string", "enum": ["residential", "mobile", "hosting", "vpn", "corporate", "education", "government", "no_ptr", "unknown"] },
          "hostname": { "type": "string", "description": "Reverse-DNS (PTR) hostname, when published.", "example": "mail.example.com" },
          "isp_domain": { "type": "string", "description": "Domain of the ISP / network operator." },
          "first_seen": { "type": "string", "format": "date-time", "description": "When this IP was first observed." },
          "last_seen": { "type": "string", "format": "date-time", "description": "When this IP's intelligence was last confirmed." },
          "times_seen": { "type": "integer", "description": "Times observed across our cycles." },
          "total_reports": { "type": "integer", "description": "Aggregate community + honeypot reports for this IP." },
          "distinct_reporters": { "type": "integer", "description": "Distinct independent reporters." },
          "open_ports": { "type": "array", "items": { "type": "integer" }, "description": "Open ports observed by our own scan sensors.", "example": [22, 80, 443] },
          "vulnerabilities": { "type": "array", "items": { "type": "string" }, "description": "Known CVE identifiers for services observed on this IP.", "example": ["CVE-2021-44228"] },
          "whois": {
            "type": "object",
            "description": "Public registry (WHOIS/RDAP) record for the IP's network block.",
            "properties": {
              "network": { "type": "string" },
              "netname": { "type": "string" },
              "country": { "type": "string" },
              "org_name": { "type": "string" },
              "status": { "type": "string" },
              "abuse_contact": { "type": "string", "description": "Abuse-reporting email for the network." },
              "source": { "type": "string", "description": "Registry (RIPE, ARIN, APNIC, ...)." },
              "allocated": { "type": "string", "description": "Allocation date." }
            }
          },
          "residential_proxy": { "$ref": "#/components/schemas/ResidentialProxy" },
          "carrier": { "$ref": "#/components/schemas/Carrier" },
          "company": { "$ref": "#/components/schemas/Company" },
          "whois": { "$ref": "#/components/schemas/Whois" },
          "geo": { "$ref": "#/components/schemas/Geo" }
        }
      },
      "ResidentialProxy": {
        "type": "object",
        "properties": {
          "detected": { "type": "boolean" },
          "confidence": { "type": "string", "enum": ["very_high", "high", "medium", "low"] },
          "recency": { "type": "string", "enum": ["active", "recent", "aging", "stale"] },
          "last_seen": { "type": "string", "format": "date-time" },
          "first_seen": { "type": "string", "format": "date-time" },
          "persistence_days": { "type": "integer" },
          "times_seen": { "type": "integer" },
          "multi_provider": { "type": "boolean" },
          "provider_count": { "type": "integer" }
        }
      },
      "Carrier": {
        "type": "object",
        "properties": { "name": { "type": "string" }, "mcc": { "type": "string" }, "mnc": { "type": "string" } }
      },
      "Company": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "domain": { "type": "string" },
          "type": { "type": "string", "enum": ["isp", "hosting", "business", "education", "government"] },
          "network": { "type": "string", "description": "CIDR / range string for the company's network block." },
          "country": { "type": "string" }
        }
      },
      "Whois": {
        "type": "object",
        "properties": {
          "network": { "type": "string" },
          "netname": { "type": "string" },
          "country": { "type": "string" },
          "org_name": { "type": "string" },
          "status": { "type": "string" },
          "abuse_contact": { "type": "string" },
          "source": { "type": "string" }
        }
      },
      "Geo": {
        "type": "object",
        "properties": {
          "country": { "type": "string", "example": "US" },
          "country_name": { "type": "string", "example": "United States" },
          "region": { "type": "string" },
          "city": { "type": "string" },
          "latitude": { "type": "number", "format": "float" },
          "longitude": { "type": "number", "format": "float" },
          "timezone": { "type": "string" },
          "asn": { "type": "string" },
          "asn_org": { "type": "string" },
          "isp": { "type": "string" }
        }
      },
      "EmailResponse": {
        "type": "object",
        "required": ["request_id", "email", "normalized_email", "domain", "did_you_mean", "is_disposable", "detection_source", "safe_domain", "valid_format", "is_role_address", "is_forwarder", "is_alias_service", "mx_found", "mx_records", "email_type"],
        "properties": {
          "request_id": { "type": "string", "example": "req_1a186b70c2f731df36e7c60", "description": "The id of this request. Quote it to support to have the check traced. Every address of a batch shares one." },
          "email": { "type": "string", "example": "jane.doe+shop@mailinator.com", "description": "The address as sent, with outer spaces removed." },
          "normalized_email": { "type": ["string", "null"], "example": "jane.doe@mailinator.com", "description": "The address as one mailbox: lowercased, the +tag removed, googlemail.com read as gmail.com and the dots removed on gmail.com. Null when the address is invalid." },
          "domain": { "type": "string", "example": "mailinator.com" },
          "did_you_mean": { "type": ["string", "null"], "example": null, "description": "The corrected address when the domain is one keystroke from a big provider (john@gmial.com gives john@gmail.com). Changes no other field." },
          "is_disposable": { "type": "boolean", "description": "True for temporary and alias addresses alike; email_type tells them apart." },
          "detection_source": { "type": "string", "enum": ["none", "safe_domain", "alias_provider", "alias_provider_mx", "database", "pattern", "mx_host", "mx_ip", "provider_live", "business_mx", "cleared", "known_spammer", "no_mx", "reserved", "invalid"], "description": "The check that decided the answer. no_mx: the domain does not exist or accepts no mail, so the address is invalid." },
          "safe_domain": { "type": "boolean", "description": "A major mail provider on the allow list; never disposable." },
          "valid_format": { "type": "boolean" },
          "is_role_address": { "type": "boolean", "description": "e.g. admin@, support@, info@" },
          "is_forwarder": { "type": "boolean", "description": "Mail for the domain is passed on to a mailbox somewhere else." },
          "is_alias_service": { "type": "boolean", "description": "The forwarding service gives one person unlimited addresses. The yes or no for an alias." },
          "forwarder_service": { "type": "string", "example": "Proton Pass", "description": "The name of the forwarding service, when it can be named." },
          "mx_found": { "type": ["boolean", "null"], "description": "The domain publishes mail servers (MX records). Null when the lookup did not finish." },
          "mx_records": { "type": "array", "maxItems": 4, "items": { "type": "string" }, "example": ["mail.mailinator.com", "mail2.mailinator.com"], "description": "The mail servers, best first." },
          "is_known_spammer": { "type": "boolean", "description": "This exact address was reported for spam or abuse." },
          "reason": { "type": "string", "description": "One sentence a person can read, explaining the answer." },
          "email_type": { "type": "string", "enum": ["temp", "alias", "normal", "invalid"], "description": "temp (throwaway inbox), alias (forwarding address, unlimited per person), normal or invalid." },
          "blocked": { "type": "boolean", "description": "Keyed calls only: whether the account refuses this address, from its own allow and block lists first, then its dashboard switches. An invalid address is always blocked." },
          "allowlisted": { "type": "boolean", "description": "Keyed calls only: the domain, or one above it, is on the account's allow list." },
          "blocklisted": { "type": "boolean", "description": "Keyed calls only: the domain, or one above it, is on the account's block list." },
          "community_blacklisted": { "type": "boolean" },
          "blacklist_reports": { "type": "integer" },
          "blacklist_reasons": { "type": "array", "items": { "type": "string" } }
        }
      },
      "DomainResponse": {
        "type": "object",
        "properties": {
          "domain": { "type": "string", "example": "mailinator.com" },
          "known": { "type": "boolean", "description": "True on every answer: the domain was evaluated." },
          "is_disposable": { "type": "boolean" },
          "email_type": { "type": "string", "enum": ["temp", "alias", "normal", "invalid"] },
          "is_phishing": { "type": "boolean" },
          "risk_level": { "type": "string", "enum": ["low", "high", "critical"], "description": "critical when phishing, high when disposable, otherwise low." },
          "detection_source": { "type": "string", "description": "The check that decided, as on the email check." },
          "reason": { "type": ["string", "null"] },
          "blocked_count": { "type": "integer", "description": "Only on some listed throwaway domains: how many times the domain has been blocked." },
          "related_domains": { "type": "array", "maxItems": 12, "items": { "type": "string" }, "description": "Only on listed throwaway domains: other throwaway domains from the same list." }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "example": false },
          "error_code": { "type": "integer", "example": 1002 },
          "error": { "type": "string", "example": "INVALID_API_KEY" },
          "message": { "type": "string", "example": "The API key provided is not valid." }
        }
      }
    }
  }
}
