{
  "openapi": "3.1.0",
  "info": {
    "title": "Snoffle API",
    "version": "0.2.0",
    "description": "Would people and AI assistants find this product, and would a buyer's agent buy it? Paid: answers 402 with a USDC-on-Base quote and a PayPal link until a key is sent."
  },
  "servers": [
    {
      "url": "https://snoffle.broke2builtai.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "key": {
        "type": "apiKey",
        "in": "header",
        "name": "x-snoffle-key"
      }
    }
  },
  "paths": {
    "/api/status": {
      "get": {
        "summary": "Service status and prices",
        "responses": {
          "200": {
            "description": "Status JSON"
          }
        }
      }
    },
    "/api/check": {
      "get": {
        "summary": "Check a product page",
        "security": [
          {
            "key": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Product URL; a bare host is fine."
          },
          {
            "name": "deep",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "0",
                "1"
              ]
            },
            "description": "Run the buyer's-agent verdict and live web searches (about 60–90 s)."
          },
          {
            "name": "x-snoffle-quote",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "The pay.usdc.quote you paid."
          },
          {
            "name": "x-snoffle-tx",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "The Base transaction hash of that payment."
          }
        ],
        "responses": {
          "200": {
            "description": "Report JSON; access.key and access.reportsLeft when a paid key was used"
          },
          "400": {
            "description": "Bad URL"
          },
          "402": {
            "description": "Payment Required. Body has `pay.usdc` (one report) and `pay.usdcScorecard` (report + 5 re-checks), each with amount, to, token, chainId 8453, quote, expiresInSeconds; and `pay.paypal.url` / `pay.paypal.single`. Pay the USDC quote and repeat the request with x-snoffle-quote and x-snoffle-tx, or have a human pay by PayPal and send the key they get."
          },
          "409": {
            "description": "Payment seen but not yet confirmed; retry in a few seconds"
          },
          "422": {
            "description": "Page could not be read"
          }
        }
      },
      "post": {
        "summary": "Check a product page (JSON body)",
        "security": [
          {
            "key": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "deep": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Report JSON"
          },
          "402": {
            "description": "Payment Required. Body has `pay.usdc` (one report) and `pay.usdcScorecard` (report + 5 re-checks), each with amount, to, token, chainId 8453, quote, expiresInSeconds; and `pay.paypal.url` / `pay.paypal.single`. Pay the USDC quote and repeat the request with x-snoffle-quote and x-snoffle-tx, or have a human pay by PayPal and send the key they get."
          }
        }
      }
    }
  }
}