{
  "openapi": "3.0.3",
  "info": {
    "title": "FaceSeek API",
    "description": "Reverse face search, AI/deepfake detection, and Data Check personal-data exposure reports over a simple authenticated REST API. Authenticate with an X-API-Key header (fsk_...). One prepaid API Token balance covers all three products: a face search costs 10 API Tokens, a Data Check report costs 10, an AI/deepfake check costs 1. Face search is synchronous (up to ~5 minutes; set a 300s client timeout); Data Check is asynchronous (create returns a jobId, then poll). Failed or empty-result calls are not charged.",
    "version": "1.1.0",
    "contact": {
      "name": "FaceSeek",
      "url": "https://www.faceseek.online/api-docs",
      "email": "contact@faceseek.online"
    }
  },
  "servers": [
    {
      "url": "https://api.faceseek.online",
      "description": "Production"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/v1/api/search": {
      "post": {
        "summary": "Premium reverse face search",
        "description": "Upload an image; returns premium, deduplicated matches across all enabled sources. Costs 10 API Tokens; a failed search is not charged. Synchronous \u2014 set a 300s timeout. Not idempotent: on a network timeout, check /v1/api/account before retrying.",
        "operationId": "searchFace",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The query face image (JPEG/PNG/WebP)."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Matches found (or an empty list).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 200
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SearchResult"
                      }
                    },
                    "api_tokens_remaining": {
                      "type": "integer",
                      "example": 1480
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/InsufficientCredits"
          },
          "502": {
            "$ref": "#/components/responses/BackendUnavailable"
          }
        }
      }
    },
    "/v1/api/detect-ai": {
      "post": {
        "summary": "AI-generated / deepfake detection",
        "description": "Upload an image; returns AI-generation and deepfake likelihoods. Costs 1 API Token (same balance as face search); a failed check is not charged. Deterministic per image.",
        "operationId": "detectAi",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The image to analyze."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Analysis complete.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DetectResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/InsufficientCredits"
          },
          "502": {
            "$ref": "#/components/responses/BackendUnavailable"
          }
        }
      }
    },
    "/v1/api/datacheck": {
      "post": {
        "summary": "Start a Data Check report",
        "description": "Submit a person to scan 200+ people-search sites and data brokers. Costs 10 API Tokens, charged on create and refunded if the report fails or finds no exposures. Asynchronous: returns a jobId immediately; poll GET /v1/api/datacheck/{jobId} until the status is terminal.",
        "operationId": "startDataCheck",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "firstName": { "type": "string" },
                  "lastName": { "type": "string" },
                  "state": { "type": "string", "description": "2-letter US state; sharpens the match." },
                  "city": { "type": "string" },
                  "email": { "type": "string" },
                  "phone": { "type": "string" }
                },
                "required": [ "firstName", "lastName" ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Report queued.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jobId": { "type": "string", "example": "dc_9f2a" },
                    "status": { "type": "string", "example": "queued" },
                    "api_tokens_remaining": { "type": "integer", "example": 1470 }
                  }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "402": { "$ref": "#/components/responses/InsufficientCredits" },
          "404": { "$ref": "#/components/responses/FeatureDisabled" },
          "502": { "$ref": "#/components/responses/BackendUnavailable" }
        }
      }
    },
    "/v1/api/datacheck/{jobId}": {
      "get": {
        "summary": "Poll a Data Check report",
        "description": "Poll a report by its jobId (owner-scoped to the calling key). Non-terminal statuses mean keep polling; terminal success is 'done' or 'completed_with_errors', terminal failure is 'failed' or 'cancelled'. The report body is under result.scan. A terminal failure or empty (0-exposure) report refunds the 10 tokens exactly once.",
        "operationId": "getDataCheck",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": { "type": "string" },
            "description": "The jobId returned by POST /v1/api/datacheck."
          }
        ],
        "responses": {
          "200": {
            "description": "Current job state (served from cache once terminal).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataCheckReport"
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/FeatureDisabled" }
        }
      }
    },
    "/v1/api/account": {
      "get": {
        "summary": "Account & balances",
        "description": "Return the calling key's email and remaining balance of both products.",
        "operationId": "getAccount",
        "responses": {
          "200": {
            "description": "Account info.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "email": {
                      "type": "string",
                      "example": "you@company.com"
                    },
                    "api_tokens_remaining": {
                      "type": "integer",
                      "example": 1489
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Your API key (fsk_...), provisioned per client."
      }
    },
    "schemas": {
      "SearchResult": {
        "type": "object",
        "properties": {
          "image_url": {
            "type": "string",
            "description": "Thumbnail/preview (http(s) or data: URL)."
          },
          "source_url": {
            "type": "string",
            "description": "Page where the face was found."
          },
          "domain": {
            "type": "string",
            "nullable": true,
            "description": "Source domain."
          },
          "score": {
            "type": "number",
            "format": "float",
            "description": "Match confidence 0-100 (results are ordered by this, highest first).",
            "example": 94.2
          }
        }
      },
      "DetectResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 200
          },
          "label": {
            "type": "string",
            "enum": [
              "authentic",
              "ai",
              "deepfake",
              "uncertain"
            ],
            "example": "deepfake"
          },
          "verdict": {
            "type": "string",
            "example": "Likely a deepfake or face-swap"
          },
          "ai_generated": {
            "type": "number",
            "format": "float",
            "example": 0.0123
          },
          "deepfake": {
            "type": "number",
            "format": "float",
            "example": 0.8742
          },
          "confidence": {
            "type": "number",
            "format": "float",
            "example": 0.8742
          },
          "top_generator": {
            "type": "string",
            "nullable": true
          },
          "top_generator_score": {
            "type": "number",
            "format": "float",
            "example": 0.0
          },
          "api_tokens_remaining": {
            "type": "integer",
            "example": 1489
          }
        }
      },
      "DataCheckReport": {
        "type": "object",
        "properties": {
          "jobId": { "type": "string", "example": "dc_9f2a" },
          "status": {
            "type": "string",
            "enum": [ "queued", "pending", "running", "done", "completed_with_errors", "failed", "cancelled" ],
            "example": "done"
          },
          "result": {
            "type": "object",
            "description": "Present once terminal. The report body is nested under 'scan'.",
            "properties": {
              "scan": {
                "type": "object",
                "properties": {
                  "riskLevel": { "type": "string", "example": "high" },
                  "exposedCount": { "type": "integer", "example": 37 },
                  "exposures": {
                    "type": "array",
                    "items": { "$ref": "#/components/schemas/DataCheckExposure" }
                  }
                }
              }
            }
          },
          "api_tokens_remaining": { "type": "integer", "example": 1470 }
        }
      },
      "DataCheckExposure": {
        "type": "object",
        "properties": {
          "site": { "type": "string", "example": "Spokeo" },
          "matchStrength": { "type": "string", "example": "moderate" },
          "dataTypes": {
            "type": "array",
            "items": { "type": "string" },
            "example": [ "name", "address", "phone" ]
          },
          "removable": { "type": "boolean", "description": "false for weak, name-only matches." },
          "removalUrl": {
            "type": "string",
            "nullable": true,
            "description": "The broker's opt-out page. Absent on weak matches. A broker needs the subject's date of birth to process the opt-out.",
            "example": "https://www.spokeo.com/optout"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "detail": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing or invalid X-API-Key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InsufficientCredits": {
        "description": "Not enough credits for this product.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The job belongs to a different API key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "FeatureDisabled": {
        "description": "Data Check is not enabled for this deployment.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "BackendUnavailable": {
        "description": "Search/detector backend temporarily unavailable (the call was refunded).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}