For the complete documentation index, see llms.txt. This page is also available as Markdown.

Quick Start: Web API

Get from an API key to your first Oxylabs Web API search and scrape in just five minutes.

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. One endpoint searches the live web and the other scrapes any page (rendering JavaScript and handling access challenges) and hands back clean data ready for use.

Endpoint
Gives you
Use it when

Ranked results: title, description, URL

You don't know which page holds the answer

One page as Markdown, HTML, JSON or a screenshot

You know the URL and need what's on it

They are designed to be used together: search to find, scrape to extract. This quick start guide covers:

  • Manual integration – your own code calling the API directly.

  • Easy AI integration – using the Web API through a proprietary or your custom AI agent.

Setup & API key

  1. Create an account: Sign up at the Oxylabs Dashboard.

  2. Add a product instance: Click + Add product instance and select Web API in the Web access category.

  3. Set up: Choose the instance name, product usage limits (optional), and create the instance.

  4. Get credentials: Click on the Web API instance in the dashboard home instance table and get your API key.

  5. Export your API key into your project environment (e.g. your OS terminal or the CLI terminal in the project workspace):

export OXYLABS_WEB_API_KEY=your_api_key_here

Note: Always keep your key server-side. Never commit it to source control or expose it in client-side code.

Web API integration

Plugging this into an AI agent?

Skip to AI agent integrations to start using it with one command.

Building your own custom integration?

Start the manual integration below.

Manual integration

Depending on your data needs, you can use the Web API endpoints separately for web search, scraping, or as full data collection and delivery pipeline.

1

Find which pages hold the answer to your defined query:

Output sample
2

Scrape a page (/scrape)

Scrape full page content from any public website by passing the target url and the desired output format (markdown, html, json, screenshot). Here's a request for page content in Markdown:

3

Full pipeline (search-to-scrape)

outline found in /search is a list of truncated snippets and often not useful for advanced use cases or AI workflows.

To get structured data from a single query, search the web with /search for relevant data according to your query and pass the result URL to /scrape for data retrieval. Here's a full working Python example:

Everything above is realtime – the result comes back in the response. For high volume data collection we recommend running scrapers as jobs under /v1/async/scrape and deliver by polling, callback or straight to your bucket. See Delivery modes.

AI agent integration

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.

One-page integration prompt – paste a prompt into a coding agent and have it build a custom integration for you.

If you want an AI coding assistant (like Claude Code, Cursor, or Copilot) to build an integration for you, paste the following prompt:

See a full example and learn more about Web API integration in the documentation.

Agent skills – installs the knowledge on how to use the API, no running server required.

Add official agent skills that teach your AI agent how to search, scrape, cite sources, and handle web research through Oxylabs Web API using the following terminal command:

Now 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.

MCP server – typed tools for search, scrape, and dedicated scrapers for any MCP client.

Connect to or self-host our official MCP server to expose Web API search, scrape, and extract tools directly to Claude Code, Cursor, or your custom AI agent.

For easiest implementation, add the server to your client by pointing your agent to the Oxylabs-hosted server – https://mcp.oxylabs.io/web-api-mcp:

Claude Code
ChatGPT/Codex
Cursor (or other clients supporting custom headers)

For any client that supports remote MCP servers with custom headers, add the server URL and an Authorization header to the client's MCP configuration. For example, in Cursor's mcp.json:

Field names can differ between clients – check your client's documentation for how to add a remote MCP server with headers.

To learn more about Web API MCP integration or how to self-host the official Oxylabs server server, see MCP servers.

Essential parameters

/search

Parameter
Type
Description

query

string

Search keyword or phrase

max_results

integer

Number of organic search results to return (1-20)

location

string

2-letter country code (e.g., "DE", "US") for localized search

/scrape

Parameter
Type
Description

url

string

URL to scrape

output

array

Formats to return: "html" (default), "markdown", "json", "screenshot"

json

object

Used for custom AI parsing through prompt or schema

location

string

2-letter country code (e.g., "DE", "US"). Some dedicated scrapers use a different format. See Dedicated Scrapers.

run_js

boolean

Renders the page in a real browser before capturing content. Slower, use a client timeout of 150s or more.

device

string

Device emulation: "desktop" (default) or "mobile".

Common response codes

Status
Meaning
Retry?

200 / 202

Success. Realtime / async job accepted

–

400

Malformed request

No, fix the field named in errors[].pointer.

401

Authentication error (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.

See all response codes to learn about all status codes and find troubleshooting tips.

Next steps

Last updated

Was this helpful?