{
  "openapi": "3.0.3",
  "info": {
    "title": "URL Metadata & Open Graph Tags API",
    "version": "1.0.0",
    "description": "Extract Open Graph tags, Twitter Card metadata, title, description, favicon URL, canonical URL, and more from any web page in one call. Supports batch extraction of up to 5 URLs and a screenshot-preview helper that generates a thumbnail URL via the Screenshot API. Results are cached for 10 minutes.\n",
    "contact": {
      "name": "URL Metadata API Support",
      "email": "api@hiroapp.cc"
    }
  },
  "servers": [
    {
      "url": "https://api.sprytools.com/v1/meta",
      "description": "Production (SpryTools API Gateway)"
    }
  ],
  "tags": [
    {
      "name": "Metadata",
      "description": "Extract page metadata and OG tags"
    },
    {
      "name": "Preview",
      "description": "Screenshot preview helper"
    }
  ],
  "security": [
    {
      "ApiKeyHeader": []
    },
    {
      "RapidApiProxy": []
    }
  ],
  "paths": {
    "/api/v1/meta": {
      "get": {
        "operationId": "getUrlMeta",
        "summary": "Extract metadata from a URL",
        "description": "Fetch a web page and extract Open Graph tags (og:title, og:description, og:image, og:url), Twitter Card tags, canonical URL, favicon, and page title/description. Results are cached for 10 minutes.\n",
        "tags": [
          "Metadata"
        ],
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "Web page URL to extract metadata from",
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "example": "https://example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Page metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetaResult"
                },
                "example": {
                  "url": "https://example.com",
                  "title": "Example Domain",
                  "description": "This domain is for use in illustrative examples.",
                  "og": {
                    "title": "Example Domain",
                    "description": "Illustrative example",
                    "image": null,
                    "url": "https://example.com",
                    "type": "website"
                  },
                  "twitter": {
                    "card": null,
                    "title": null,
                    "description": null,
                    "image": null
                  },
                  "favicon": "https://example.com/favicon.ico",
                  "canonical": "https://example.com"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/meta/batch": {
      "post": {
        "operationId": "getUrlMetaBatch",
        "summary": "Extract metadata from multiple URLs",
        "description": "Batch extract metadata from up to 5 URLs. Each URL is fetched concurrently.",
        "tags": [
          "Metadata"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "urls"
                ],
                "properties": {
                  "urls": {
                    "type": "array",
                    "description": "URLs to extract metadata from (max 5)",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    },
                    "minItems": 1,
                    "maxItems": 5
                  }
                }
              },
              "example": {
                "urls": [
                  "https://example.com",
                  "https://github.com"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Batch metadata results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchMetaResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/screenshot-preview": {
      "get": {
        "operationId": "getScreenshotPreview",
        "summary": "Get thumbnail URL for a web page",
        "description": "Returns a pre-built screenshot URL pointing to the Screenshot API that will render the page at 1200×630 (OG image dimensions) in JPEG format. Does not take the screenshot itself — use the returned URL to trigger capture on demand.\n",
        "tags": [
          "Preview"
        ],
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "Web page URL to preview",
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "example": "https://example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Screenshot thumbnail URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenshotPreviewResult"
                },
                "example": {
                  "url": "https://example.com",
                  "thumbnail_url": "https://publisher.hiroapp.cc/screenshot-api/api/v1/screenshot?url=https%3A%2F%2Fexample.com&format=jpeg&width=1200&height=630"
                }
              }
            }
          },
          "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": {
      "OgTags": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "image": {
            "type": "string",
            "format": "uri",
            "nullable": true
          },
          "url": {
            "type": "string",
            "format": "uri",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "TwitterTags": {
        "type": "object",
        "properties": {
          "card": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "image": {
            "type": "string",
            "format": "uri",
            "nullable": true
          }
        }
      },
      "MetaResult": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "og": {
            "$ref": "#/components/schemas/OgTags"
          },
          "twitter": {
            "$ref": "#/components/schemas/TwitterTags"
          },
          "favicon": {
            "type": "string",
            "format": "uri",
            "nullable": true
          },
          "canonical": {
            "type": "string",
            "format": "uri",
            "nullable": true
          }
        }
      },
      "BatchMetaResultItem": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "error"
            ]
          },
          "data": {
            "$ref": "#/components/schemas/MetaResult"
          },
          "error": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "BatchMetaResult": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BatchMetaResultItem"
            }
          }
        }
      },
      "ScreenshotPreviewResult": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "thumbnail_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Bad request — missing or invalid parameters",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Query param 'url' required"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "API key missing",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "API key required"
            }
          }
        }
      },
      "UnprocessableEntity": {
        "description": "URL could not be fetched",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Failed to fetch URL: connection refused"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limit exceeded (100 requests per minute)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Rate limit exceeded"
            }
          }
        }
      }
    }
  }
}