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 Keyurl- target URL
curl --request GET \
--url 'https://api.scraperapi.com?api_key=API_KEY&url=https://www.example.com'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)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);
});After the API processes the request, it will return the HTML response for the target URL that you specify.
<!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 section to find out more.
Last updated

