{
  "openapi": "3.1.0",
  "info": {
    "title": "LinkVet",
    "version": "1.0.0",
    "description": "Verify a URL before citing it: live/404/blocked status, final URL after redirects, title, price, dates, safe_to_cite. Free tier is 100 fresh checks/day/IP. Paid tier (x402/L402) is coming soon.",
    "x-logo": {
      "url": "https://linkvet.pages.dev/favicon.svg"
    }
  },
  "servers": [
    {
      "url": "https://linkvet.pages.dev"
    }
  ],
  "paths": {
    "/api/check": {
      "get": {
        "operationId": "checkUrl",
        "summary": "Check one URL",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "http(s) URL to verify"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          },
          "402": {
            "description": "Payment required (x402/L402), only when the paid tier is enabled"
          },
          "429": {
            "description": "Free daily limit reached"
          }
        }
      },
      "post": {
        "operationId": "checkUrls",
        "summary": "Check one or many URLs (max 25)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "urls": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 25
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One Result for {url}; {count, results[]} for {urls}",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Result"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer"
                        },
                        "results": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Result"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment required"
          },
          "429": {
            "description": "Free daily limit reached"
          }
        }
      }
    },
    "/api/pricing": {
      "get": {
        "operationId": "pricing",
        "summary": "Current pricing and limits",
        "responses": {
          "200": {
            "description": "Pricing"
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "health",
        "summary": "Health check",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Result": {
        "type": "object",
        "properties": {
          "input": {
            "type": "string"
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "live",
              "404",
              "blocked",
              "timeout",
              "error",
              "invalid",
              "blocked_ssrf"
            ]
          },
          "http_status": {
            "type": [
              "integer",
              "null"
            ]
          },
          "final_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "redirected": {
            "type": "boolean"
          },
          "redirect_chain": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string"
                },
                "http_status": {
                  "type": "integer"
                }
              }
            }
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "site_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "canonical": {
            "type": [
              "string",
              "null"
            ]
          },
          "price": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "amount": {
                "type": "string"
              },
              "currency": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "source": {
                "type": "string"
              }
            }
          },
          "published": {
            "type": [
              "string",
              "null"
            ]
          },
          "modified": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_modified_header": {
            "type": [
              "string",
              "null"
            ]
          },
          "content_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "safe_to_cite": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "elapsed_ms": {
            "type": "integer"
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          },
          "cache_expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "cached": {
            "type": "boolean"
          }
        }
      }
    }
  }
}