{"note":"OpenAPI conversion -- returning structured metadata","name":"webscraping-ai","description":"WebScraping.AI","version":"3.2.2","base_url":"https://api.webscraping.ai","endpoints":10,"raw":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api WebScraping.AI\n@base https://api.webscraping.ai\n@version 3.2.2\n@auth ApiKey api_key in query\n@endpoints 10\n@toc ai(2), html(1), text(1), selected(1), selected-multiple(1), serp(2), data(1), account(1)\n\n@group ai\n@endpoint GET /ai/question\n@desc Get an answer to a question about a given web page\n@required {url: str # URL of the target page.}\n@optional {question: str # Question or instructions to ask the LLM model about the target page., headers: map # 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\"})., timeout: int=10000 # Maximum web page retrieval time in ms. Increase it in case of timeout errors (10000 by default, maximum is 25000; larger values are capped at 25000)., js: bool=true # Execute on-page JavaScript using a headless browser (true by default)., js_timeout: int=2000 # Maximum JavaScript rendering time in ms. Increase it in case if you see a loading indicator instead of data on the target page., wait_for: str # 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., proxy: str(datacenter/residential/stealth/auto)=datacenter # 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.  `auto` walks the tiers cheapest-first inside one request (datacenter, then residential, then stealth; anti-bot challenge pages skip straight to stealth) and bills only the tier that succeeded. Failed attempts are free. The API remembers, per domain, the cheapest tier that worked and starts there for 30 days, so repeat requests to a protected site do not re-pay the failed rungs in latency. Cannot be combined with `custom_proxy`., country: str(us/gb/de/it/fr/ca/es/ru/jp/kr/in/hk/tr)=us # Country of the proxy to use (US by default)., custom_proxy: str # Your own proxy URL to use instead of our built-in proxy pool in \"http://user:password@host:port\" format (Decodo, formerly Smartproxy, for example)., device: str(desktop/mobile/tablet)=desktop # Type of device emulation., error_on_404: bool=false # Return error on 404 HTTP status on the target page (false by default)., error_on_redirect: bool=false # Return error on redirect on the target page (false by default)., js_script: str # Custom JavaScript code to execute on the target page. It is evaluated as a script whose result is the value of its last expression (a top-level `return` is a syntax error), and it is only run by /html; the other endpoints accept the parameter but ignore it., format: str(json/text)=text # Format of the response (text by default). \"text\" returns the plain text/HTML response. \"json\" wraps it in a JSON object with a `result` key, for tools such as Zapier that only accept JSON.}\n@returns(200) Success\n@errors {400: Parameters validation error, 402: Out of API credits — upgrade your plan or top up your pay-as-you-go balance on https://webscraping.ai/dashboard/billing, 403: Wrong or missing API key. Get a key at https://webscraping.ai/dashboard, 429: Too many concurrent requests for your plan. Wait for a running request to finish and retry, or upgrade for a higher limit., 500: The target page could not be scraped (blocked, anti-bot challenge, non-2xx status, DNS failure) or an unexpected error occurred. Failed requests are not billed (the one exception is a redirect returned because of `error_on_redirect=true`, which is a successful outcome you asked for). Failures on the scraping endpoints (/html, /text, /selected, /selected-multiple, /ai/*) carry a machine-readable `error_code` and, when a better configuration exists, a `next_step` with the parameters to retry with and their credit cost. /serp and /data have their own error envelopes., 504: Timeout error, try increasing timeout parameter value}\n\n@endpoint GET /ai/fields\n@desc Extract structured data fields from a web page\n@required {url: str # URL of the target page., fields: map # Object describing fields to extract from the page and their descriptions}\n@optional {headers: map # 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\"})., timeout: int=10000 # Maximum web page retrieval time in ms. Increase it in case of timeout errors (10000 by default, maximum is 25000; larger values are capped at 25000)., js: bool=true # Execute on-page JavaScript using a headless browser (true by default)., js_timeout: int=2000 # Maximum JavaScript rendering time in ms. Increase it in case if you see a loading indicator instead of data on the target page., wait_for: str # 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., proxy: str(datacenter/residential/stealth/auto)=datacenter # 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.  `auto` walks the tiers cheapest-first inside one request (datacenter, then residential, then stealth; anti-bot challenge pages skip straight to stealth) and bills only the tier that succeeded. Failed attempts are free. The API remembers, per domain, the cheapest tier that worked and starts there for 30 days, so repeat requests to a protected site do not re-pay the failed rungs in latency. Cannot be combined with `custom_proxy`., country: str(us/gb/de/it/fr/ca/es/ru/jp/kr/in/hk/tr)=us # Country of the proxy to use (US by default)., custom_proxy: str # Your own proxy URL to use instead of our built-in proxy pool in \"http://user:password@host:port\" format (Decodo, formerly Smartproxy, for example)., device: str(desktop/mobile/tablet)=desktop # Type of device emulation., error_on_404: bool=false # Return error on 404 HTTP status on the target page (false by default)., error_on_redirect: bool=false # Return error on redirect on the target page (false by default)., js_script: str # Custom JavaScript code to execute on the target page. It is evaluated as a script whose result is the value of its last expression (a top-level `return` is a syntax error), and it is only run by /html; the other endpoints accept the parameter but ignore it.}\n@returns(200) {result: map} # Success\n@errors {400: Parameters validation error, 402: Out of API credits — upgrade your plan or top up your pay-as-you-go balance on https://webscraping.ai/dashboard/billing, 403: Wrong or missing API key. Get a key at https://webscraping.ai/dashboard, 429: Too many concurrent requests for your plan. Wait for a running request to finish and retry, or upgrade for a higher limit., 500: The target page could not be scraped (blocked, anti-bot challenge, non-2xx status, DNS failure) or an unexpected error occurred. Failed requests are not billed (the one exception is a redirect returned because of `error_on_redirect=true`, which is a successful outcome you asked for). Failures on the scraping endpoints (/html, /text, /selected, /selected-multiple, /ai/*) carry a machine-readable `error_code` and, when a better configuration exists, a `next_step` with the parameters to retry with and their credit cost. /serp and /data have their own error envelopes., 504: Timeout error, try increasing timeout parameter value}\n\n@endgroup\n\n@group html\n@endpoint GET /html\n@desc Page HTML by URL\n@required {url: str # URL of the target page.}\n@optional {headers: map # 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\"})., timeout: int=10000 # Maximum web page retrieval time in ms. Increase it in case of timeout errors (10000 by default, maximum is 25000; larger values are capped at 25000)., js: bool=true # Execute on-page JavaScript using a headless browser (true by default)., js_timeout: int=2000 # Maximum JavaScript rendering time in ms. Increase it in case if you see a loading indicator instead of data on the target page., wait_for: str # 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., proxy: str(datacenter/residential/stealth/auto)=datacenter # 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.  `auto` walks the tiers cheapest-first inside one request (datacenter, then residential, then stealth; anti-bot challenge pages skip straight to stealth) and bills only the tier that succeeded. Failed attempts are free. The API remembers, per domain, the cheapest tier that worked and starts there for 30 days, so repeat requests to a protected site do not re-pay the failed rungs in latency. Cannot be combined with `custom_proxy`., country: str(us/gb/de/it/fr/ca/es/ru/jp/kr/in/hk/tr)=us # Country of the proxy to use (US by default)., custom_proxy: str # Your own proxy URL to use instead of our built-in proxy pool in \"http://user:password@host:port\" format (Decodo, formerly Smartproxy, for example)., device: str(desktop/mobile/tablet)=desktop # Type of device emulation., error_on_404: bool=false # Return error on 404 HTTP status on the target page (false by default)., error_on_redirect: bool=false # Return error on redirect on the target page (false by default)., js_script: str # Custom JavaScript code to execute on the target page. It is evaluated as a script whose result is the value of its last expression (a top-level `return` is a syntax error), and it is only run by /html; the other endpoints accept the parameter but ignore it., return_script_result: bool=false # Return result of the custom JavaScript code (js_script parameter) execution on the target page (false by default, page HTML will be returned)., format: str(json/text)=text # Format of the response (text by default). \"text\" returns the plain text/HTML response. \"json\" wraps it in a JSON object with a `result` key, for tools such as Zapier that only accept JSON.}\n@returns(200) Success\n@errors {400: Parameters validation error, 402: Out of API credits — upgrade your plan or top up your pay-as-you-go balance on https://webscraping.ai/dashboard/billing, 403: Wrong or missing API key. Get a key at https://webscraping.ai/dashboard, 429: Too many concurrent requests for your plan. Wait for a running request to finish and retry, or upgrade for a higher limit., 500: The target page could not be scraped (blocked, anti-bot challenge, non-2xx status, DNS failure) or an unexpected error occurred. Failed requests are not billed (the one exception is a redirect returned because of `error_on_redirect=true`, which is a successful outcome you asked for). Failures on the scraping endpoints (/html, /text, /selected, /selected-multiple, /ai/*) carry a machine-readable `error_code` and, when a better configuration exists, a `next_step` with the parameters to retry with and their credit cost. /serp and /data have their own error envelopes., 504: Timeout error, try increasing timeout parameter value}\n\n@endgroup\n\n@group text\n@endpoint GET /text\n@desc Page text by URL (Markdown)\n@required {url: str # URL of the target page.}\n@optional {text_format: str(plain/xml/json)=plain # Format of the text response (plain by default). \"plain\" will return the page body content as Markdown. \"json\" and \"xml\" will return a json/xml with \"title\", \"description\" and \"content\" (Markdown) keys., return_links: bool=false # [Works only with text_format=json] Return links from the page body text (false by default). Useful for building web crawlers., headers: map # 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\"})., timeout: int=10000 # Maximum web page retrieval time in ms. Increase it in case of timeout errors (10000 by default, maximum is 25000; larger values are capped at 25000)., js: bool=true # Execute on-page JavaScript using a headless browser (true by default)., js_timeout: int=2000 # Maximum JavaScript rendering time in ms. Increase it in case if you see a loading indicator instead of data on the target page., wait_for: str # 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., proxy: str(datacenter/residential/stealth/auto)=datacenter # 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.  `auto` walks the tiers cheapest-first inside one request (datacenter, then residential, then stealth; anti-bot challenge pages skip straight to stealth) and bills only the tier that succeeded. Failed attempts are free. The API remembers, per domain, the cheapest tier that worked and starts there for 30 days, so repeat requests to a protected site do not re-pay the failed rungs in latency. Cannot be combined with `custom_proxy`., country: str(us/gb/de/it/fr/ca/es/ru/jp/kr/in/hk/tr)=us # Country of the proxy to use (US by default)., custom_proxy: str # Your own proxy URL to use instead of our built-in proxy pool in \"http://user:password@host:port\" format (Decodo, formerly Smartproxy, for example)., device: str(desktop/mobile/tablet)=desktop # Type of device emulation., error_on_404: bool=false # Return error on 404 HTTP status on the target page (false by default)., error_on_redirect: bool=false # Return error on redirect on the target page (false by default)., js_script: str # Custom JavaScript code to execute on the target page. It is evaluated as a script whose result is the value of its last expression (a top-level `return` is a syntax error), and it is only run by /html; the other endpoints accept the parameter but ignore it.}\n@returns(200) Success\n@errors {400: Parameters validation error, 402: Out of API credits — upgrade your plan or top up your pay-as-you-go balance on https://webscraping.ai/dashboard/billing, 403: Wrong or missing API key. Get a key at https://webscraping.ai/dashboard, 429: Too many concurrent requests for your plan. Wait for a running request to finish and retry, or upgrade for a higher limit., 500: The target page could not be scraped (blocked, anti-bot challenge, non-2xx status, DNS failure) or an unexpected error occurred. Failed requests are not billed (the one exception is a redirect returned because of `error_on_redirect=true`, which is a successful outcome you asked for). Failures on the scraping endpoints (/html, /text, /selected, /selected-multiple, /ai/*) carry a machine-readable `error_code` and, when a better configuration exists, a `next_step` with the parameters to retry with and their credit cost. /serp and /data have their own error envelopes., 504: Timeout error, try increasing timeout parameter value}\n\n@endgroup\n\n@group selected\n@endpoint GET /selected\n@desc HTML of a selected page area by URL and CSS selector\n@required {url: str # URL of the target page.}\n@optional {selector: str # CSS selector of the page area to return. The inner HTML of the first matching element is returned; if nothing matches, the request fails with a 400 \"Element not found\"., headers: map # 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\"})., timeout: int=10000 # Maximum web page retrieval time in ms. Increase it in case of timeout errors (10000 by default, maximum is 25000; larger values are capped at 25000)., js: bool=true # Execute on-page JavaScript using a headless browser (true by default)., js_timeout: int=2000 # Maximum JavaScript rendering time in ms. Increase it in case if you see a loading indicator instead of data on the target page., wait_for: str # 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., proxy: str(datacenter/residential/stealth/auto)=datacenter # 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.  `auto` walks the tiers cheapest-first inside one request (datacenter, then residential, then stealth; anti-bot challenge pages skip straight to stealth) and bills only the tier that succeeded. Failed attempts are free. The API remembers, per domain, the cheapest tier that worked and starts there for 30 days, so repeat requests to a protected site do not re-pay the failed rungs in latency. Cannot be combined with `custom_proxy`., country: str(us/gb/de/it/fr/ca/es/ru/jp/kr/in/hk/tr)=us # Country of the proxy to use (US by default)., custom_proxy: str # Your own proxy URL to use instead of our built-in proxy pool in \"http://user:password@host:port\" format (Decodo, formerly Smartproxy, for example)., device: str(desktop/mobile/tablet)=desktop # Type of device emulation., error_on_404: bool=false # Return error on 404 HTTP status on the target page (false by default)., error_on_redirect: bool=false # Return error on redirect on the target page (false by default)., js_script: str # Custom JavaScript code to execute on the target page. It is evaluated as a script whose result is the value of its last expression (a top-level `return` is a syntax error), and it is only run by /html; the other endpoints accept the parameter but ignore it., format: str(json/text)=text # Format of the response (text by default). \"text\" returns the plain text/HTML response. \"json\" wraps it in a JSON object with a `result` key, for tools such as Zapier that only accept JSON.}\n@returns(200) Success\n@errors {400: Parameters validation error, 402: Out of API credits — upgrade your plan or top up your pay-as-you-go balance on https://webscraping.ai/dashboard/billing, 403: Wrong or missing API key. Get a key at https://webscraping.ai/dashboard, 429: Too many concurrent requests for your plan. Wait for a running request to finish and retry, or upgrade for a higher limit., 500: The target page could not be scraped (blocked, anti-bot challenge, non-2xx status, DNS failure) or an unexpected error occurred. Failed requests are not billed (the one exception is a redirect returned because of `error_on_redirect=true`, which is a successful outcome you asked for). Failures on the scraping endpoints (/html, /text, /selected, /selected-multiple, /ai/*) carry a machine-readable `error_code` and, when a better configuration exists, a `next_step` with the parameters to retry with and their credit cost. /serp and /data have their own error envelopes., 504: Timeout error, try increasing timeout parameter value}\n\n@endgroup\n\n@group selected-multiple\n@endpoint GET /selected-multiple\n@desc HTML of multiple page areas by URL and CSS selectors\n@required {url: str # URL of the target page.}\n@optional {selectors: [str] # Multiple CSS selectors. Repeat the parameter once per selector (selectors=h1&selectors=p); bracketed forms such as selectors[]=h1 are not recognized and return empty results., headers: map # 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\"})., timeout: int=10000 # Maximum web page retrieval time in ms. Increase it in case of timeout errors (10000 by default, maximum is 25000; larger values are capped at 25000)., js: bool=true # Execute on-page JavaScript using a headless browser (true by default)., js_timeout: int=2000 # Maximum JavaScript rendering time in ms. Increase it in case if you see a loading indicator instead of data on the target page., wait_for: str # 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., proxy: str(datacenter/residential/stealth/auto)=datacenter # 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.  `auto` walks the tiers cheapest-first inside one request (datacenter, then residential, then stealth; anti-bot challenge pages skip straight to stealth) and bills only the tier that succeeded. Failed attempts are free. The API remembers, per domain, the cheapest tier that worked and starts there for 30 days, so repeat requests to a protected site do not re-pay the failed rungs in latency. Cannot be combined with `custom_proxy`., country: str(us/gb/de/it/fr/ca/es/ru/jp/kr/in/hk/tr)=us # Country of the proxy to use (US by default)., custom_proxy: str # Your own proxy URL to use instead of our built-in proxy pool in \"http://user:password@host:port\" format (Decodo, formerly Smartproxy, for example)., device: str(desktop/mobile/tablet)=desktop # Type of device emulation., error_on_404: bool=false # Return error on 404 HTTP status on the target page (false by default)., error_on_redirect: bool=false # Return error on redirect on the target page (false by default)., js_script: str # Custom JavaScript code to execute on the target page. It is evaluated as a script whose result is the value of its last expression (a top-level `return` is a syntax error), and it is only run by /html; the other endpoints accept the parameter but ignore it.}\n@returns(200) Success\n@errors {400: Parameters validation error, 402: Out of API credits — upgrade your plan or top up your pay-as-you-go balance on https://webscraping.ai/dashboard/billing, 403: Wrong or missing API key. Get a key at https://webscraping.ai/dashboard, 429: Too many concurrent requests for your plan. Wait for a running request to finish and retry, or upgrade for a higher limit., 500: The target page could not be scraped (blocked, anti-bot challenge, non-2xx status, DNS failure) or an unexpected error occurred. Failed requests are not billed (the one exception is a redirect returned because of `error_on_redirect=true`, which is a successful outcome you asked for). Failures on the scraping endpoints (/html, /text, /selected, /selected-multiple, /ai/*) carry a machine-readable `error_code` and, when a better configuration exists, a `next_step` with the parameters to retry with and their credit cost. /serp and /data have their own error envelopes., 504: Timeout error, try increasing timeout parameter value}\n\n@endgroup\n\n@group serp\n@endpoint GET /serp\n@desc Search engine results (SERP) by query\n@required {q: str # Search query.}\n@optional {engine: str=google # Search engine to query., gl: str=us # Two-letter country code for geolocation of the search (Google `gl` parameter). Defaults to the country of `location`, `lat`/`lon` or `uule` when one is given, otherwise `us`., hl: str=en # Two-letter language code for the results (Google `hl` parameter)., page: int=1 # Results page number (10 results per page), from 1 to 100. Any other value (0, a fraction, a non-number, or above 100) is rejected with a 400 before billing., pages: int=1 # Number of consecutive results pages to fetch in one call, starting at `page` (1 to 5). The pages come from the same exit IP and location, results already seen on an earlier page are removed, and `organic_results` is one list with `position` counting through it and `page` on each result. Billed per page returned: the call stops early when Google has no further page, and a later page that can't be fetched is left out and not charged (`pagination.pages_returned` says how many came back)., location: str # Where the search originates, as a canonical location name (e.g. `Austin,Texas,United States`) or a location id from `/serp/locations`. A place name resolves to its most populous match (`Austin` gives Austin, Texas; large cities also answer to local and other-language names such as `Roma` or `Москва`); anything after a comma must match the region or country (`Paris, TX` gives Paris, Texas). US, Canadian and Australian state codes are understood, and a two-letter code is read as a state first and as a country code otherwise (`Richmond, CA` is California, `Toronto, CA` and `Berlin, DE` are Canada and Germany). States, regions and countries search from their most populous city, countries from their capital. An unknown name is a 400 before billing (at most 200 characters). Cannot be combined with `uule`, `lat` or `lon`. When omitted, the search runs from the capital of the `gl` country., uule: str # Google-encoded location. Both the name form (`w+CAIQICI…`, which must carry an exact canonical name from the location list) and the coordinate form (`a+…`) are accepted; a radius inside the uule outside 1–1000 m is ignored. Cannot be combined with `location`, `lat` or `lon`., lat: num # GPS latitude of the search origin in decimal degrees. Requires `lon`; cannot be combined with `location` or `uule`., lon: num # GPS longitude of the search origin in decimal degrees. Requires `lat`; cannot be combined with `location` or `uule`., radius: int # Radius in meters around `location` or `lat`/`lon` (1 to 1000), passed to Google with the location. In our tests it did not change organic results.}\n@returns(200) {search_parameters: map{engine: str, q: str, gl: str, hl: str, page: int, pages: int, location_requested: str, location_used: str, lat: num, lon: num, radius: int}, search_information: map{query_displayed: str, organic_results_state: str, showing_results_for: str}, organic_results: [map], related_searches: [map], pagination: map{current: int, pages_returned: int, next: int}} # Success\n@errors {400: Parameters validation error, 402: Out of API credits — upgrade your plan or top up your pay-as-you-go balance on https://webscraping.ai/dashboard/billing, 403: Wrong or missing API key. Get a key at https://webscraping.ai/dashboard, 429: Too many concurrent requests for your plan. Wait for a running request to finish and retry, or upgrade for a higher limit., 500: The target page could not be scraped (blocked, anti-bot challenge, non-2xx status, DNS failure) or an unexpected error occurred. Failed requests are not billed (the one exception is a redirect returned because of `error_on_redirect=true`, which is a successful outcome you asked for). Failures on the scraping endpoints (/html, /text, /selected, /selected-multiple, /ai/*) carry a machine-readable `error_code` and, when a better configuration exists, a `next_step` with the parameters to retry with and their credit cost. /serp and /data have their own error envelopes., 504: Timeout error, try increasing timeout parameter value}\n\n@endpoint GET /serp/locations\n@desc Look up supported SERP locations\n@optional {q: str # Part of a location name to search for. Without it, the most populous locations are returned., limit: int=10 # Maximum number of locations to return (1 to 10).}\n@returns(200) Success\n@errors {400: Parameters validation error}\n\n@endgroup\n\n@group data\n@endpoint GET /data\n@desc Structured data for any web page\n@required {url: str # URL of any public web page.}\n@optional {country: str=us # Two-letter country code of the proxy used to fetch the page. Without it, pages on a country site with a dedicated parser (e.g. `uk.indeed.com`) use that site's country and everything else uses `us`. Some dedicated parsers use a fixed route and ignore it; their results always follow the URL's site. Must be one of the API's proxy countries (see the `country` parameter of the page endpoints); other values are rejected with a 400., transcript: bool=false # Video pages on sites with a dedicated parser only. Also fetch the video's transcript into `data.transcript` (null when no matching captions are available). If the transcript fetch itself fails, the whole request fails with a 500 and is not charged., transcript_language: str # With `transcript=true`. Caption language to pick, e.g. `en` or `de`. Without it, English is preferred, then the first available track. If the video has no captions in that language, `data.transcript` is null., timeout: int=10000 # Maximum web page retrieval time in ms. Increase it in case of timeout errors (10000 by default, maximum is 25000; larger values are capped at 25000)., js_timeout: int=2000 # Maximum JavaScript rendering time in ms. Increase it in case if you see a loading indicator instead of data on the target page., wait_for: str # 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., device: str(desktop/mobile/tablet)=desktop # Type of device emulation.}\n@returns(200) {request_parameters: map{url: str, provider: str, type: str}, parse_status: str, data: map?} # Success\n@errors {400: Parameters validation error, 402: Out of API credits — upgrade your plan or top up your pay-as-you-go balance on https://webscraping.ai/dashboard/billing, 403: Wrong or missing API key. Get a key at https://webscraping.ai/dashboard, 422: No structured data could be found on the page (for example an empty page or a login wall). Not charged., 429: Too many concurrent requests for your plan. Wait for a running request to finish and retry, or upgrade for a higher limit., 500: The target page could not be scraped (blocked, anti-bot challenge, non-2xx status, DNS failure) or an unexpected error occurred. Failed requests are not billed (the one exception is a redirect returned because of `error_on_redirect=true`, which is a successful outcome you asked for). Failures on the scraping endpoints (/html, /text, /selected, /selected-multiple, /ai/*) carry a machine-readable `error_code` and, when a better configuration exists, a `next_step` with the parameters to retry with and their credit cost. /serp and /data have their own error envelopes., 503: The site's structure for this kind of page is still being learned. No data yet and not charged; retry after `retry_after` seconds.}\n\n@endgroup\n\n@group account\n@endpoint GET /account\n@desc Information about your account calls quota\n@returns(200) {email: str, remaining_api_calls: int, remaining_monthly_credits: int, remaining_payg_credits: int, remaining_total_credits: int, resets_at: int, remaining_concurrency: int} # Success\n@errors {403: Wrong or missing API key. Get a key at https://webscraping.ai/dashboard}\n\n@endgroup\n\n@end\n"}