[
  {
    "type": "function",
    "name": "virginproxy_scrape",
    "description": "Fetch one web page through VirginProxy and return its content, by default as Markdown of the main content (navigation, header and footer removed). Use render for pages that build their content with JavaScript. Charged per answer: 1 credit per started MB, +9 with render. Not charged when the target does not answer.",
    "parameters": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Absolute http(s) address."
        },
        "format": {
          "type": "string",
          "enum": [
            "raw",
            "markdown",
            "text",
            "clean_html"
          ],
          "default": "markdown",
          "description": "markdown (default for agents), text, clean_html or raw."
        },
        "main_content": {
          "type": "boolean",
          "default": true,
          "description": "Keep only the main content before converting."
        },
        "render": {
          "type": "boolean",
          "default": false,
          "description": "Load the page in a real browser and wait for its scripts (9 extra credits)."
        },
        "browser": {
          "type": "string",
          "enum": [
            "chrome",
            "chrome_mac",
            "chrome_android",
            "edge",
            "firefox",
            "safari",
            "safari_ios",
            "none"
          ],
          "description": "Which browser the request looks like. Default \"chrome\" (with render: \"chrome_android\")."
        },
        "locale": {
          "type": "string",
          "description": "Visitor language such as \"en-US\" or \"de-DE\" (Accept-Language). Default \"de-DE\"."
        },
        "parse": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "metadata",
              "links",
              "images",
              "headings",
              "emails",
              "phones",
              "tables",
              "json_ld",
              "product",
              "article",
              "organization",
              "breadcrumbs"
            ]
          },
          "description": "Also read out these parts into \"parsed\". product, article, organization and breadcrumbs are standard records read from the page's structured data."
        },
        "cache": {
          "type": "object",
          "properties": {
            "max_age_s": {
              "type": "integer",
              "minimum": 60,
              "maximum": 604800
            }
          },
          "additionalProperties": false,
          "description": "Reuse the answer of the same request within this many seconds: free and at once (\"cached\": true)."
        },
        "track_changes": {
          "type": "object",
          "properties": {
            "on": {
              "type": "string",
              "enum": [
                "body",
                "extracted"
              ]
            },
            "diff": {
              "type": "boolean"
            }
          },
          "additionalProperties": false,
          "description": "Say whether the page changed since the last call with the same options (\"change\": new, same or changed; with diff the lines)."
        },
        "preset": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$",
          "description": "Use the options saved under this preset name (list_presets); arguments given here win."
        },
        "extract": {
          "type": "object",
          "description": "Named fields to read with CSS selectors, e.g. {\"title\": {\"selector\": \"h1\"}, \"price\": {\"selector\": \".price\", \"type\": \"number\"}}.",
          "additionalProperties": true
        },
        "session": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_.:-]{1,64}$",
          "description": "Keep the same IP address and cookies across calls with the same name (up to 10 minutes)."
        },
        "max_credits": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000,
          "description": "Never spend more than this many credits on the call."
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_batch_scrape",
    "description": "Fetch up to 10 pages in one call, in parallel, and get all answers together (Markdown of the main content by default). Each page is charged like scrape; a page that fails does not stop the others. For more pages or more time, use crawl or a job.",
    "parameters": {
      "type": "object",
      "properties": {
        "urls": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "minItems": 1,
          "maxItems": 10,
          "description": "The pages to fetch (your plan allows 3 to 25 per batch)."
        },
        "request": {
          "type": "object",
          "properties": {
            "format": {
              "type": "string",
              "enum": [
                "raw",
                "markdown",
                "text",
                "clean_html"
              ],
              "default": "markdown",
              "description": "markdown (default for agents), text, clean_html or raw."
            },
            "main_content": {
              "type": "boolean",
              "default": true,
              "description": "Keep only the main content before converting."
            },
            "render": {
              "type": "boolean",
              "default": false,
              "description": "Load the page in a real browser and wait for its scripts (9 extra credits)."
            },
            "browser": {
              "type": "string",
              "enum": [
                "chrome",
                "chrome_mac",
                "chrome_android",
                "edge",
                "firefox",
                "safari",
                "safari_ios",
                "none"
              ],
              "description": "Which browser the request looks like. Default \"chrome\" (with render: \"chrome_android\")."
            },
            "locale": {
              "type": "string",
              "description": "Visitor language such as \"en-US\" or \"de-DE\" (Accept-Language). Default \"de-DE\"."
            },
            "parse": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "metadata",
                  "links",
                  "images",
                  "headings",
                  "emails",
                  "phones",
                  "tables",
                  "json_ld",
                  "product",
                  "article",
                  "organization",
                  "breadcrumbs"
                ]
              },
              "description": "Also read out these parts into \"parsed\". product, article, organization and breadcrumbs are standard records read from the page's structured data."
            },
            "cache": {
              "type": "object",
              "properties": {
                "max_age_s": {
                  "type": "integer",
                  "minimum": 60,
                  "maximum": 604800
                }
              },
              "additionalProperties": false,
              "description": "Reuse the answer of the same request within this many seconds: free and at once (\"cached\": true)."
            },
            "track_changes": {
              "type": "object",
              "properties": {
                "on": {
                  "type": "string",
                  "enum": [
                    "body",
                    "extracted"
                  ]
                },
                "diff": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false,
              "description": "Say whether the page changed since the last call with the same options (\"change\": new, same or changed; with diff the lines)."
            },
            "preset": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$",
              "description": "Use the options saved under this preset name (list_presets); arguments given here win."
            },
            "extract": {
              "type": "object",
              "description": "Named fields to read with CSS selectors, e.g. {\"title\": {\"selector\": \"h1\"}, \"price\": {\"selector\": \".price\", \"type\": \"number\"}}.",
              "additionalProperties": true
            },
            "session": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:-]{1,64}$",
              "description": "Keep the same IP address and cookies across calls with the same name (up to 10 minutes)."
            }
          },
          "additionalProperties": false,
          "description": "Options for every page, as for scrape (without url). Default {\"format\": \"markdown\", \"main_content\": true}."
        },
        "max_credits": {
          "type": "integer",
          "minimum": 1,
          "maximum": 25000,
          "description": "Never spend more than this many credits on all pages together."
        }
      },
      "required": [
        "urls"
      ],
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_screenshot",
    "description": "Load a page in a real browser and return a screenshot of the visible area, the full page or one element. Costs like a rendered request: 10 credits for up to 1 MB loaded, more for heavy pages.",
    "parameters": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Absolute http(s) address."
        },
        "full_page": {
          "type": "boolean",
          "default": false,
          "description": "The whole page instead of the visible area (up to 16,000 pixels high)."
        },
        "selector": {
          "type": "string",
          "description": "CSS selector of one element to capture instead."
        },
        "format": {
          "type": "string",
          "enum": [
            "png",
            "jpeg",
            "webp"
          ],
          "default": "png"
        },
        "width": {
          "type": "integer",
          "minimum": 240,
          "maximum": 3840,
          "description": "Viewport width in pixels."
        },
        "height": {
          "type": "integer",
          "minimum": 240,
          "maximum": 4320,
          "description": "Viewport height in pixels."
        },
        "wait_for": {
          "type": "string",
          "description": "CSS selector to wait for before taking the picture."
        },
        "wait_until": {
          "type": "string",
          "enum": [
            "load",
            "domcontentloaded",
            "networkidle"
          ],
          "default": "load"
        },
        "browser": {
          "type": "string",
          "enum": [
            "chrome",
            "chrome_mac",
            "chrome_android",
            "edge",
            "firefox",
            "safari",
            "safari_ios",
            "none"
          ],
          "description": "Which browser the request looks like. Default \"chrome\" (with render: \"chrome_android\")."
        },
        "locale": {
          "type": "string",
          "description": "Visitor language such as \"en-US\" or \"de-DE\" (Accept-Language). Default \"de-DE\"."
        },
        "max_credits": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000,
          "description": "Never spend more than this many credits on the call."
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_pdf",
    "description": "Load a page in a real browser and print it as a PDF (returned as an embedded document). Costs like a rendered request: 10 credits for up to 1 MB loaded.",
    "parameters": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Absolute http(s) address."
        },
        "wait_for": {
          "type": "string",
          "description": "CSS selector to wait for before printing."
        },
        "wait_until": {
          "type": "string",
          "enum": [
            "load",
            "domcontentloaded",
            "networkidle"
          ],
          "default": "load"
        },
        "color_scheme": {
          "type": "string",
          "enum": [
            "light",
            "dark"
          ]
        },
        "browser": {
          "type": "string",
          "enum": [
            "chrome",
            "chrome_mac",
            "chrome_android",
            "edge",
            "firefox",
            "safari",
            "safari_ios",
            "none"
          ],
          "description": "Which browser the request looks like. Default \"chrome\" (with render: \"chrome_android\")."
        },
        "locale": {
          "type": "string",
          "description": "Visitor language such as \"en-US\" or \"de-DE\" (Accept-Language). Default \"de-DE\"."
        },
        "max_credits": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000,
          "description": "Never spend more than this many credits on the call."
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_search",
    "description": "Search DuckDuckGo and get the results as JSON (title, address, snippet, plus ads, related searches and questions where the engine shows them). With scrape, each result page is fetched too (for example as Markdown of its main content). Each result page of the engine and each fetched result is one ordinary request (usually 1 credit each).",
    "parameters": {
      "type": "object",
      "properties": {
        "query": {
          "type": "string",
          "minLength": 1,
          "maxLength": 400,
          "description": "What to search for. Engine operators such as quotes or site: work."
        },
        "engine": {
          "type": "string",
          "enum": [
            "duckduckgo"
          ],
          "default": "duckduckgo",
          "description": "duckduckgo: 1 credit per result page."
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "default": 10,
          "description": "How many results."
        },
        "language": {
          "type": "string",
          "default": "en",
          "description": "Language of the results, e.g. \"en\" or \"de\"."
        },
        "country": {
          "type": "string",
          "description": "Country the results are for, two letters, e.g. \"us\"."
        },
        "time_range": {
          "type": "string",
          "enum": [
            "day",
            "week",
            "month",
            "year"
          ],
          "description": "Only results from this period."
        },
        "include_domains": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 20,
          "description": "Only results from these domains."
        },
        "exclude_domains": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 20,
          "description": "No results from these domains."
        },
        "scrape": {
          "description": "true: also fetch each result as Markdown of its main content. Or an object with the options of scrape (without url), e.g. {\"format\": \"text\"}.",
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "object",
              "additionalProperties": true
            }
          ]
        },
        "max_credits": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10000,
          "description": "Cost cap for the whole search, fetched results included."
        }
      },
      "required": [
        "query"
      ],
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_map",
    "description": "Find the addresses of a website: the links on the given page plus the entries of its sitemaps (robots.txt, sitemap.xml). Returns same-site addresses only. Each page and sitemap file read is one ordinary request (usually 1 credit each; at most 1 page, robots.txt and 5 sitemap files).",
    "parameters": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Absolute http(s) address."
        },
        "search": {
          "type": "string",
          "maxLength": 200,
          "description": "Keep only addresses (or link texts) that contain this text."
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5000,
          "default": 1000,
          "description": "How many addresses to return at most."
        },
        "sitemap": {
          "type": "string",
          "enum": [
            "include",
            "skip",
            "only"
          ],
          "default": "include",
          "description": "Also read the sitemaps, skip them, or read only them."
        },
        "include_subdomains": {
          "type": "boolean",
          "default": false
        },
        "max_credits": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000,
          "description": "Never spend more than this many credits on the call."
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_crawl",
    "description": "Start a crawl in the background: it reads the start page, follows the links of the same site up to max_depth, and stops at max_pages. Returns a job id at once; fetch progress and pages with get_job. Each page is one ordinary request.",
    "parameters": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Absolute http(s) address."
        },
        "max_pages": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000,
          "description": "Pages at most (your plan allows 10, 100, 500 or 1,000). Default 100 or the plan limit."
        },
        "max_depth": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10,
          "default": 2,
          "description": "How many links away from the start page."
        },
        "include_paths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 20,
          "description": "Only follow paths that match one of these patterns, e.g. \"/blog/**\"."
        },
        "exclude_paths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 20,
          "description": "Never follow paths that match one of these patterns."
        },
        "request": {
          "type": "object",
          "description": "Options for every page, as for scrape, e.g. {\"format\": \"markdown\", \"main_content\": true}.",
          "additionalProperties": true
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_export_job",
    "description": "The results of a job or crawl as NDJSON (one line per page) or CSV, without page bodies unless include_body is true. Long exports are cut at 1 MB; download the whole file from the API.",
    "parameters": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^job_[A-Za-z0-9]{20}$",
          "description": "The job id, e.g. \"job_…\"."
        },
        "format": {
          "type": "string",
          "enum": [
            "ndjson",
            "csv"
          ],
          "default": "ndjson"
        },
        "status": {
          "type": "string",
          "enum": [
            "succeeded",
            "failed"
          ],
          "description": "Only these results."
        },
        "include_body": {
          "type": "boolean",
          "default": false,
          "description": "Also the page bodies (large)."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_retry_job",
    "description": "Starts a new job with the requests of a finished job that failed, exactly as they were sent. Charged like any job.",
    "parameters": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^job_[A-Za-z0-9]{20}$",
          "description": "The finished job."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_get_job",
    "description": "Status of a job or crawl and the pages it has finished, 20 at a time (use offset to page through).",
    "parameters": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^job_[A-Za-z0-9]{20}$",
          "description": "The job id, e.g. \"job_…\"."
        },
        "offset": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_list_jobs",
    "description": "Your recent jobs and crawls, newest first, with their status and counts.",
    "parameters": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 20
        },
        "before": {
          "type": "string",
          "pattern": "^job_[A-Za-z0-9]{20}$",
          "description": "Continue after this job id (\"next\" of the previous answer)."
        }
      },
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_cancel_job",
    "description": "Cancel a job or crawl: pages that have not started are dropped and not charged; pages already running finish. Results so far stay available.",
    "parameters": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^job_[A-Za-z0-9]{20}$",
          "description": "The job id, e.g. \"job_…\"."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_estimate",
    "description": "The least and the most credits a scrape with these arguments can cost with your plan, and whether it fits into the credits left. Runs nothing and charges nothing.",
    "parameters": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Absolute http(s) address."
        },
        "format": {
          "type": "string",
          "enum": [
            "raw",
            "markdown",
            "text",
            "clean_html"
          ],
          "default": "markdown",
          "description": "markdown (default for agents), text, clean_html or raw."
        },
        "main_content": {
          "type": "boolean",
          "default": true,
          "description": "Keep only the main content before converting."
        },
        "render": {
          "type": "boolean",
          "default": false,
          "description": "Load the page in a real browser and wait for its scripts (9 extra credits)."
        },
        "browser": {
          "type": "string",
          "enum": [
            "chrome",
            "chrome_mac",
            "chrome_android",
            "edge",
            "firefox",
            "safari",
            "safari_ios",
            "none"
          ],
          "description": "Which browser the request looks like. Default \"chrome\" (with render: \"chrome_android\")."
        },
        "locale": {
          "type": "string",
          "description": "Visitor language such as \"en-US\" or \"de-DE\" (Accept-Language). Default \"de-DE\"."
        },
        "parse": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "metadata",
              "links",
              "images",
              "headings",
              "emails",
              "phones",
              "tables",
              "json_ld",
              "product",
              "article",
              "organization",
              "breadcrumbs"
            ]
          },
          "description": "Also read out these parts into \"parsed\". product, article, organization and breadcrumbs are standard records read from the page's structured data."
        },
        "cache": {
          "type": "object",
          "properties": {
            "max_age_s": {
              "type": "integer",
              "minimum": 60,
              "maximum": 604800
            }
          },
          "additionalProperties": false,
          "description": "Reuse the answer of the same request within this many seconds: free and at once (\"cached\": true)."
        },
        "track_changes": {
          "type": "object",
          "properties": {
            "on": {
              "type": "string",
              "enum": [
                "body",
                "extracted"
              ]
            },
            "diff": {
              "type": "boolean"
            }
          },
          "additionalProperties": false,
          "description": "Say whether the page changed since the last call with the same options (\"change\": new, same or changed; with diff the lines)."
        },
        "preset": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$",
          "description": "Use the options saved under this preset name (list_presets); arguments given here win."
        },
        "extract": {
          "type": "object",
          "description": "Named fields to read with CSS selectors, e.g. {\"title\": {\"selector\": \"h1\"}, \"price\": {\"selector\": \".price\", \"type\": \"number\"}}.",
          "additionalProperties": true
        },
        "session": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_.:-]{1,64}$",
          "description": "Keep the same IP address and cookies across calls with the same name (up to 10 minutes)."
        },
        "max_credits": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000,
          "description": "Never spend more than this many credits on the call."
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_account",
    "description": "The account's plan, credits left in the current period and its limits.",
    "parameters": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_usage",
    "description": "Requests, successful requests, credits and data per day (UTC) for the last days.",
    "parameters": {
      "type": "object",
      "properties": {
        "days": {
          "type": "integer",
          "minimum": 1,
          "maximum": 90,
          "default": 30,
          "description": "Days back, today included."
        },
        "tag": {
          "type": "string",
          "maxLength": 64,
          "description": "Only requests with this tag."
        }
      },
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_list_requests",
    "description": "Your request log, newest first: target, status, error code, credits (not the content). Filter by result, period or tag.",
    "parameters": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 50
        },
        "result": {
          "type": "string",
          "enum": [
            "ok",
            "http_error",
            "failed"
          ],
          "description": "Only answers below 400, only 400 and above, or only requests without an answer."
        },
        "since": {
          "type": "string",
          "enum": [
            "24h",
            "7d",
            "30d",
            "90d"
          ]
        },
        "tag": {
          "type": "string",
          "maxLength": 64
        },
        "before": {
          "type": "string",
          "description": "Continue after this request id (\"next\" of the previous answer)."
        }
      },
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_limits",
    "description": "Parallel requests and rate of the plan with their current use, the daily credit cap and the key's limits. Call before a big batch to pace yourself.",
    "parameters": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_get_answer",
    "description": "The answer itself (body, extracted data …) of an earlier request, when it is kept: sent with an Idempotency-Key (24 hours) or cached. Free; nothing runs again.",
    "parameters": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^req_[A-Za-z0-9]{20}$",
          "description": "The request id, e.g. \"req_…\"."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_list_presets",
    "description": "The account's presets: named request options to use with the \"preset\" argument of scrape.",
    "parameters": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    }
  },
  {
    "type": "function",
    "name": "virginproxy_get_request",
    "description": "The figures of one of your requests by its id (req_…): target, status, error, credits, timing.",
    "parameters": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^req_[A-Za-z0-9]{20}$",
          "description": "The request id, e.g. \"req_…\"."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false
    }
  }
]
