YepAPI
POST/v1/scrape/js

JavaScript Scraping API

Scrape JavaScript-rendered pages in headless Chrome. Click, scroll, fill forms, and wait for elements before capture. From $0.02/call.

Render pages in headless Chrome before extracting content, and script the browser first: click buttons, scroll, fill inputs, wait for elements, and run JavaScript. Built for SPAs on React, Vue, Angular, or any framework that renders client-side.

Try it live

Fill in the fields and hit Run to see a real response.

POST/v1/scrape/js

Optional. Steps run before capture: click, wait, wait_for, wait_for_and_click, scroll_x, scroll_y, fill, evaluate, infinite_scroll.

Optional. Capture once this CSS selector appears.

Response
Example response — hit "Send Request" to see a live result
{
  "ok": true,
  "data": {
    "url": "https://react.dev/",
    "statusCode": 200,
    "content": "# React\n\nThe library for web and native user interfaces...",
    "format": "markdown",
    "evaluateResults": [
      "React"
    ],
    "jsScenarioReport": {
      "total_duration": 1.84,
      "task_executed": 3,
      "task_success": 3,
      "task_failure": 0,
      "tasks": [
        {
          "task": "wait_for",
          "params": "main",
          "duration": 0.31,
          "success": true
        },
        {
          "task": "scroll_y",
          "params": 1000,
          "duration": 1.02,
          "success": true
        },
        {
          "task": "evaluate",
          "params": "document.title",
          "duration": 0.01,
          "success": true
        }
      ]
    }
  }
}

Features

✓
Full JavaScript execution in headless Chrome

Every call renders the page in headless Chrome and runs its client-side JavaScript before content is captured, so you get the content basic scrapers miss on framework-driven sites.

✓
Browser actions with js_scenario

Send a `js_scenario` with steps like `{"click":"#load-more"}`, `{"scroll_y":1000}`, `{"fill":["#q","shoes"]}`, `{"wait_for_and_click":".tab"}`, `{"infinite_scroll":{"max_count":0,"delay":1000}}`, or `{"evaluate":"document.title"}`. Results of evaluate steps come back in `evaluateResults`, with a per-step `jsScenarioReport`.

✓
Wait for an element or a delay

Set `wait_for_selector` to capture as soon as a specific element appears (a 400 is returned if it never does), or `wait_for` in milliseconds, up to 15,000.

✓
Mobile rendering and ad blocking

Render as a mobile device with `device: "mobile"` and set `block_ads: true` to skip ad scripts for faster, cleaner captures.

✓
Markdown, HTML, or text, with selector targeting

Get the rendered DOM back as markdown, HTML, or plain text, or narrow it to the first element matching a CSS or XPath `selector`.

Use cases

SPA Scraping

Scrape React, Vue, and Angular apps that render content client-side and return empty HTML to basic crawlers.

Dynamic Price Monitoring

Extract prices from e-commerce sites that load product data via JavaScript after the initial page load.

Social Media Scraping

Capture content from social platforms that rely heavily on JS rendering and infinite scroll.

Dashboard Data Extraction

Scrape web dashboards and reporting tools that build their UI entirely in JavaScript.

Web App Testing

Verify that your JS-rendered pages produce the correct content by scraping and comparing output.

Quick start

Copy this snippet and start making calls.

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",
    "js_scenario": {
      "instructions": [
        {
          "wait_for": "main"
        },
        {
          "scroll_y": 1000
        },
        {
          "evaluate": "document.title"
        }
      ]
    }
  }),
});
const data = await res.json();
console.log(data);

JavaScript Scraping API with a real headless browser

The YepAPI JavaScript Scraping API renders pages in a full headless Chrome instance before extracting their content. Modern sites built with React, Vue, or Angular often ship an empty HTML shell and build the page client-side — a basic scraper sees nothing. This endpoint executes the JavaScript first, then returns the fully rendered content as markdown, HTML, or text.

Use it when you need control over the browser: click a "load more" button, scroll an infinite feed, fill a search box, wait for a specific element, or run JavaScript and get the result back. The Web Scraping API's smart mode already renders JavaScript when a page needs it, at $0.01; for JS sites that also block automated traffic, the Stealth Scraping API runs the same browser on stealth residential proxies.

What is a headless browser API?

A headless browser API runs a real browser like Chrome on a server, without a visible window, and lets you control it through HTTP requests. It loads a URL, executes all the page's JavaScript exactly as a user's browser would, and then returns the resulting content. This matters because a growing share of the web renders content client-side — the HTML that arrives over the wire is nearly empty, and the actual text, prices, and listings are built by JavaScript afterward. A headless browser API captures that final, rendered state, so you can scrape single-page apps and dynamic sites that defeat simple HTTP fetchers.

Build your own JavaScript scraper

Point the endpoint at a React or Vue app, set `wait_for_selector` so async data finishes loading, and add a `js_scenario` to click tabs, scroll, or fill a search form before capture. That's the foundation for a price tracker on a JS-driven storefront, a monitor for a client-rendered dashboard, or a crawler for feeds that depend on infinite scroll. Use `evaluate` steps to pull values straight out of the page. No Puppeteer setup, no browser fleet to scale or patch: the rendering runs on our infrastructure.

JavaScript Scraping API pricing — from $0.02 per call

Headless rendering costs $0.02 per call, browser actions included, with no monthly minimum and no subscription. Failed calls are free. Browserless starts at $100/month. With YepAPI you pay per request and nothing else, so a low-volume project costs cents instead of a fixed monthly fee, while high-volume jobs scale linearly with usage.

When to use this instead of smart mode

The standard Web Scraping API already escalates to JavaScript rendering when a page needs it, at half the price. Choose this endpoint when you need to drive the browser: browser actions, waiting on a specific selector, mobile rendering, or ad blocking. Those options are only available here and on the Stealth Scraping API; sending them to /v1/scrape returns a 400 pointing you to /v1/scrape/js.

Try the JavaScript Scraping API free

Sign up for $5 in free credit with no credit card required — enough for 250 headless render calls. Test it against your toughest SPA and confirm you get the fully rendered content before spending anything.

Start making API calls in 30 seconds

$5 free credit on signup. No credit card required. Pay per call.

What developers say

“Switched from SerpAPI and cut our SERP costs by 80%. Same data quality, way simpler billing.”

Marcus T.

SEO Platform Founder

“One API key for AI models, SERP data, and web scraping. Saved us from managing 4 separate providers.”

Priya S.

Full-Stack Developer

“The $5 free credit let us prototype our entire rank tracking feature before committing. No other API does that.”

Jake R.

Indie Hacker

Frequently asked questions

Render pages in headless Chrome before extracting content, and script the browser first: click buttons, scroll, fill inputs, wait for elements, and run JavaScript. Built for SPAs on React, Vue, Angular, or any framework that renders client-side.

Each API call costs $0.02. No monthly minimums or subscriptions — you only pay for what you use.

Sign up for a free API key, then send a POST request to /v1/scrape/js. Check the code example above for a ready-to-use snippet in JavaScript, cURL, or Python.

YepAPI bundles SEO, AI, and web scraping APIs under one key with no monthly minimums. You get lower per-call pricing, a unified dashboard, and one billing account instead of managing multiple providers.

Ready to integrate?

Get your API key and start making calls in 30 seconds. $5 free credit on signup — no credit card required.

More Web Scraping endpoints