SDKs overview

scraperBox provides several official client libraries and code examples to facilitate interaction with its Web Scraping API. These SDKs and libraries are designed to simplify the process of sending web scraping requests, managing parameters like proxies, and handling responses. While the core API operates as a direct HTTP GET request, the provided client libraries abstract away some of the underlying network operations and response parsing, offering a more idiomatic experience within specific programming languages.

The primary function of these libraries is to construct the correct URL for the scraperBox API endpoint, including the target URL to be scraped, an API key, and any optional parameters such as country-specific proxies, premium proxies, or JavaScript rendering settings. By doing so, developers can integrate web scraping capabilities without manually URL-encoding parameters or implementing retry logic for transient network issues. The scraperBox documentation provides comprehensive guides and code samples across various languages, detailing how to implement these features.

While the API itself is language-agnostic, receiving and returning data typically in JSON or HTML formats, client libraries reduce boilerplate code. This approach aligns with common practices in API development, where platform providers offer tools to enhance the developer experience. For example, similar client libraries are offered by platforms like Stripe for payment processing or Google Maps Platform for geospatial services, simplifying complex API calls into function calls within an application's codebase.

Official SDKs by language

scraperBox offers official client libraries and detailed code examples for several popular programming languages. These resources are maintained by scraperBox to ensure compatibility and provide a consistent interface for accessing their Web Scraping API. The official support covers a range of languages, addressing a broad developer audience.

The following table outlines the officially supported languages, their corresponding packages or typical usage, and general installation methods:

Language Package / Method Common Installation Command Maturity
Python requests library & URL construction pip install requests Stable
Node.js axios or node-fetch & URL construction npm install axios or npm install node-fetch Stable
PHP GuzzleHttp/guzzle & URL construction composer require guzzlehttp/guzzle Stable
Ruby net/http or httparty & URL construction gem install httparty Stable
Go net/http package & URL construction (No specific package install, standard library used) Stable
Java java.net.http or Apache HttpClient & URL construction (Add dependency via Maven/Gradle for Apache HttpClient) Stable
cURL Direct command-line utility (Typically pre-installed on Unix-like systems) Stable

Installation

Installation for scraperBox SDKs primarily involves installing standard HTTP client libraries for your chosen programming language and then constructing the API request URL according to scraperBox's specifications. scraperBox itself does not distribute a standalone package for each language, but rather provides comprehensive documentation on how to use existing, widely-adopted HTTP client libraries to interact with their API.

Python

For Python, the requests library is commonly used due to its user-friendly API for making HTTP requests. To install it, use pip:

pip install requests

After installation, you can import requests and use it to send GET requests to the scraperBox API endpoint.

Node.js

Node.js developers typically use axios or the built-in node-fetch (for newer Node.js versions) for HTTP requests. To install axios:

npm install axios

Or for node-fetch if not available natively:

npm install node-fetch

Once installed, these libraries can be used to perform asynchronous HTTP GET requests to the scraperBox API.

PHP

In PHP environments, Guzzle is a popular HTTP client. Install it via Composer:

composer require guzzlehttp/guzzle

This command adds Guzzle to your project, allowing you to create client instances and send requests.

Ruby

Ruby projects can utilize the standard net/http library or a gem like httparty for simpler syntax. To install httparty:

gem install httparty

This command makes the httparty gem available for use in your Ruby applications.

Go

Go applications typically use the standard library's net/http package, which is included with Go installations. No external package installation is usually required for basic HTTP requests.

Java

Java developers can use the built-in java.net.http client (available since Java 11) or external libraries like Apache HttpClient. For Apache HttpClient, you would add a dependency to your build system (e.g., Maven or Gradle):

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.5.13</version> <!-- Use the latest stable version -->
</dependency>

Quickstart example

The following examples demonstrate how to make a basic request to the scraperBox API using common HTTP client libraries. Replace YOUR_API_KEY with your actual scraperBox API key and https://example.com with the URL you intend to scrape. These examples fetch the HTML content of the target URL.

Python Example

import requests

api_key = "YOUR_API_KEY"
target_url = "https://example.com"

params = {
    'api_key': api_key,
    'url': target_url,
    # 'country_code': 'us', # Optional: uncomment for specific country proxy
    # 'premium_proxy': True # Optional: uncomment for premium proxy
}

response = requests.get('https://api.scraperbox.com/scrape', params=params)

if response.status_code == 200:
    print(response.text)
else:
    print(f"Error: {response.status_code} - {response.text}")

Node.js Example

const axios = require('axios');

const apiKey = "YOUR_API_KEY";
const targetUrl = "https://example.com";

const params = new URLSearchParams({
    api_key: apiKey,
    url: targetUrl,
    // country_code: 'us', // Optional: uncomment for specific country proxy
    // premium_proxy: true // Optional: uncomment for premium proxy
});

axios.get(`https://api.scraperbox.com/scrape?${params.toString()}`)
    .then(response => {
        if (response.status === 200) {
            console.log(response.data);
        } else {
            console.error(`Error: ${response.status} - ${response.statusText}`);
        }
    })
    .catch(error => {
        console.error(`Request failed: ${error.message}`);
    });

PHP Example

<?php
require 'vendor/autoload.php';

use GuzzleHttp\Client;

$apiKey = "YOUR_API_KEY";
$targetUrl = "https://example.com";

$client = new Client();

try {
    $response = $client->request('GET', 'https://api.scraperbox.com/scrape', [
        'query' => [
            'api_key' => $apiKey,
            'url' => $targetUrl,
            // 'country_code' => 'us', // Optional: uncomment for specific country proxy
            // 'premium_proxy' => true // Optional: uncomment for premium proxy
        ]
    ]);

    if ($response->getStatusCode() == 200) {
        echo $response->getBody();
    } else {
        echo "Error: " . $response->getStatusCode() . " - " . $response->getReasonPhrase();
    }
} catch (GuzzleHttp\Exception\GuzzleException $e) {
    echo "Request failed: " . $e->getMessage();
}
?>

Community libraries

As of 2026, scraperBox primarily focuses on providing official documentation and code examples for integration rather than formally endorsing or maintaining community-contributed SDKs or wrappers. Developers are encouraged to use the provided API specifications and their preferred HTTP client libraries to build custom integrations. This approach allows greater flexibility for developers to adapt the scraping functionality to their specific project requirements and technology stacks without being tied to a specific community-maintained library that might have varying levels of support or feature parity.

The design of the scraperBox API, which relies on standard HTTP GET requests with URL parameters, inherently makes it straightforward to interact with using any programming language or environment that can make web requests. This simplicity reduces the immediate need for complex, layered client libraries, as core functionality can be achieved with minimal code using well-established HTTP clients. Developers may find various unofficial code snippets or partial integrations shared on platforms like GitHub or Stack Overflow, but these should be evaluated independently for their functionality, security, and maintenance status. Users should refer to the official scraperBox documentation for the most accurate and up-to-date methods for interacting with the API.