YepAPI
Web Scraping

Stealth Scraping API

Stealth Scraping API — scrape heavily protected sites with headless Chrome on stealth residential proxies, with country targeting and browser scripting. $0.03 per call.

Pricing, live playground and use cases: Stealth Scraping API on YepAPI

POST/v1/scrape/stealth
$0.03/call

The Stealth Scraping API loads the page in headless Chrome over stealth residential proxies, built for sites with aggressive anti-bot protection that block both plain fetches and ordinary headless browsers. Pick the proxy country with country to see localized prices and content, and use the same browser options as the JavaScript Scrape API — js_scenario, wait_for_selector, device, and block_ads.

Try the Web Scraping API first: its smart mode already escalates to premium proxies, and it costs less. Switch to stealth when it returns 502 UPSTREAM_ERROR for a site.

Usage

const res = await fetch('https://api.yepapi.com/v1/scrape/stealth', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    url: 'https://protected-site.com/pricing',
    country: 'de',
    wait_for_selector: '.pricing-table',
  }),
});
const { data } = await res.json();
console.log(data.content);
curl -X POST https://api.yepapi.com/v1/scrape/stealth \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://protected-site.com/pricing", "country": "de", "wait_for_selector": ".pricing-table"}'
import requests

res = requests.post(
    "https://api.yepapi.com/v1/scrape/stealth",
    headers={"x-api-key": "YOUR_API_KEY"},
    json={"url": "https://protected-site.com/pricing", "country": "de", "wait_for_selector": ".pricing-table"},
)
print(res.json()["data"]["content"])

Request Body

ParameterTypeRequiredDescriptionDefault
urlstringYesFull http(s) URL of the page to scrape (max 4096 characters). Localhost and private IPs are rejected—
formatstringNoOutput format. One of: markdown, html, textmarkdown
selectorstringNoCSS or XPath selector. Returns only the first matching element — its HTML when format is html, otherwise its text (max 500 characters)—
countrystringNo2-letter country code for the proxy location, e.g. us, de, gb—
wait_fornumberNoExtra milliseconds to wait after the page loads, max 15000—
wait_for_selectorstringNoCSS selector to wait for before capturing. Returns 400 if it never appears (max 500 characters)—
js_scenarioobjectNoBrowser actions to run before capture: {"instructions": [...]} or the bare array. Same instructions as JS Scrape except infinite_scroll (max 8000 characters)—
devicestringNoBrowser profile. One of: desktop, mobiledesktop
block_adsbooleanNoBlock ads and trackersfalse

camelCase aliases are also accepted: waitFor, waitForSelector, jsScenario, blockAds.

Info

infinite_scroll is not available on stealth — sending it returns a 400. Use scroll_y steps with short waits, or use /v1/scrape/js if the site allows it.

Response

{
  "ok": true,
  "data": {
    "url": "https://protected-site.com/pricing",
    "statusCode": 200,
    "content": "# Pricing\n\n## Starter\n29 € / month\n\n## Pro\n79 € / month\n\n...",
    "format": "markdown"
  }
}

Response Fields

FieldTypeDescription
okbooleanWhether the request succeeded
data.urlstringFinal URL after redirects
data.statusCodenumberHTTP status code the target page returned
data.contentstringThe page (or the selector match) in the requested format. Empty string if selector matched nothing
data.formatstringThe format used: markdown, html, or text
data.evaluateResultsarrayOne result per evaluate instruction. Only present when js_scenario has evaluate steps
data.jsScenarioReportobjectPer-step report of the scenario (total_duration, task_executed, task_success, task_failure, tasks[]). Only present when js_scenario was sent

Caching

Results are cached for 1 hour per URL and option set (including country). Repeating the same request within that window returns the cached page.

Errors

StatusCodeWhen
400VALIDATION_ERRORurl is missing, invalid, or private; format / device / country is invalid; wait_for is over 15000; js_scenario is malformed, too long, uses infinite_scroll, or has an invalid instruction; wait_for_selector never matched; or the URL is a Google page (use /v1/serp/google)
404NOT_FOUNDThe target page returned 404 Not Found
429RATE_LIMITED_UPSTREAMToo many scrapes in flight — retry in a few seconds
502UPSTREAM_ERRORThe site blocked the request or failed to load — retry
503UPSTREAM_TIMEOUTThe page took too long to load (about 25 seconds) — retry

Failed calls are not charged.

On this page