Getting Started
Parameter Explanation
Parameter | Type | Description |
---|---|---|
actor | string | A very important parameter, it represents a service. Click to view the scraper actor list information |
input | object | Parameters required by the actor to complete a data scraping task. |
proxy | object | The country field, use a proxy from this region to send requests. |
Task Success Description
- An HTTP code of 200 indicates that the task has been successful, and the response body is the data.
Task In Progress Description
- An HTTP code of 201 indicates that the task is being processed, please retrieve the task result through the taskId.
{"message": "task in progress", "taskId":"30681c8b-bfd3-48eb-a7c9-006e40b00591"}
Task Failure Description
- HTTP code 429, Too many requests.
- HTTP code 400, please check if the task parameters are valid.
- HTTP code 500, internal server error.
Request Example
Using Python to retrieve Google Search data
import json
import requests
def send_request():
host = "api.scrapeless.com"
url = f"https://{host}/api/v1/scraper/request"
token = "your_api_key"
headers = {
"x-api-token": token
"Content-Type": "application/json"
}
json_payload = json.dumps({
"actor": "scraper.google.search",
"input": {
"q": "Top news headlines",
"gl": "us",
"hl": "en",
"google_domain": "google.com"
}
})
response = requests.post(url, headers=headers, data=json_payload)
if response.status_code != 200:
print("Error:", response.status_code, response.text)
return
print("body", response.text)
if __name__ == "__main__":
send_request()