> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/api-reference/core-endpoints.md).

# Core Endpoints

Reference for Web API's two core endpoints, /search and /scrape — parameters, response schema, and examples.

### `POST /v1/search`

Ranked organic web results.

**Modes:** `sync` only

<table><thead><tr><th width="122">Parameter</th><th width="88.5">Type</th><th width="84.5">Required</th><th width="78.5">Default</th><th>Bounds / Schema</th><th>Description</th></tr></thead><tbody><tr><td><code>query</code></td><td>string</td><td>Yes</td><td>—</td><td><code>1</code> to <code>2048</code> chars</td><td>Keyword search phrase.</td></tr><tr><td><code>max_results</code></td><td>integer</td><td>No</td><td><code>10</code></td><td><code>1</code> to <code>20</code></td><td>Cap on organic search items to return.</td></tr><tr><td><code>location</code></td><td>string</td><td>No</td><td><code>null</code></td><td>ISO 3166-1 alpha-2</td><td>Country code for geo-targeted search rankings (e.g., <code>"DE"</code>).</td></tr></tbody></table>

#### **Example**

```bash
curl https://webapi.oxylabs.io/v1/search \
  -H "Authorization: Bearer $OXYLABS_WEB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "eu ai act compliance deadlines", "max_results": 3, "location": "DE"}'
```

#### **Response Schema**

{% code expandable="true" %}

```json
{
  "state": "done",
  "results": [
    {
      "title": "Implementation Timeline | EU Artificial Intelligence Act",
      "outline": "Date 2 August 2025 Providers: need to be compliant...",
      "url": "https://artificialintelligenceact.eu/implementation-timeline/",
      "metadata": {
        "position": 1
      }
    }
  ],
  "related_questions": [],
  "related_searches": [
    { "query": "ai act timeline" }
  ],
  "params": {
    "query": "eu ai act compliance deadlines",
    "location": "DE",
    "max_results": 3
  },
  "metadata": {
    "timestamp": 1787431568,
    "request_id": "1788875675880097469"
  }
}
```

{% endcode %}

<table><thead><tr><th width="193">Field</th><th width="111">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>state</code></td><td>string</td><td><code>done</code> or <code>faulted</code></td></tr><tr><td><code>results[]</code></td><td>array</td><td><code>title</code>, <code>outline</code>, <code>url</code>, <code>metadata.position</code></td></tr><tr><td><code>related_questions[]</code></td><td>array</td><td><code>question</code>, <code>title</code>, <code>snippet</code></td></tr><tr><td><code>related_searches[]</code></td><td>array</td><td><code>query</code></td></tr><tr><td><code>params</code></td><td>object</td><td>Request as executed, defaults filled in</td></tr><tr><td><code>metadata.request_id</code></td><td>string</td><td>—</td></tr></tbody></table>

### `POST /v1/scrape`

Extract and render any URL data.

**Modes:** `sync`, `async`, `batch`

<table><thead><tr><th width="130">Parameter</th><th width="97.5">Type</th><th width="87.5">Required</th><th width="105.5">Default</th><th>Bounds / Schema</th><th>Description</th></tr></thead><tbody><tr><td><code>url</code></td><td>string</td><td>Yes</td><td>—</td><td><code>max_len: 8192</code></td><td>Absolute HTTP/HTTPS target URL.</td></tr><tr><td><code>output</code></td><td>array</td><td>No</td><td><code>["html"]</code></td><td>enum: <code>html</code>, <code>markdown</code>, <code>json</code>, <code>screenshot</code></td><td>Requested document formats.</td></tr><tr><td><code>json</code></td><td>object</td><td>No</td><td><code>null</code></td><td><code>additionalProperties: false</code></td><td>Container for custom AI extraction instructions.</td></tr><tr><td><code>json.prompt</code></td><td>string</td><td>No</td><td><code>null</code></td><td><code>max_len: 8192</code></td><td>Natural-language extraction instructions for <code>output: ["json"]</code>.</td></tr><tr><td><code>json.schema</code></td><td>object</td><td>No</td><td><code>null</code></td><td><code>10</code> to <code>65535</code> chars</td><td>OpenAPI / JSON Schema object defining required JSON output shape.</td></tr><tr><td><code>location</code></td><td>string</td><td>No</td><td><code>null</code></td><td>ISO 3166-1 alpha-2</td><td>Country code for local proxy routing (e.g., <code>"US"</code>).</td></tr><tr><td><code>device</code></td><td>string</td><td>No</td><td><code>"desktop"</code></td><td><code>"desktop"</code>,<code>"mobile"</code></td><td>Emulated browser viewport.</td></tr><tr><td><code>run_js</code></td><td>boolean</td><td>No</td><td><code>false</code></td><td><code>true</code> | <code>false</code></td><td>Enables headless browser JavaScript rendering.</td></tr><tr><td><code>callback_url</code></td><td>string</td><td>No</td><td><code>null</code></td><td><code>max_len: 2048</code></td><td>Async routes only. Webhook URL for job completion notifications.</td></tr><tr><td><code>storage</code></td><td>object</td><td>No</td><td><code>null</code></td><td>—</td><td>Async routes only. Direct cloud bucket delivery configuration.</td></tr></tbody></table>

{% hint style="info" %}
Validation Rule: `json.prompt` and `json.schema` are mutually exclusive. Passing both returns an HTTP `400 Bad Request`. `output: ["screenshot"]` requires `run_js: true`.
{% endhint %}

#### **Example**

```bash
curl https://webapi.oxylabs.io/v1/scrape \
  -H "Authorization: Bearer $OXYLABS_WEB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://artificialintelligenceact.eu/implementation-timeline/", "output": ["markdown"]}'
```

#### **Response Schema**

{% code expandable="true" %}

```json
{
  "status": 200,
  "results": [
    {
      "html": null,
      "markdown": "# Implementation Timeline\n\nProviders need to be compliant...",
      "screenshot": null,
      "json": null,
      "metadata": {
        "page": 1,
        "run_js": false,
        "url": "https://artificialintelligenceact.eu/implementation-timeline/"
      }
    }
  ],
  "params": {
    "url": "https://artificialintelligenceact.eu/implementation-timeline/",
    "output": ["markdown"],
    "json": { "schema": null, "prompt": null },
    "location": null,
    "device": "desktop",
    "run_js": null
  },
  "metadata": {
    "timestamp": 1787431568,
    "request_id": "7503078851572948993"
  }
}
```

{% endcode %}

| Field                                                 | Type            | Description                                     |
| ----------------------------------------------------- | --------------- | ----------------------------------------------- |
| `status`                                              | integer         | HTTP status code                                |
| `results[].markdown` / `html` / `json` / `screenshot` | string / object | One populated per requested format, rest `null` |
| `results[].metadata.url`                              | string          | Final URL after redirects                       |
| `params`                                              | object          | Request as executed, defaults filled in         |
| `metadata.request_id`                                 | string          | —                                               |

{% hint style="info" %}
**Errors specific to this endpoint**: `400` on `json` output without a `json` object, or `screenshot` without `run_js: true`. See [Errors](https://claude.ai/products/web-api/errors.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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 following URL with the `ask` and `goal` query parameters:

```
GET https://developers.oxylabs.io/api-reference/core-endpoints.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

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.
