Quick Start Guide

Get up and running with ScrapeRex in under 5 minutes. This guide will walk you through making your first API request.

Step 1: Get Your API Key

First, you'll need an API key. Sign up on RapidAPI to get your free API key with 100 requests per month.

Step 2: Make Your First Request

The simplest way to use ScrapeRex is with the /scrape endpoint. Here's how to fetch the HTML content of a webpage:

Using cURL

Terminal
curl -X POST https://scraperex1.p.rapidapi.com/scrape \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: scraperex1.p.rapidapi.com" \
  -d '{
    "url": "https://httpbin.org/html"
  }'

Using Python

scrape.py
import requests

url = "https://scraperex1.p.rapidapi.com/scrape"

payload = {"url": "https://httpbin.org/html"}
headers = {
    "Content-Type": "application/json",
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "scraperex1.p.rapidapi.com"
}

response = requests.post(url, json=payload, headers=headers)
data = response.json()

print(data["body"])  # HTML content

Using JavaScript

scrape.js
const response = await fetch('https://scraperex1.p.rapidapi.com/scrape', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-RapidAPI-Key': 'YOUR_API_KEY',
    'X-RapidAPI-Host': 'scraperex1.p.rapidapi.com'
  },
  body: JSON.stringify({
    url: 'https://httpbin.org/html'
  })
});

const data = await response.json();
console.log(data.body);  // HTML content

Step 3: Understanding the Response

A successful response looks like this:

response.json
{
  "status": "ok",
  "body": "<!DOCTYPE html>...",
  "statusCode": 200,
  "headers": {
    "content-type": "text/html; charset=utf-8"
  }
}
FieldDescription
status"ok" for success, "fail" for errors
bodyThe HTML content of the page
statusCodeHTTP status code from the target website
headersResponse headers from the target website

Step 4: Try JavaScript Rendering

For websites that require JavaScript to render content, use the /scrapeJs endpoint:

request.json
{
  "url": "https://example.com",
  "waitFor": 2000,
  "screenshot": true
}

Next Steps