{ "opencollection": "1.0.0", "info": { "name": "WebScraping. AI API", "version": "3.2.1" }, "request": { "auth": { "type": "apikey", "key": "api_key", "value": "{{api_key}}", "placement": "query" } }, "items": [ { "info": { "name": "AI", "type": "folder" }, "items": [ { "info": { "name": "Get an answer to a question about a given web page", "type": "http" }, "http": { "method": "GET", "url": "https://api.webscraping.ai/ai/question", "params": [ { "name": "url", "value": "https://example.com", "type": "query", "description": "URL of the target page." }, { "name": "question", "value": "What is the summary of this page content?", "type": "query", "description": "Question or instructions to ask the LLM model about the target page." }, { "name": "headers", "value": "{\"Cookie\":\"session=some_id\"}", "type": "query", "description": "HTTP headers to pass to the target page. Can be specified either via a nested query parameter (...&headers[One]=value1&headers=[Another]=value2) or as a JSON encoded object (...&headers={\"One\": \"value1\", \"Another\": \"value2\"})." }, { "name": "timeout", "value": "10000", "type": "query", "description": "Maximum web page retrieval time in ms. Increase it in case of timeout errors (10000 by default, maximum is 30000)." }, { "name": "js", "value": "true", "type": "query", "description": "Execute on-page JavaScript using a headless browser (true by default)." }, { "name": "js_timeout", "value": "2000", "type": "query", "description": "Maximum JavaScript rendering time in ms. Increase it in case if you see a loading indicator instead of data on the target page." }, { "name": "wait_for", "value": "", "type": "query", "description": "CSS selector to wait for before returning the page content. Useful for pages with dynamic content loading. Overrides js_timeout. If the element doesn't appear within the request timeout, the request fails with a 500 error naming the selector and including the target page's HTTP status code and a preview of the page body." }, { "name": "proxy", "value": "datacenter", "type": "query", "description": "Type of proxy. Use `residential` if your site restricts traffic from datacenters, or `stealth` for the most heavily protected sites with advanced anti-bot detection (`datacenter` by default). Residential and stealth proxy requests are more expensive than datacenter, see the pricing page for details." }, { "name": "country", "value": "us", "type": "query", "description": "Country of the proxy to use (US by default)." }, { "name": "custom_proxy", "value": "null", "type": "query", "description": "Your own proxy URL to use instead of our built-in proxy pool in \"http://user:password@host:port\" format (Smartproxy for example)." }, { "name": "device", "value": "desktop", "type": "query", "description": "Type of device emulation." }, { "name": "error_on_404", "value": "false", "type": "query", "description": "Return error on 404 HTTP status on the target page (false by default)." }, { "name": "error_on_redirect", "value": "false", "type": "query", "description": "Return error on redirect on the target page (false by default)." }, { "name": "js_script", "value": "document.querySelector('button').click();", "type": "query", "description": "Custom JavaScript code to execute on the target page." }, { "name": "format", "value": "json", "type": "query", "description": "Format of the response (text by default). \"json\" will return a JSON object with the response, \"text\" will return a plain text/HTML response." } ] }, "docs": "Returns the answer in plain text. Proxies and Chromium JavaScript rendering are used for page retrieval and processing, then the answer is extracted using an LLM model." }, { "info": { "name": "Extract structured data fields from a web page", "type": "http" }, "http": { "method": "GET", "url": "https://api.webscraping.ai/ai/fields", "params": [ { "name": "url", "value": "https://example.com", "type": "query", "description": "URL of the target page." }, { "name": "fields", "value": "[object Object]", "type": "query", "description": "Object describing fields to extract from the page and their descriptions" }, { "name": "headers", "value": "{\"Cookie\":\"session=some_id\"}", "type": "query", "description": "HTTP headers to pass to the target page. Can be specified either via a nested query parameter (...&headers[One]=value1&headers=[Another]=value2) or as a JSON encoded object (...&headers={\"One\": \"value1\", \"Another\": \"value2\"})." }, { "name": "timeout", "value": "10000", "type": "query", "description": "Maximum web page retrieval time in ms. Increase it in case of timeout errors (10000 by default, maximum is 30000)." }, { "name": "js", "value": "true", "type": "query", "description": "Execute on-page JavaScript using a headless browser (true by default)." }, { "name": "js_timeout", "value": "2000", "type": "query", "description": "Maximum JavaScript rendering time in ms. Increase it in case if you see a loading indicator instead of data on the target page." }, { "name": "wait_for", "value": "", "type": "query", "description": "CSS selector to wait for before returning the page content. Useful for pages with dynamic content loading. Overrides js_timeout. If the element doesn't appear within the request timeout, the request fails with a 500 error naming the selector and including the target page's HTTP status code and a preview of the page body." }, { "name": "proxy", "value": "datacenter", "type": "query", "description": "Type of proxy. Use `residential` if your site restricts traffic from datacenters, or `stealth` for the most heavily protected sites with advanced anti-bot detection (`datacenter` by default). Residential and stealth proxy requests are more expensive than datacenter, see the pricing page for details." }, { "name": "country", "value": "us", "type": "query", "description": "Country of the proxy to use (US by default)." }, { "name": "custom_proxy", "value": "null", "type": "query", "description": "Your own proxy URL to use instead of our built-in proxy pool in \"http://user:password@host:port\" format (Smartproxy for example)." }, { "name": "device", "value": "desktop", "type": "query", "description": "Type of device emulation." }, { "name": "error_on_404", "value": "false", "type": "query", "description": "Return error on 404 HTTP status on the target page (false by default)." }, { "name": "error_on_redirect", "value": "false", "type": "query", "description": "Return error on redirect on the target page (false by default)." }, { "name": "js_script", "value": "document.querySelector('button').click();", "type": "query", "description": "Custom JavaScript code to execute on the target page." } ] }, "docs": "Returns structured data fields extracted from the webpage using an LLM model. Proxies and Chromium JavaScript rendering are used for page retrieval and processing." } ] } ], "bundled": true }