# Send your First Request

Now that you've got your API Key, you are ready to start sending requests. Let's start off by sending a `GET` request to `https://api.scraperapi.com` with the following mandatory parameters:

* `api_key` - your API Key
* `url` - target URL

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

```bash
curl --request GET \
--url 'https://api.scraperapi.com?api_key=API_KEY&url=https://www.example.com'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

#Target URL
target_url = 'https://www.example.com'
# ScraperAPI API Key
api_key = 'API_KEY'

request_url = f'https://api.scraperapi.com?api_key={api_key}&url={target_url}'
response = requests.get(request_url)

print(response.text)
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
import request from 'node-fetch';

//Replace the value for api_key with your actual API Key
const url = 'http://api.scraperapi.com/?api_key=API_KEY&url=https://example.com/';

request(url)
  .then(response => {
    console.log(response);
  })
  .catch(error => {
    console.error(error);
  });
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

//Replace the value for api_key with your actual API Key
$url = "http://api.scraperapi.com?api_key=API_KEY&url=https://example.com/";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'Curl error: ' . curl_error($ch);
} else {
    print_r($response);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'
require 'json'

#Replace the value for api_key with your actual API Key
params = {
  api_key: "API_KEY",
  url: "https://www.example.com/"
}

uri = URI('https://api.scraperapi.com/')
uri.query = URI.encode_www_form(params)

website_content = Net::HTTP.get(uri)
print website_content
```

{% endtab %}

{% tab title="Java" %}

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        //Replace the value for api_key with your actual API Key
        String apiKey = "API_KEY";
        String targetUrl = "https://www.example.com/";

        String scraperApiUrl = "https://api.scraperapi.com?api_key=" + apiKey + "&url=" + targetUrl;

        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create(scraperApiUrl))
                .GET()
                .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());

        System.out.println(response.body());
    }
}
```

{% endtab %}
{% endtabs %}

After the API processes the request, it will return the HTML response for the target URL that you specify.&#x20;

```json
<!doctype html>
<html>
<head>
//<---truncated for better readability--->
</head>
<body>
<div>
    <h1>Example Domain</h1>
    <p>This domain is for use in illustrative examples in documents. You may use this
    domain in literature without prior coordination or asking for permission.</p>
    <p><a href="https://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>
```

The example above demonstrates a basic request and just scratches the surface. ScraperAPI supports a list of parameters, that allow you to customize your requests: enable JS rendering, set geolocation, enable premium proxies and more. Refer to [this](/control-and-optimization/supported-parameters.md) section to find out more.


---

# 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/getting-started/quick-start/send-your-first-request.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.
