Skip to main content

Quick Start

Python Node

Get up and running with Rocket Scraper in minutes. This guide will walk you through making your first API request and understanding the basics of web scraping with our platform.

Prerequisites

  • A Rocket Scraper account (sign up here)
  • Your API key (find it here)
  • A valid subscription plan
  • Basic knowledge of HTTP requests

Installation

First, install our SDK for your preferred language:

pip install rocketscraper

Making Your First Request

Here's a simple example that scrapes a product title and price from a webpage:

from rocketscraper import RocketClient

try:
client = RocketClient('YOUR_API_KEY')

schema = {
"title": "string",
"price": "number",
"description": "string",
"inStock": "boolean"
}

result = client.scrape('https://example.com/product', schema)
print(result)
except Exception as e:
print(f"Error: {e}")

Understanding the Schema

The schema defines the structure of the data you want to extract. Supported data types include:

TypeDescription
booleanRepresents a true or false value
integerRepresents an integer value
numberRepresents any numeric value, including integers and floating-point numbers
stringRepresents a sequence of characters
arrayRepresents an ordered list of items
objectRepresents a JSON object, which is a collection of key-value pairs

Example Response

{
"title": "Premium Coffee Maker",
"price": 99.99,
"description": "Professional-grade coffee maker with temperature control",
"inStock": true
}

Next Steps