{
  "openapi": "3.0.3",
  "info": {
    "title": "IP Reputation and Blacklist Checker",
    "version": "1.0.0",
    "description": "Check whether an IPv4 address is listed on known DNSBL blacklists (Spamhaus, Barracuda, SORBS, SpamCop, UCEPROTECT and more). No external API key required — queries run against public DNSBL zones. Includes a batch endpoint for up to 10 IPs and a list of the active blacklists.\n",
    "contact": {
      "name": "IP Reputation API Support",
      "email": "api@hiroapp.cc"
    }
  },
  "servers": [
    {
      "url": "https://api.sprytools.com/v1/ip-reputation",
      "description": "Production (SpryTools API Gateway)"
    }
  ],
  "tags": [
    {
      "name": "Check"
    },
    {
      "name": "Reference"
    }
  ],
  "security": [
    {
      "ApiKeyHeader": []
    },
    {
      "RapidApiProxy": []
    }
  ],
  "paths": {
    "/api/v1/check": {
      "get": {
        "operationId": "checkIp",
        "summary": "Check an IP against all blacklists",
        "tags": [
          "Check"
        ],
        "parameters": [
          {
            "name": "ip",
            "in": "query",
            "required": true,
            "description": "IPv4 address to check",
            "schema": {
              "type": "string"
            },
            "example": "1.2.3.4"
          }
        ],
        "responses": {
          "200": {
            "description": "Reputation result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckResult"
                },
                "example": {
                  "ip": "1.2.3.4",
                  "listed": true,
                  "listedCount": 2,
                  "lists": [
                    {
                      "name": "Spamhaus ZEN",
                      "listed": true
                    },
                    {
                      "name": "Barracuda",
                      "listed": false
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamFailed"
          }
        }
      }
    },
    "/api/v1/lists": {
      "get": {
        "operationId": "listBlacklists",
        "summary": "List all active DNSBL blacklists",
        "tags": [
          "Reference"
        ],
        "responses": {
          "200": {
            "description": "Active DNSBL lists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "lists": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/check/batch": {
      "post": {
        "operationId": "checkIpBatch",
        "summary": "Check multiple IPs (max 10)",
        "tags": [
          "Check"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ips"
                ],
                "properties": {
                  "ips": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 10,
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "example": {
                "ips": [
                  "1.2.3.4",
                  "8.8.8.8"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Batch reputation results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CheckResult"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      },
      "RapidApiProxy": {
        "type": "apiKey",
        "in": "header",
        "name": "x-rapidapi-proxy-secret"
      }
    },
    "schemas": {
      "CheckResult": {
        "type": "object",
        "properties": {
          "ip": {
            "type": "string"
          },
          "listed": {
            "type": "boolean"
          },
          "listedCount": {
            "type": "integer"
          },
          "lists": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "listed": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Missing or invalid IP",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "'ip' query parameter is required"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "API key missing",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "API key required"
            }
          }
        }
      },
      "UpstreamFailed": {
        "description": "DNSBL lookup failed",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "DNSBL check failed"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limit exceeded (100 requests per minute)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Rate limit exceeded"
            }
          }
        }
      }
    }
  }
}