Web Scraping
JavaScript Scrape
Scrape JavaScript-rendered pages with a full headless browser.
POST
$0.02/call/v1/scrape/jsUsage
const res = await fetch('https://api.yepapi.com/v1/scrape/js', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ url: 'https://react.dev', format: 'markdown' }),
});
const { data } = await res.json();
console.log(data.content);curl -X POST https://api.yepapi.com/v1/scrape/js \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://react.dev", "format": "markdown"}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
url | string | Yes | URL to scrape | — |
format | string | No | Output format: markdown, html, text | "markdown" |
waitFor | number | No | Wait for JS to render (ms) | 0 |
selector | string | No | CSS selector to extract specific element | — |
Response
{
"ok": true,
"data": {
"url": "https://react.dev",
"statusCode": 200,
"content": "# React\n\nThe library for web and native user interfaces...",
"format": "markdown"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data | object | Response payload |
data.url | string | The URL that was scraped |
data.statusCode | number | HTTP status code returned by the target page |
data.content | string | Page content in the requested format (Markdown, HTML, or plain text) |
data.format | string | The output format used (markdown, html, or text) |
Under the Hood
Uses a full headless Chrome browser with JavaScript execution enabled. Ideal for SPAs built with React, Vue, Angular, or any framework that renders content client-side.