Lesson 01
Getting started with ScraperAPI
ScraperAPI is a single HTTP endpoint. You send it a target URL and your API key, and it returns the fetched page. That's the whole mental model.
The base endpoint
Every request in this course goes to the same URL:
https://api.scraperapi.com/
You pass two things: your api_key and the target url you want fetched. ScraperAPI handles the outbound request for you and returns the response.
Required parameters
| Name | Type | Description |
|---|---|---|
| api_key | string | Your ScraperAPI key. Sign up on scraperapi.com to get one. |
| url | string | The fully qualified URL you want ScraperAPI to fetch. Include the protocol. |
Your first request
Pick your language and run it. Replace YOUR_API_KEY first.
curl "https://api.scraperapi.com/?api_key=YOUR_API_KEY&url=https://example.com"import requests
r = requests.get(
"https://api.scraperapi.com/",
params={"api_key": "YOUR_API_KEY", "url": "https://example.com"},
timeout=70,
)
print(r.text)import axios from "axios";
const { data } = await axios.get("https://api.scraperapi.com/", {
params: { api_key: "YOUR_API_KEY", url: "https://example.com" },
});
console.log(data);Heads up
Always URL-encode the target URL when you build the request string by hand. Every HTTP client above does that for you automatically when you pass parameters as an object.