---
title: Web Scraper API - JavaScript Rendering, Proxy Rotation & CAPTCHA Solving
version: 1.0.0
description: "Executes a sequence of scraping instructions against a target URL and returns the extracted data. Two modes are available via the `jsEnabled` query parameter: `jsEnabled=true` renders the page in a real browser and supports `fill`, `click`, `wait`, iframe switching, image/audio CAPTCHA solving, and other interactive instructions, plus request-level `blockUrl` and `cookies`; `jsEnabled=false` fetches static HTML and supports `postForm`, `getForm`, `getPage`, and `extract`. Every mode's response is an `extractedData` object keyed by the field names used in your `extract` instructions --- each value is a string when its selector matched exactly one element, or an array of strings when it matched more than one; a selector that matches nothing is omitted from the response entirely. The `text` query parameter strips HTML tags from extracted values; under `jsEnabled=true`, single-element matches are always returned as plain text regardless of `text`, while multi-element matches keep tags unless `text=true` is set."
openapi: 3.1.1
servers:
  - https://api.apifreaks.com/v1.0
paths: 1
operations: 1
schemas: 13
---

## Table of Contents

- [Web Scraper API - JavaScript Rendering, Proxy Rotation & CAPTCHA Solving v1.0.0](#web-scraper-api-javascript-rendering-proxy-rotation-captcha-solving-v100)
  - [Authentication](#authentication)
  - [Scraping APIs](#scraping-apis)
    - [performScraping](#performscraping)
      - [Parameters](#parameters)
      - [Responses](#responses)
  - [Schemas](#schemas)
    - [JsEnabledTrueBody](#jsenabledtruebody)
    - [Instruction](#instruction)
    - [Cookie](#cookie)
    - [PlaceValue](#placevalue)
    - [ImageCaptchaInstruction](#imagecaptchainstruction)
    - [AudioCaptchaInstruction](#audiocaptchainstruction)
    - [ExtractInstruction](#extractinstruction)
    - [JsEnabledFalseBody](#jsenabledfalsebody)
    - [StaticInstruction](#staticinstruction)
    - [FormSubmission](#formsubmission)
    - [ScrapingResponse](#scrapingresponse)
    - [ExtractedField](#extractedfield)
    - [ErrorResponse](#errorresponse)



# Web Scraper API - JavaScript Rendering, Proxy Rotation & CAPTCHA Solving v1.0.0

Executes a sequence of scraping instructions against a target URL and returns the extracted data. Two modes are available via the `jsEnabled` query parameter: `jsEnabled=true` renders the page in a real browser and supports `fill`, `click`, `wait`, iframe switching, image/audio CAPTCHA solving, and other interactive instructions, plus request-level `blockUrl` and `cookies`; `jsEnabled=false` fetches static HTML and supports `postForm`, `getForm`, `getPage`, and `extract`. Every mode's response is an `extractedData` object keyed by the field names used in your `extract` instructions --- each value is a string when its selector matched exactly one element, or an array of strings when it matched more than one; a selector that matches nothing is omitted from the response entirely. The `text` query parameter strips HTML tags from extracted values; under `jsEnabled=true`, single-element matches are always returned as plain text regardless of `text`, while multi-element matches keep tags unless `text=true` is set.

Base URLs:

* [https://api.apifreaks.com/v1.0](https://api.apifreaks.com/v1.0)

## Authentication

* API Key (ApiKeyAuthHeader)
    - Parameter Name: **X-apiKey**, in: header. Pass your API key via the X-apiKey request header.

* API Key (ApiKeyAuthQuery)
    - Parameter Name: **apiKey**, in: query. Pass your API key via the apiKey query parameter.

## Scraping APIs

### performScraping

`POST /scraping`

*Execute a sequence of web scraping instructions against a target URL*

Runs form-filling, clicking, data-extraction, and CAPTCHA-solving instructions against a target URL and returns the extracted data. Behavior and available instructions depend on the jsEnabled query parameter.

> Body parameter

```json
{
  "blockUrl": [
    "https://example.com/ads.js",
    "https://tracker.example.com/*"
  ],
  "cookies": [
    {
      "name": "sessionid",
      "value": "abc123"
    }
  ],
  "instructions": [
    {
      "fill": {
        "place": "#username",
        "value": "myuser"
      }
    },
    {
      "fill": {
        "place": "#password",
        "value": "mypassword"
      }
    },
    {
      "click": "input[type=submit]"
    },
    {
      "wait": 1000
    },
    {
      "extract": {
        "pageTitle": "title",
        "welcomeText": "h1"
      }
    }
  ]
}
```

#### Parameters

|Name|In|Type|Required|Description|
|---|---|---|---|---|
|url|query|string(uri)|true|Target URL to scrape.|
|text|query|boolean|false|Set to true to strip HTML tags from extracted values (plain text). Set to false to keep HTML tags. Default is false. Under jsEnabled=true, single-element matches are always plain text regardless of this flag.|
|jsEnabled|query|boolean|false|Set to true to render the page in a real browser for dynamic/JavaScript-driven pages (enables fill, click, wait, CAPTCHA-solving, and related instructions). Set to false to fetch static HTML only (enables postForm, getForm, getPage, extract). Default is false.|
|proxy|query|any|false|Use a proxy for the request. Pass true/false to toggle the default proxy pool, or a proxy URL string to use a specific proxy.|
|sslIgnore|query|boolean|false|Set to true to ignore SSL certificate errors on the target site. Only works when jsEnabled is true.|
|windowSize|query|string|false|Browser window size in the format 'width,height' (e.g. '1920,1080'). Only works when jsEnabled is true.|
|adBlock|query|boolean|false|Set to true to block ads on the target page. Only works when jsEnabled is true.|
|captcha|query|boolean|false|Set to true to allow CAPTCHA-solving instructions (generalImageCaptcha, fillImageCaptcha, resolveAudioCaptcha) in the request body. Only works when jsEnabled is true.|
|body|body|any|false|The request body shape depends on the jsEnabled query parameter, not on any field inside the body itself. Pass jsEnabled=true for the interactive/browser instruction set (JsEnabledTrueBody: fill, click, wait, blockUrl, cookies, CAPTCHA solving, and more). Pass jsEnabled=false (or omit it) for the static-HTML instruction set (JsEnabledFalseBody: postForm, getForm, getPage, extract). instructions is an ordered array executed sequentially.|

> Example responses

> Successful scraping operation

```json
{
  "extractedData": {
    "pageTitle": "<title>Example Domain</title>",
    "paragraphs": [
      "<p>This domain is for use in documentation examples without needing permission. Avoid use in operations.</p>",
      "<p><a href=\"https://iana.org/domains/example\">Learn more</a></p>"
    ]
  }
}
```

```json
{
  "extractedData": {
    "firstQuote": "“The world as we have created it is a process of our thinking. It cannot be changed without changing our thinking.”",
    "authors": [
      "<small class=\"author\" itemprop=\"author\">Albert Einstein</small>",
      "<small class=\"author\" itemprop=\"author\">J.K. Rowling</small>",
      "<small class=\"author\" itemprop=\"author\">Albert Einstein</small>",
      "<small class=\"author\" itemprop=\"author\">Jane Austen</small>",
      "<small class=\"author\" itemprop=\"author\">Marilyn Monroe</small>",
      "<small class=\"author\" itemprop=\"author\">Albert Einstein</small>",
      "<small class=\"author\" itemprop=\"author\">André Gide</small>",
      "<small class=\"author\" itemprop=\"author\">Thomas A. Edison</small>",
      "<small class=\"author\" itemprop=\"author\">Eleanor Roosevelt</small>",
      "<small class=\"author\" itemprop=\"author\">Steve Martin</small>"
    ]
  }
}
```

> Bad Request — Missing/invalid parameters, malformed request body, unparseable selectors, or the target URL could not be fetched

```json
{
  "error": "Invalid Param Exception",
  "message": "please pass correct parameters",
  "path": "/v1.0/scraping",
  "status": 400,
  "timestamp": "2026-07-23T11:50:14.427Z"
}
```

```json
{
  "timestamp": "2026-07-23T11:47:47.907+00:00",
  "status": 400,
  "error": "JSON Parse Error",
  "message": "Invalid or malformed JSON. Please check your request body format and ensure it's valid JSON.",
  "path": "/v1/scraping/params"
}
```

```json
{
  "timestamp": "2026-07-23T11:47:54.568+00:00",
  "status": 400,
  "error": "Bad Request",
  "message": "Arguments are missing or wrong",
  "path": "/v1/scraping/params"
}
```

```json
{
  "timestamp": "2026-07-23T11:50:15.539+00:00",
  "status": 400,
  "error": "Bad Request",
  "message": "Check the Css Selectors or Xpath, Some of them are wrong",
  "path": "/v1/scraping/params"
}
```

```json
{
  "timestamp": "2026-07-23T11:50:16.120+00:00",
  "status": 400,
  "error": "IO Exception",
  "message": "Error while reading the datathisdomaindoesnotexist12345xyz.com",
  "path": "/v1/scraping/params"
}
```

```json
{
  "timestamp": "2026-07-23T11:50:26.224+00:00",
  "status": 400,
  "error": "Bad Request",
  "message": "Check the url or links",
  "path": "/v1/scraping/params"
}
```

> Not Found — Wrong HTTP method or path used against this endpoint

```json
{
  "error": "Resource Not Found",
  "message": "The requested resource could not be found. Please verify the URL and try again.",
  "path": "/v1.0/scraping",
  "status": 404,
  "timestamp": "2026-07-23T11:51:33.926Z"
}
```

#### Responses

|Status|Meaning|Description|Schema|
|---|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful scraping operation|[ScrapingResponse](#scrapingresponse)|
|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad Request — Missing/invalid parameters, malformed request body, unparseable selectors, or the target URL could not be fetched|[ErrorResponse](#errorresponse)|
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found — Wrong HTTP method or path used against this endpoint|[ErrorResponse](#errorresponse)|

#### Response Headers

|Status|Header|Type|Format|Description|
|---|---|---|---|---|
|200|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|200|X-Concurrent-Threads|integer||Specifies the maximum number of concurrent requests allowed.|
|200|X-Concurrent-Threads-Active|integer||Indicates the number of active concurrent requests being processed.|
|400|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|400|X-Concurrent-Threads|integer||Specifies the maximum number of concurrent requests allowed.|
|400|X-Concurrent-Threads-Active|integer||Indicates the number of active concurrent requests being processed.|
|404|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|404|X-Concurrent-Threads|integer||Specifies the maximum number of concurrent requests allowed.|
|404|X-Concurrent-Threads-Active|integer||Indicates the number of active concurrent requests being processed.|

To perform this operation, you must be authenticated by means of one of the following methods:
ApiKeyAuthHeader, ApiKeyAuthQuery

## Schemas

### JsEnabledTrueBody

Request body for jsEnabled=true: renders the page in a real browser and supports interactive instructions.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|blockUrl|[string]|false|none|List of script or URL patterns to block during network requests.|
|cookies|[[Cookie](#cookie)]|false|none|List of cookies to be set in the browser session.|
|instructions|[[Instruction](#instruction)]|false|none|An ordered list of step-by-step scraping instructions to be executed in the browser. Each item is one Instruction object, with exactly one action field set.|

### Instruction

A single browser scraping step. Exactly one of these action fields is set per instruction; every other field is absent.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|fill|[PlaceValue](#placevalue)|false|none|Fill action: fills an input field with a value using a CSS or XPath selector.|
|click|string|false|none|Click action: CSS selector or XPath identifying the element to click.|
|clickIfExist|string|false|none|Click if exists action: CSS selector or XPath identifying the element to click, only if it appears on the page within a short timeout.|
|enter|string|false|none|Enter key action: CSS selector or XPath identifying the element to send an Enter keystroke to.|
|newTab|boolean|false|none|New tab action: set to true to switch focus to a newly opened browser tab.|
|moveToRelativeTab|integer|false|none|Move to relative tab action: relative tab index to move to (e.g. 1 for the next tab, -1 for the previous tab).|
|wait|integer|false|none|Wait action: pauses execution for this many milliseconds.|
|waitFor|string|false|none|Wait for element action: CSS selector or XPath identifying the element to wait for before continuing.|
|select|[PlaceValue](#placevalue)|false|none|Select dropdown action: selects an option from a dropdown element by selector and matching value.|
|jsExe|string|false|none|Execute JavaScript action: JavaScript code to execute inside the page context.|
|conditionalCheck|[object]|false|none|Conditional check action: list of conditional steps, each supporting if-<method> and else-<method> keys with conditions, executed based on element state.|
|clickButtonByValue|[PlaceValue](#placevalue)|false|none|Click button by value action: clicks a button that matches a specific text or value attribute.|
|generalImageCaptcha|[[ImageCaptchaInstruction](#imagecaptchainstruction)]|false|none|Image captcha solver action: instructions for solving image-based captchas using a selected model.|
|blockElement|[string]|false|none|Block element action: list of CSS selectors or XPaths for elements to block or hide on the page.|
|extract|[ExtractInstruction](#extractinstruction)|false|none|Extract data action: defines what data to extract and how, keyed by whatever field names you choose.|
|fillImageCaptcha|[[ImageCaptchaInstruction](#imagecaptchainstruction)]|false|none|Fill image captcha action: captures and fills image-based captcha values automatically.|
|switchToIframe|string|false|none|Switch to iframe action: switches the browser context into an iframe identified by name or ID.|
|switchToParentFrame|boolean|false|none|Switch to parent frame action: returns the browser context from an iframe back to its parent frame.|
|resolveAudioCaptcha|[AudioCaptchaInstruction](#audiocaptchainstruction)|false|none|Resolve audio captcha action: solves audio-based captcha challenges and fills the resolved text into the target field.|
|screenshot|string|false|none|Screenshot action: captures a screenshot of the current page state. Can be a boolean-like value or a selector.|
|saveimage|string|false|none|Save image action: saves an image from the page by CSS selector or element ID.|

### Cookie

A single cookie to set in the browser session before running instructions.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|name|string|true|none|Cookie name.|
|value|string|true|none|Cookie value.|

### PlaceValue

A selector/value pair used by fill, select, and clickButtonByValue instructions.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|place|string|true|none|CSS or XPath selector identifying the target element.|
|value|string|true|none|Value to fill, select, or match against.|

### ImageCaptchaInstruction

Instructions for locating and solving a single image CAPTCHA challenge.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|imagePath|string|false|none|Selector for the CAPTCHA image element.|
|textField|string|false|none|Selector for the field where the CAPTCHA text is entered.|
|imageUpdatePath|string|false|none|Selector to refresh or update the CAPTCHA image.|
|captchaFailedPath|string|false|none|Selector indicating a CAPTCHA failure so the solver can retry.|
|model|string|false|none|Model used for CAPTCHA solving.|

##### Enumerated Values

|Property|Value|
|---|---|
|model|Model_1|
|model|Model_2|
|model|Model_3|
|model|Model_4|
|model|Model_5|
|model|Model_6|
|model|basicTnImageProcessing|
|model|basicPhImageProcessing|

### AudioCaptchaInstruction

Selectors for locating and solving a single audio CAPTCHA challenge.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|audioPath|string|false|none|Selector for the audio CAPTCHA element.|
|textField|string|false|none|Selector for the field where the resolved audio CAPTCHA text is entered.|

### ExtractInstruction

Maps arbitrary output field names to CSS or XPath selectors. Each key becomes a field in the response's extractedData object.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|SelectorForField|string|false|none|CSS selector or XPath identifying the element(s) to extract for this output field. Example: 'h1' or '/html/body/div/div[2]'.|

### JsEnabledFalseBody

Request body for jsEnabled=false (or omitted): fetches static HTML only, no browser rendering.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|instructions|[[StaticInstruction](#staticinstruction)]|false|none|A list of sequential instructions to execute against the static HTML response. Each item is one StaticInstruction object, with exactly one action field set.|

### StaticInstruction

A single static-HTML scraping step. Exactly one of these action fields is set per instruction; every other field is absent.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|postForm|[FormSubmission](#formsubmission)|false|none|POST form action: submits a form using the POST method. Provide the form's XPath/CSS selector and input values.|
|getForm|[FormSubmission](#formsubmission)|false|none|GET form action: submits a form using the GET method. Provide the form's XPath/CSS selector and input values.|
|extract|[ExtractInstruction](#extractinstruction)|false|none|Extract data action: defines what data to extract and how, keyed by whatever field names you choose.|
|getPage|string|false|none|Get page action: retrieves the full page content. Optionally provide a URL or selector to target a specific page.|

### FormSubmission

Form selector and field values to submit via postForm or getForm.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|selector|string|false|none|CSS or XPath selector identifying the form element.|
|data|object|false|none|Form field name/value pairs to submit.|
|» FormFieldValue|string|false|none|Value to submit for this form field.|

### ScrapingResponse

Result of running the scraping instructions against the target URL.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|extractedData|[ExtractedField](#extractedfield)|true|none|Container keyed by the field names used in your extract instructions. A field is present only if its selector matched at least one element on the page.|

### ExtractedField

ExtractedField

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|ExtractedField|string | array|false|none|The value scraped for one field of an extract instruction. A string when the selector matched exactly one element (content depends on the text query parameter and, under jsEnabled=true, is always plain text). An array of strings, in document order, when the selector matched more than one element (each entry keeps HTML tags unless text=true is set). A field whose selector matched nothing is omitted from extractedData entirely rather than appearing as an empty value.|

### ErrorResponse

Standard error response returned when a request fails.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|error|string|true|none|Short error category or exception type.|
|message|string|true|none|Human-readable error message describing the failure.|
|path|string|true|none|API endpoint path that produced the error.|
|status|integer|true|none|HTTP status code returned with the error.|
|timestamp|string(date-time)|true|none|Timestamp when the error occurred (ISO 8601).|
