Dashboard

Universal Scraper

The Universal Scraping API provides advanced page unlocking and JavaScript rendering. Use it to bypass anti-bot protections, render JavaScript-heavy pages, and execute custom instructions.

Basic Usage

import { ScrayleClient } from '@scrayle/sdk';

const client = new ScrayleClient();

const result = await client.universal.scrape({
  actor: 'unlocker.webUnlocker',
  input: {
    url: 'https://protected-site.com',
    js: true,
  },
});

console.log(result);

JavaScript Instructions

Execute a sequence of actions on the page before extracting content:

const result = await client.universal.scrape({
  actor: 'unlocker.jsRender',
  input: {
    url: 'https://example.com/products',
    js: true,
    instructions: [
      { type: 'wait', value: 2000 },
      { type: 'click', selector: '.load-more' },
      { type: 'waitFor', selector: '.extra-items', timeout: 5000 },
      { type: 'fill', selector: '#search', value: 'laptop' },
      { type: 'evaluate', script: 'document.title' },
    ],
  },
});

Instruction Types

TypeParametersDescription
waitvalue (ms)Wait for a fixed duration
waitForselector, timeout?Wait for an element to appear
clickselectorClick an element
fillselector, valueType text into an input
evaluatescriptExecute JavaScript on the page

Available Scrapers

Scraper IDDescription
unlocker.webUnlockerBypass anti-bot protection and return page content
unlocker.jsRenderFull JavaScript rendering with instructions
unlocker.akamaiWebCookieGenerate Akamai web cookies
unlocker.akamaiWebSensorGenerate Akamai sensor data

Proxy Configuration

const result = await client.universal.scrape({
  actor: 'unlocker.webUnlocker',
  input: { url: 'https://example.com' },
  config: {
    proxy: {
      country: 'US',
      type: 'residential',
    },
    retries: 3,
    timeout: 30000,
  },
});

Content Output Types

The universal scraper can extract specific content types: