# WebScraping.AI API reference

> WebScraping.AI fetches a page for you through its proxies, optionally rendering JavaScript, and returns the HTML, text, selected elements, an AI answer or Google results. An investigator can use it to capture a page from another country or behind simple bot defences. Pass your key as the api_key…

Source: https://osinttools.io/apis/webscraping-ai/ (Markdown view of an OSINTtools.io page; append `.md` to any page URL for this format).

Compiled by OSINTtools.io editors from the vendor's docs, updated Nov 29, 2026. Listing: https://osinttools.io/tools/webscraping-ai/

- Base URL: https://api.webscraping.ai
- Authentication: API key in the `api_key` query parameter. Get a key: https://webscraping.ai/ Keep the key server-side
- Pricing: Credits
- Rate limits: Concurrency limit (429 when exceeded); no per-second rate stated
- Vendor docs: https://webscraping.ai/docs

## Overview

WebScraping.AI fetches a page for you through its proxies, optionally rendering JavaScript, and returns the HTML, text, selected elements, an AI answer or Google results. An investigator can use it to capture a page from another country or behind simple bot defences.

Pass your key as the `api_key` query parameter on every request. Requests cost credits by configuration: 1 for datacenter proxy without JS, 5 with JS rendering (the default), 10 for residential without JS, 25 residential with JS, 50 for stealth proxy; AI endpoints add 5 and `/serp` costs 15 per results page. Failed requests are free.

The docs state no per-second rate limit; exceeding concurrency returns 429, and `/account` reports `remaining_concurrency`. Requests can take up to 30 seconds. The multi-selector endpoint `/selected-multiple` and the `/data` endpoint are not described here.

## Errors

| Status | Meaning |
| --- | --- |
| 400 | Invalid parameters (not charged) |
| 402 | Insufficient credits |
| 403 | Invalid API key |
| 429 | Too many concurrent requests |
| 500 | Target blocked or errored, or internal error |
| 503 | Workers busy (not charged; retry after Retry-After) |
| 504 | Timeout; increase timeout |

## Scraping

### Fetch a page and return its raw HTML.

`GET /html`

- Takes: URL
- Footprint: active (contacts the target)
- Cost: 1 to 50 credits depending on proxy and JS

Fetches the URL through a proxy, with JavaScript rendering by default. The target is contacted.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | query | string | yes | Page to fetch Example: https://example.com/ |
| `js` | query | boolean | no | Render JavaScript Example: true |
| `proxy` | query | string | no | Proxy type Example: datacenter One of: datacenter, residential, stealth, auto |
| `country` | query | string | no | Proxy country Example: us |
| `device` | query | string | no | Device type Example: desktop One of: desktop, mobile, tablet |
| `timeout` | query | integer | no | Timeout in ms, default 10000, max 25000 Example: 10000 |

Response fields:

- `(body)` (string): Raw HTML of the page

```bash
curl 'https://api.webscraping.ai/html?url=https%3A%2F%2Fexample.com%2F&api_key=YOUR_API_KEY'
```

Example response (200):

```
<html><head><title>Example Domain</title></head><body></body></html>
```

### Fetch a page and return its text.

`GET /text`

- Takes: URL
- Footprint: active (contacts the target)
- Cost: 1 to 50 credits depending on proxy and JS

Markdown for text_format=plain; for json or xml an object with title, description and content.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | query | string | yes | Page to fetch Example: https://example.com/ |
| `text_format` | query | string | no | Output format Example: json One of: plain, json, xml |
| `return_links` | query | boolean | no | Include links Example: false |

Response fields:

- `title` (string): Page title (json and xml formats)
- `description` (string): Page description (json and xml formats)
- `content` (string): Page text (json and xml formats)

```bash
curl 'https://api.webscraping.ai/text?url=https%3A%2F%2Fexample.com%2F&api_key=YOUR_API_KEY'
```

Example response (200):

```json
{
  "title": "Example Domain",
  "description": "An example page",
  "content": "Example text."
}
```

### Fetch a page and return the HTML of one CSS selector.

`GET /selected`

- Takes: URL
- Footprint: active (contacts the target)
- Cost: 1 to 50 credits depending on proxy and JS

Returns the HTML of the matched element.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | query | string | yes | Page to fetch Example: https://example.com/ |
| `selector` | query | string | yes | CSS selector Example: h1 |

