AI Summary:
Oxylabs Web API gives applications and AI agents live web search and reliable data extraction at scale through an endpoint-based architecture – /search finds ranked URLs and /scrape gets page content. This guide covers getting an API key, running your first search-and-scrape request, and how to use AI agent integrations via Agent Skills and an MCP server.
Oxylabs Web API gives your application, or your AI agent, two things the open web makes surprisingly hard: finding the right, fresh pages, and extracting their data reliably at scale. One endpoint searches the live web, the other reads any page, renders JavaScript, and handles any web access challenges to hand back clean Markdown, HTML, JSON, or a screenshot.
In this guide, you will learn how to set up your Web API key, execute your first search and scrape queries, and how to configure it for custom implementations.
| Endpoint | Gives you | Use it when |
|---|---|---|
POST /v1/search |
Ranked results: title, snippet, URL | You don't know which page holds the answer |
POST /v1/scrape |
Full page content: Markdown, HTML, JSON, or a screenshot | You know the URL and need what's on it |
Start by heading to the Oxylabs Dashboard and create an account. If this is your first time with us, you’ll receive a $5 welcome credit to try Web API for free.
Then, click + Add product instance and select Web API. Finally, choose the instance name, if required – set product usage limits, and create the instance.

Open your Web API product instance from the dashboard home section. There, look for your new API key and instance username and password at the top of the overview. These credentials are your access to the Web API.

Finally, export your API key into your project environment (e.g. your OS terminal or the CLI terminal of the project workspace)
export OXYLABS_WEB_API_KEY=your_api_key_hereNote: Always keep your key server-side. Never commit it to source control or expose it in client-side code.
Now you have two options:
Plugging this into an AI agent (Claude Code, Cursor, or your own agent)? Skip to AI agent integrations to start using it with one command.
Building your own integration? Start the Manual Integration below.
The Web API operates on a core design pattern of search to find, scrape to extract. To start, find which pages hold the answer using POST /v1/search:
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}'Response example:
{
"state": "done",
"results": [
{
"title": "Implementation Timeline | EU Artificial Intelligence Act",
"overview": "Date 2 August 2025 Providers: need to be compliant by 2 August 2027...",
"url": "https://artificialintelligenceact.eu/implementation-timeline/",
"metadata": { "position": 1 }
}
]
}Learn more about /search endpoint in our documentation.
Search snippets (overview) returned from the /search endpoint are truncated. To extract the full, fresh content as clean "markdown" (or any preferred format, such as "json", "html", or a "screenshot"), pass the target URL to POST /v1/scrape with the chosen output value:
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"]}'Learn more about /scrape endpoint in our documentation.
Oxylabs Web API is designed for easy AI agent workflows using Agent Skills, MCP (Model Context Protocol) or simple one-prompt integrations. Once you have your API key, choose the integration method.
Self-host our official MCP server to expose multiple Web API tools using /search and /scrape endpoints directly to Claude Code, Cursor, or any MCP-friendly AI agent:
uv tool install git+https://github.com/oxylabs/web-api-mcpTo learn more about Web API MCP integration and its tools, see our documentation.
Add official agent skills that teach your AI agent how to search, scrape, cite sources, and handle web research through Oxylabs Web API:
npx skills add oxylabs/web-api-skillsNow your agent knows all there is to know about Oxylabs Web API and how to use it. To learn more about Web API agent skills, see our documentation.
If you want an AI coding assistant (like Cursor or Copilot) to build a whole integration for you straight from the chat, paste the following prompt:
"Integrate the Oxylabs Web API into this project for live web search and page reading. Read https://developers.oxylabs.io/products/web-api/for-agents.md and follow its reference code and retry rules. The API key is in OXYLABS_WEB_API_KEY. Execute a test search, scrape the top result as Markdown, and verify error handling."To see a full example and learn more about Web API integration, see our documentation.
Beyond the universal URL scraper (POST /v1/scrape), the Web API provides numerous scrapers for specific targets under POST /v1/scrape/{target}/{collection}. That includes search engines, AI & LLM sources, ecommerce sites, and media platforms.
POST /v1/scrape/amazon/product
{ "query": "B0935DN1BN", "output": ["json"], "domain": "de", "location": "10115", "currency": "EUR" }GET /v1/scrapers returns an up-to-date list of all currently available dedicated scrapers, which collect structured, pre-parsed JSON data.
Learn more about all available targets and their parameters in the API Reference in our documentation.
You can extract structured fields from any web page in the same request by setting output: ["json"] and providing a prompt or an OpenAPI schema under the json parameter.
Prompt example:
{
"url": "https://sandbox.oxylabs.io/products/1",
"output": ["json"],
"json": {
"prompt": "Parse the product title, price as a number, currency"
}
}OpenAPI Schema example:
{
"url": "https://sandbox.oxylabs.io/products/1",
"output": ["json"],
"json": {
"schema": {
"type": "object",
"properties": {
"title": { "type": "string" },
"price": { "type": "number" },
"in_stock": { "type": "boolean" }
},
"required": ["title", "price"]
}
}
}Important: AI Parsing adds extra credit price on top of the standard scraping cost.
By default, every request above runs in a synchronous realtime method, where the result comes back in the response. Once you're working with large-scale tasks with a chance of client timeout, we recommend asynchronous methods.
| Realtime | Async | Async + storage | |
|---|---|---|---|
| You get | Result in the response | A job ID to poll | A file delivered to your bucket |
| Wait | Seconds, held open | Your polling interval | No waiting |
| Timeout risk | Yes | None | None |
| Good for | One page, used immediately | Batches | Large payloads (media, screenshots) |
| Status | Meaning | Retry? |
|---|---|---|
400 |
Malformed request | No, fix the field named in errors[].pointer |
401 |
Bad or missing API key | No, check the key on your Web API instance |
429 |
Rate limit or spent quota | Rate limit: yes, with backoff. Quota: no |
5xx |
Upstream failure or failed to scrape | Yes, up to ~3 attempts with backoff |
Every response carries a request_id. Include it if you contact support. Learn more.
| Parameter | Type | Description |
|---|---|---|
query |
string | Search keyword or phrase |
max_results |
array | Number of organic search results to return (1-20) |
location |
string | 2-letter country code (e.g., "DE", "US") for localized search |
| Parameter | Type | Description |
|---|---|---|
url |
string | URL to scrape |
output |
array | Formats to return: "html" (default), "markdown", "json", "screenshot" (supports multiple outputs at once) |
json |
object | Used for custom AI parsing through prompt or schema |
location |
string | 2-letter country code (e.g., "DE", "US") for localized search |
run_js |
boolean | Enable JavaScript rendering. Requires 150s timeout. |
device |
string | Device emulation: "desktop" (default) or "mobile". |
The Usage section of your product instance lets you see detailed information on your Web API usage in any time range and check per-endpoint statistics. You can see usage graphs for any selected period and use finer filters.

Additionally, you check daily breakdowns for each endpoint usage and their success rates.

Billing is calculated per successful request (200 OK or 202 Accepted). Failed requests (4xx) and unsuccessful scraping jobs (500) are not charged from your account budget.


Adomas Sulcas
2026-10-05


Enrika Pavlovskytė
2026-10-05

One API for fresh public data
Find and extract real-time data from any public website at scale.
Get the latest news from data gathering world
One API for fresh public data
Find and extract real-time data from any public website at scale.