# Unblocker Features

NetNut’s Website Unblocker API allows users to enhance requests with two powerful parameters: **geolocation targeting** and **JavaScript rendering**. These options help simulate user behavior from specific regions and interact with dynamic websites.

### Geolocation (country)

You can route your request through a specific geographic location by setting the `country` parameter in the request body. This allows localized access, enabling you to scrape region-specific content such as pricing, languages, or availability.

#### Example

```json
{
  "url": "https://example.com",
  "country": "fr"
}
```

* `country`: Accepts standard country codes (e.g., `"us"`, `"fr"`, `"uk"`).
* If not provided, the request will default to the US.

#### Use Case

Use this when scraping pages that return different content based on region — for example, eCommerce pricing, local search results, or region-restricted data.

***

### JavaScript Rendering (`js_render`)

Some websites use JavaScript to load critical content. To capture this dynamic content, you can enable dynamic rendering using the `js_render` option.

#### Example

```json
{
  "url": "https://example.com",
  "js_render": true
}
```

* `js_render`: Boolean (defaults to `false`).
* When set to `true`, the page will be rendered in a headless browser to include dynamic JavaScript-based content.

#### Use Case

Enable this when:

* Content does not appear in the raw HTML
* Data is dynamically loaded via JavaScript (e.g., React/Angular-based apps)
* You need the final, fully rendered DOM

***

### Sticky Session (sid)

You can keep the same IP address across multiple requests by setting the `sid` parameter in the request body . This allows you to maintain session persistence for multi-step workflows such as paginated navigation or repeated requests to the same domain.

**Example**

```json
{
  "url": "https://example.com",
  "sid": "987654321"
}
```

**sid**: Accepts numeric values only (0–9). Requests that use the same `sid` will reuse the same IP until the session ends naturally or the `sid` is changed.

* We recommend using a **9-digit `sid`** for better stickiness and consistency.

If not provided, the request will default to normal IP rotation.

* Navigating through paginated or infinite-scroll results.
* Repeatedly scraping the same domain where consistent IP helps reduce bot-detection triggers.

**Use Case**\
Use this when performing multi-step actions that require the same IP — for example:

***

### Page Format (format)

By default, Unblocker returns responses in HTML. If you want the raw JSON response directly from the website, you can set the `format` parameter to `raw`.

**Example**

```json
{
  "url": "https://httpbin.org/json",
  "format": "raw"
}
```

**format**:

* Defaults to HTML (no param).
* `"raw"` returns the unmodified JSON response directly from the site.

**Use Case**\
Use this when scraping APIs or endpoints that serve JSON data, such as product APIs, metadata endpoints, or structured feeds.

***

### Find Target (find\_target)

Ensure that Unblocker returns the HTML only after a specific element or text appears on the page.

Use the `find_target` parameter to improve data completeness on dynamic or lazy-loaded websites.\
Unblocker will render the page, scroll when needed, and wait until the target is detected before returning the response.

**Example**

```json
{
  "url": "https://example.com",
  "find_target": {
    "element": ".product-list"
  }
}
```

Or for text matching:

```json
{
  "url": "https://example.com",
  "find_target": {
    "text": "price"
  }
}
```

**Behavior**

* Only **one** target may be provided: either `"element"` or `"text"`.
* Unblocker continues loading and scrolling until the target is found or timeout is reached.
* The final HTML is always returned with HTTP 200.
* Find Target does not change the success status of the request.

**Response Headers**

When Find Target is used, two headers indicate whether the target was found:

```
x-netnut-find-target-status: found | not_found
x-netnut-find-target-value: {"element":"..."} | {"text":"..."} | null
```

Example (found):

```
x-netnut-find-target-status: found
x-netnut-find-target-value: {"element":".product-list"}
```

Example (not found):

```
x-netnut-find-target-status: not_found
x-netnut-find-target-value: null
```

**Use Case**

Use this when:

* Scraping dynamic pages that load content only after scrolling or JavaScript rendering
* Extracting elements that appear late in the DOM (reviews, prices, listings)
* Reducing the need for manual delays and retries
* Ensuring completeness on infinite-scroll or lazy-loaded pages

***

#### Combined Example

```json
{
  "url": "https://example.com",
  "country": "fr",
  "sid": "987654321",
  "format": "raw",
  "find_target": {
    "text": "example text"
  }
}
```

**This request:**

* Routes through **France**
* Maintains the **same IP session** across multiple requests
* Returns the response in the website's **raw** format
* Waits until the specified **text** appears before returning the final HTML/JSON


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.netnut.io/netnut-documentation/netnut-scraper-apis/website-unblocker/api-integration-new/unblocker-features.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