Response fields:

- `(body)` (string): HTML of the matched element

```bash
curl 'https://api.webscraping.ai/selected?url=https%3A%2F%2Fexample.com%2F&selector=h1&api_key=YOUR_API_KEY'
```

Example response (200):

```
<h1>Example Domain</h1>
```

## AI

### Ask a question about a page and get a plain-text answer.

`GET /ai/question`

- Takes: URL
- Footprint: active (contacts the target)
- Cost: Page cost plus 5 credits

AI endpoints add 5 credits to the page cost.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | query | string | yes | Page to read Example: https://example.com/ |
| `question` | query | string | yes | Question about the page Example: What is this page about? |

Response fields:

- `(body)` (string): Plain-text answer

```bash
curl 'https://api.webscraping.ai/ai/question?url=https%3A%2F%2Fexample.com%2F&question=What%20is%20this%20page%20about%3F&api_key=YOUR_API_KEY'
```

Example response (200):

```
This page is an example domain used in documentation.
```

### Extract named fields from a page by instruction.

`GET /ai/fields`

- Takes: URL
- Footprint: active (contacts the target)
- Cost: Page cost plus 5 credits

fields is an object mapping field names to extraction instructions. Fields not found are null.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | query | string | yes | Page to read Example: https://example.com/ |
| `fields` | query | string | yes | Object of field name to extraction instruction Example: fields[title]=page title |

Response fields:

- `result` (object): Extracted values by field name; null if not found

```bash
curl 'https://api.webscraping.ai/ai/fields?url=https%3A%2F%2Fexample.com%2F&fields=fields%5Btitle%5D%3Dpage%20title&api_key=YOUR_API_KEY'
```

Example response (200):

```json
{
  "result": {
    "title": "Example Domain"
  }
}
```

## Search

### Get Google search results as JSON.

`GET /serp`

- Footprint: passive (the target is not contacted)
- Cost: 15 credits per results page

Google only. pages (1 to 5) is billed per page.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `q` | query | string | yes | Search query Example: example domain |
| `gl` | query | string | no | Country Example: us |
| `hl` | query | string | no | Language Example: en |
| `page` | query | integer | no | Results page, 1 to 100 Example: 1 |
| `pages` | query | integer | no | Number of pages, 1 to 5 Example: 1 |

Response fields:

- `organic_results[].position` (integer): Rank
- `organic_results[].title` (string): Result title
- `organic_results[].link` (string): Result URL
- `organic_results[].domain` (string): Result domain
- `organic_results[].snippet` (string): Result snippet
- `related_searches` (array): Related searches

```bash
curl 'https://api.webscraping.ai/serp?q=example%20domain&api_key=YOUR_API_KEY'
```

Example response (200):

```json
{
  "organic_results": [
    {
      "position": 1,
      "title": "Example Domain",
      "link": "https://example.com/",
      "domain": "example.com",
      "snippet": "An example page."
    }
  ]
}
```

## Account

### Show remaining credits and concurrency.

`GET /account`

- Footprint: passive (the target is not contacted)

Reports remaining credits, the reset time and remaining concurrency.

Response fields:

- `email` (string): Account email
- `remaining_api_calls` (integer): Remaining API calls
- `remaining_monthly_credits` (integer): Remaining monthly credits
- `remaining_payg_credits` (integer): Remaining pay-as-you-go credits
- `remaining_total_credits` (integer): Remaining total credits
- `resets_at` (string): When monthly credits reset
- `remaining_concurrency` (integer): Remaining concurrent requests

```bash
curl 'https://api.webscraping.ai/account?api_key=YOUR_API_KEY'
```

Example response (200):

```json
{
  "email": "jane@example.org",
  "remaining_api_calls": 900,
  "remaining_monthly_credits": 4500,
  "remaining_payg_credits": 0,
  "remaining_total_credits": 4500,
  "resets_at": "2026-12-01T00:00:00Z",
  "remaining_concurrency": 5
}
```

---

Listings on OSINTtools.io are reviewed by editors and re-verified on a schedule; check pricing and availability on the vendor's site before relying on them, and use OSINT tools only with a lawful basis.
Site index for agents: https://osinttools.io/llms.txt · Full catalog: https://osinttools.io/llms-full.txt · MCP server (Streamable HTTP, no auth): https://osinttools.io/mcp/
