{
  "openapi": "3.0.3",
  "info": {
    "title": "SwiftCodeCheck SWIFT/BIC Lookup API",
    "description": "Free SWIFT/BIC code lookup. Returns bank, city, branch and country for an 8 or 11 character BIC. Keyless use is limited per IP per day; a free IPNOVA API key raises the limit and works across all IPNOVA APIs.",
    "version": "1.0.0",
    "contact": { "url": "https://swiftcodecheck.com/swift-code-api" }
  },
  "servers": [{ "url": "https://swiftcodecheck.com" }],
  "paths": {
    "/api/swift/{code}": {
      "get": {
        "summary": "Look up a SWIFT/BIC code",
        "operationId": "swiftLookup",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "SWIFT/BIC code, 8 or 11 characters",
            "schema": { "type": "string", "pattern": "^[A-Za-z0-9]{8}([A-Za-z0-9]{3})?$", "example": "DEUTDEFF" }
          }
        ],
        "security": [{}, { "apiKey": [] }],
        "responses": {
          "200": {
            "description": "SWIFT code found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean", "example": true },
                    "data": {
                      "type": "object",
                      "properties": {
                        "swift_code": { "type": "string", "example": "DEUTDEFF" },
                        "bank": { "type": "string", "example": "Deutsche Bank AG" },
                        "city": { "type": "string", "example": "Frankfurt Am Main" },
                        "branch": { "type": "string" },
                        "country_code": { "type": "string", "example": "DE" },
                        "country": { "type": "string", "example": "Germany" },
                        "bank_code": { "type": "string", "example": "DEUT" },
                        "location_code": { "type": "string", "example": "FF" }
                      }
                    },
                    "page": { "type": "string" },
                    "attribution": { "type": "string" },
                    "docs": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/Error" },
          "404": { "$ref": "#/components/responses/Error" },
          "429": { "$ref": "#/components/responses/Error" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Free IPNOVA API key from https://api.ipnova.com; one key works on every IPNOVA API"
      }
    },
    "responses": {
      "Error": {
        "description": "Error with a machine-readable reason (invalid_input, not_found, rate_limit, daily_limit)",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": { "type": "boolean", "example": false },
                "error": { "type": "boolean", "example": true },
                "reason": { "type": "string", "example": "not_found" },
                "message": { "type": "string" },
                "docs": { "type": "string" }
              }
            }
          }
        }
      }
    }
  }
}
