# SDKs

The ScraperAPI SDKs make it easy to use our API from your preferred programming language with minimal setup and maximum reliability.

### Setup

Install the SDK that you prefer to use

{% tabs %}
{% tab title="Python" %}

```bash
pip install scraperapi-sdk
```

{% endtab %}

{% tab title="NodeJS" %}

```bash
npm install scraperapi-sdk --save
```

{% endtab %}

{% tab title="PHP" %}

```bash
composer require scraperapi/sdk
```

{% endtab %}

{% tab title="Ruby" %}

```bash
gem install scraperapi
```

{% endtab %}

{% tab title="Java" %}

```bash
# This example uses Maven for dependency management. Make sure you're familiar with Maven before continuing.
https://search.maven.org/artifact/com.scraperapi/sdk/1.2
```

{% endtab %}
{% endtabs %}

Integrate it into your code

{% tabs %}
{% tab title="Python" %}

```python
# Remember to install the library pip install scraperapi-sdk
from scraperapi_sdk import ScraperAPIClient
client = ScraperAPIClient('API_KEY')
result = client.get(url = 'https://example.com/')
print(result)
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
// remember to install the library: npm install scraperapi-sdk --save
import ScraperAPIClient from 'scraperapi-sdk';
const scraperapiClient = new ScraperAPIClient('API_KEY');

scraperapiClient.get('https://example.com/')
  .then(response => {
    console.log(response);
  })
  .catch(error => {
    console.error(error);
  });
```

{% endtab %}

{% tab title="PHP" %}

```php
# remember to install the library: composer require scraperapi/sdk
<?php
require __DIR__ . '/vendor/autoload.php';
use ScraperAPI\Client;

$client = new Client("API_KEY");
$result = $client->get("https://example.com/")->raw_body;

echo $result;
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
# remember to install the library: gem install scraperapi
require "scraper_api"

client = ScraperAPI::Client.new("API_KEY")
result = client.get("https://example.com/").raw_body
puts result
```

{% endtab %}

{% tab title="Java" %}

```java
// remember to install the library: https://search.maven.org/artifact/com.scraperapi/sdk/1.2
package com.example;
import com.scraperapi.ScraperApiClient;
public class Main {
    public static void main(String[] args) {
      ScraperApiClient client = new ScraperApiClient("API_KEY");
      String result = client.get("https://example.com/").result();

      System.out.println(result);
    }
}
```

{% endtab %}
{% endtabs %}

To enable extra functionality while using our SDKs, add an additional parameter to the GET request

{% tabs %}
{% tab title="Python" %}

```python
# Remember to install the library pip install scraperapi-sdk
from scraperapi_sdk import ScraperAPIClient
client = ScraperAPIClient('API_KEY')
result = client.get(url = 'https://example.com/', params={'render': True})
print(result)
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
// remember to install the library: npm install scraperapi-sdk --save
import ScraperAPIClient from 'scraperapi-sdk';
const scraperapiClient = new ScraperAPIClient('API_KEY');

scraperapiClient.get('https://example.com/', {render: true})
  .then(response => {
    console.log(response);
  })
  .catch(error => {
    console.error(error);
  });
```

{% endtab %}

{% tab title="PHP" %}

```php
# remember to install the library: composer require scraperapi/sdk
<?php
require __DIR__ . '/vendor/autoload.php';
use ScraperAPI\Client;

$client = new Client("API_KEY");
$result = $client->get("https://example.com/", ["render" => true])->raw_body;

echo $result;
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
# remember to install the library: gem install scraperapi
require "scraper_api"

client = ScraperAPI::Client.new("API_KEY")
result = client.get("https://example.com/", render: true).raw_body
puts result
```

{% endtab %}

{% tab title="Java" %}

```java
ScraperApiClient client = new ScraperApiClient("API_KEY");
String result = client.get("https://example.com/")
    .render(true)
    .result();
```

{% endtab %}
{% endtabs %}

Use two or more parameters

{% tabs %}
{% tab title="Python" %}

```python
# Remember to install the library pip install scraperapi-sdk
from scraperapi_sdk import ScraperAPIClient
client = ScraperAPIClient('API_KEY')
result = client.get(url = 'https://example.com/', params={'render': True, 'premium': True})
print(result)
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
// remember to install the library: npm install scraperapi-sdk --save
import ScraperAPIClient from 'scraperapi-sdk';
const scraperapiClient = new ScraperAPIClient('API_KEY');
const params = {render: true, country_code: 'us'};

scraperapiClient.get('https://example.com/', params)
  .then(response => {
    console.log(response);
  })
  .catch(error => {
    console.error(error);
  });
```

{% endtab %}

{% tab title="PHP" %}

```php
# remember to install the library: composer require scraperapi/sdk
<?php
require __DIR__ . '/vendor/autoload.php';
use ScraperAPI\Client;

$client = new Client("API_KEY");
$result = $client->get("https://example.com/", ["render" => true, "country_code" => "us"])->raw_body;

echo $result;
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
# remember to install the library: gem install scraperapi
require "scraper_api"

client = ScraperAPI::Client.new("API_KEY")
result = client.get("https://example.com/", render: true, country_code: "us").raw_body
puts result
```

{% endtab %}

{% tab title="Java" %}

```java
ScraperApiClient client = new ScraperApiClient("API_KEY");
String result = client.get("https://example.com/")
    .render(true)
    .country_code("us")
    .result();
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.scraperapi.com/resources/sdks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
