{
    "openapi": "3.1.0",
    "info": {
        "title": "HQAPI",
        "description": "High quality APIs for developers, starting with a screenshot API. Sign up for free at https://hqapi.com/register.",
        "version": "1",
        "termsOfService": "https://hqapi.com/terms-and-conditions",
        "contact": {
            "url": "https://hqapi.com/contact"
        }
    },
    "servers": [
        {
            "url": "https://api.eu-west.hqapi.com"
        }
    ],
    "tags": [
        {
            "name": "Example",
            "description": "This is the example web service."
        },
        {
            "name": "Screenshot",
            "description": "Screenshot generator for websites."
        }
    ],
    "paths": {
        "/api/v1/{token}/example/add": {
            "post": {
                "tags": [
                    "Example"
                ],
                "operationId": "example_add",
                "summary": "add",
                "description": "A POST endpoint that accepts two integers and returns their sum.",
                "externalDocs": {
                    "url": "https://hqapi.com/api/example/add"
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "description": "Your API token (free account at https://hqapi.com/register). It is part of the URL.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The result.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "A parameter is missing or not valid.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The token is unknown or not valid for this service.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many concurrent calls for this token: try again.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "Bad gateway: try again in a minute.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "a": {
                                        "type": "integer",
                                        "description": "The first integer to be added."
                                    },
                                    "b": {
                                        "type": "integer",
                                        "description": "The second integer to be added."
                                    }
                                },
                                "required": [
                                    "a",
                                    "b"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/{token}/example/nop": {
            "get": {
                "tags": [
                    "Example"
                ],
                "operationId": "example_nop",
                "summary": "nop",
                "description": "A sample GET endpoint that performs no action and returns an empty response.",
                "externalDocs": {
                    "url": "https://hqapi.com/api/example/nop"
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "description": "Your API token (free account at https://hqapi.com/register). It is part of the URL.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The result.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "A parameter is missing or not valid.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The token is unknown or not valid for this service.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many concurrent calls for this token: try again.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "Bad gateway: try again in a minute.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/{token}/example/ping": {
            "post": {
                "tags": [
                    "Example"
                ],
                "operationId": "example_ping",
                "summary": "ping",
                "description": "A POST endpoint that echoes back the provided value in the response.",
                "externalDocs": {
                    "url": "https://hqapi.com/api/example/ping"
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "description": "Your API token (free account at https://hqapi.com/register). It is part of the URL.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The result.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "A parameter is missing or not valid.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The token is unknown or not valid for this service.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many concurrent calls for this token: try again.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "Bad gateway: try again in a minute.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "value": {
                                        "type": "string",
                                        "description": "The string value to be echoed back by the endpoint."
                                    }
                                },
                                "required": [
                                    "value"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/{token}/screenshot/create": {
            "post": {
                "tags": [
                    "Screenshot"
                ],
                "operationId": "screenshot_create",
                "summary": "create",
                "description": "Captures a screenshot or thumbnail image of a specified website URL.",
                "externalDocs": {
                    "url": "https://hqapi.com/api/screenshot/create"
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "description": "Your API token (free account at https://hqapi.com/register). It is part of the URL.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The result.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            },
                            "image/png": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/jpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "application/pdf": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "A parameter is missing or not valid.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The token is unknown or not valid for this service.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many concurrent calls for this token: try again.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "Bad gateway: try again in a minute.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "description": "The website URL to capture. Supported schemes: http and https."
                                    },
                                    "theme": {
                                        "type": "string",
                                        "description": "The browser theme to use.",
                                        "default": "light",
                                        "enum": [
                                            "light",
                                            "dark"
                                        ]
                                    },
                                    "browser_width": {
                                        "type": "integer",
                                        "description": "Width of the virtual browser viewport in pixels.",
                                        "default": 1600,
                                        "minimum": 600,
                                        "maximum": 1920
                                    },
                                    "browser_height": {
                                        "type": "integer",
                                        "description": "Height of the virtual browser viewport in pixels.",
                                        "default": 900,
                                        "minimum": 400,
                                        "maximum": 8000
                                    },
                                    "delay": {
                                        "type": "integer",
                                        "description": "Milliseconds to wait after page load before capturing the screenshot. Allows all resources and scripts to finish loading. Minimum 3000 ms if hide_cookie_popups is true.",
                                        "default": 2500,
                                        "minimum": 0,
                                        "maximum": 5000
                                    },
                                    "format": {
                                        "type": "string",
                                        "description": "The desired output of the image.",
                                        "default": "png",
                                        "enum": [
                                            "jpeg",
                                            "png",
                                            "pdf"
                                        ]
                                    },
                                    "jpeg_quality": {
                                        "type": "integer",
                                        "description": "JPEG quality (1-100) for the output image. Used only if format=jpeg.",
                                        "default": 95,
                                        "minimum": 1,
                                        "maximum": 100
                                    },
                                    "image_width": {
                                        "type": "integer",
                                        "description": "Width in pixels to resize the image before sending. If only one dimension is provided, the other is auto-calculated to preserve aspect ratio.",
                                        "minimum": 32,
                                        "maximum": 1920
                                    },
                                    "image_height": {
                                        "type": "integer",
                                        "description": "Height in pixels to resize the image before sending. If only one dimension is provided, the other is auto-calculated to preserve aspect ratio.",
                                        "minimum": 32,
                                        "maximum": 8000
                                    },
                                    "mobile": {
                                        "type": "boolean",
                                        "description": "If true, renders the screenshot with a mobile browser user agent and viewport settings.",
                                        "default": false,
                                        "enum": [
                                            "false",
                                            "true"
                                        ]
                                    },
                                    "hide_cookie_popups": {
                                        "type": "boolean",
                                        "description": "If true, attempts to hide cookie popups on the page. Best used with a delay of 3000 ms or higher.",
                                        "default": false,
                                        "enum": [
                                            "false",
                                            "true"
                                        ]
                                    },
                                    "full_page": {
                                        "type": "boolean",
                                        "description": "If true, captures a screenshot of the entire page (up to 8000px height).",
                                        "default": false,
                                        "enum": [
                                            "false",
                                            "true"
                                        ]
                                    }
                                },
                                "required": [
                                    "url"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/{token}/screenshot/nop": {
            "get": {
                "tags": [
                    "Screenshot"
                ],
                "operationId": "screenshot_nop",
                "summary": "nop",
                "description": "A sample GET endpoint that performs no action and returns an empty response.",
                "externalDocs": {
                    "url": "https://hqapi.com/api/screenshot/nop"
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "description": "Your API token (free account at https://hqapi.com/register). It is part of the URL.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The result.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "A parameter is missing or not valid.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The token is unknown or not valid for this service.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many concurrent calls for this token: try again.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "Bad gateway: try again in a minute.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "integer"
                    },
                    "message": {
                        "type": "string"
                    }
                }
            }
        }
    }
}