curl --request POST \
--url https://api.olostep.com/v1/scrapes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url_to_scrape": "<string>",
"wait_before_scraping": 123,
"formats": [],
"actions": [
{
"type": "wait",
"milliseconds": 1
}
],
"country": "<string>",
"remove_images": false,
"remove_class_names": [
"<string>"
],
"llm_extract": {
"schema": {}
},
"links_on_page": {
"query_to_order_links_by": "<string>",
"include_links": [
"<string>"
],
"exclude_links": [
"<string>"
]
},
"screen_size": {
"screen_width": 123,
"screen_height": 123
},
"screenshot": {
"full_page": true
},
"metadata": {},
"max_age": 0
}
'import requests
url = "https://api.olostep.com/v1/scrapes"
payload = {
"url_to_scrape": "<string>",
"wait_before_scraping": 123,
"formats": [],
"actions": [
{
"type": "wait",
"milliseconds": 1
}
],
"country": "<string>",
"remove_images": False,
"remove_class_names": ["<string>"],
"llm_extract": { "schema": {} },
"links_on_page": {
"query_to_order_links_by": "<string>",
"include_links": ["<string>"],
"exclude_links": ["<string>"]
},
"screen_size": {
"screen_width": 123,
"screen_height": 123
},
"screenshot": { "full_page": True },
"metadata": {},
"max_age": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url_to_scrape: '<string>',
wait_before_scraping: 123,
formats: [],
actions: [{type: 'wait', milliseconds: 1}],
country: '<string>',
remove_images: false,
remove_class_names: ['<string>'],
llm_extract: {schema: {}},
links_on_page: {
query_to_order_links_by: '<string>',
include_links: ['<string>'],
exclude_links: ['<string>']
},
screen_size: {screen_width: 123, screen_height: 123},
screenshot: {full_page: true},
metadata: {},
max_age: 0
})
};
fetch('https://api.olostep.com/v1/scrapes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.olostep.com/v1/scrapes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url_to_scrape' => '<string>',
'wait_before_scraping' => 123,
'formats' => [
],
'actions' => [
[
'type' => 'wait',
'milliseconds' => 1
]
],
'country' => '<string>',
'remove_images' => false,
'remove_class_names' => [
'<string>'
],
'llm_extract' => [
'schema' => [
]
],
'links_on_page' => [
'query_to_order_links_by' => '<string>',
'include_links' => [
'<string>'
],
'exclude_links' => [
'<string>'
]
],
'screen_size' => [
'screen_width' => 123,
'screen_height' => 123
],
'screenshot' => [
'full_page' => true
],
'metadata' => [
],
'max_age' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.olostep.com/v1/scrapes"
payload := strings.NewReader("{\n \"url_to_scrape\": \"<string>\",\n \"wait_before_scraping\": 123,\n \"formats\": [],\n \"actions\": [\n {\n \"type\": \"wait\",\n \"milliseconds\": 1\n }\n ],\n \"country\": \"<string>\",\n \"remove_images\": false,\n \"remove_class_names\": [\n \"<string>\"\n ],\n \"llm_extract\": {\n \"schema\": {}\n },\n \"links_on_page\": {\n \"query_to_order_links_by\": \"<string>\",\n \"include_links\": [\n \"<string>\"\n ],\n \"exclude_links\": [\n \"<string>\"\n ]\n },\n \"screen_size\": {\n \"screen_width\": 123,\n \"screen_height\": 123\n },\n \"screenshot\": {\n \"full_page\": true\n },\n \"metadata\": {},\n \"max_age\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.olostep.com/v1/scrapes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url_to_scrape\": \"<string>\",\n \"wait_before_scraping\": 123,\n \"formats\": [],\n \"actions\": [\n {\n \"type\": \"wait\",\n \"milliseconds\": 1\n }\n ],\n \"country\": \"<string>\",\n \"remove_images\": false,\n \"remove_class_names\": [\n \"<string>\"\n ],\n \"llm_extract\": {\n \"schema\": {}\n },\n \"links_on_page\": {\n \"query_to_order_links_by\": \"<string>\",\n \"include_links\": [\n \"<string>\"\n ],\n \"exclude_links\": [\n \"<string>\"\n ]\n },\n \"screen_size\": {\n \"screen_width\": 123,\n \"screen_height\": 123\n },\n \"screenshot\": {\n \"full_page\": true\n },\n \"metadata\": {},\n \"max_age\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olostep.com/v1/scrapes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url_to_scrape\": \"<string>\",\n \"wait_before_scraping\": 123,\n \"formats\": [],\n \"actions\": [\n {\n \"type\": \"wait\",\n \"milliseconds\": 1\n }\n ],\n \"country\": \"<string>\",\n \"remove_images\": false,\n \"remove_class_names\": [\n \"<string>\"\n ],\n \"llm_extract\": {\n \"schema\": {}\n },\n \"links_on_page\": {\n \"query_to_order_links_by\": \"<string>\",\n \"include_links\": [\n \"<string>\"\n ],\n \"exclude_links\": [\n \"<string>\"\n ]\n },\n \"screen_size\": {\n \"screen_width\": 123,\n \"screen_height\": 123\n },\n \"screenshot\": {\n \"full_page\": true\n },\n \"metadata\": {},\n \"max_age\": 0\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"created": 123,
"metadata": {},
"url_to_scrape": "<string>",
"result": {
"html_content": "<string>",
"markdown_content": "<string>",
"text_content": "<string>",
"json_content": "<string>",
"screenshot_hosted_url": "<string>",
"html_hosted_url": "<string>",
"markdown_hosted_url": "<string>",
"text_hosted_url": "<string>",
"links_on_page": [
"<string>"
],
"page_metadata": {
"status_code": 123,
"title": "<string>"
}
},
"credits_consumed": 123,
"cost_usd": 123
}{
"id": "error_x2nmu5bqn6",
"object": "error",
"created": 1777923912,
"metadata": {},
"error": {
"type": "invalid_request_error",
"code": "dns_resolution_failed",
"message": "The URL contains a typo, or the domain does not exist."
}
}{
"id": "error_ogeb6rik8c",
"object": "error",
"created": 1777923969,
"url": "https://example.com",
"metadata": {},
"error": {
"type": "invalid_request_error",
"code": "tls_error",
"detail": "err_ssl_tlsv1_alert_internal_error",
"message": "The website closed or rejected the TLS handshake. The server may be misconfigured or use an unsupported SSL/TLS version."
}
}{
"id": "error_qat3d1amjt",
"object": "error",
"created": 1777923969,
"url": "https://example.com",
"metadata": {},
"error": {
"type": "request_timeout",
"code": "scrape_poll_timeout",
"message": "Request timed out while waiting for scrape result. The page may be slow, blocked for our fetchers, or temporarily unavailable."
}
}Crea Scrape
Esegui uno Scrape di un URL con la configurazione fornita e ottieni il contenuto.
curl --request POST \
--url https://api.olostep.com/v1/scrapes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url_to_scrape": "<string>",
"wait_before_scraping": 123,
"formats": [],
"actions": [
{
"type": "wait",
"milliseconds": 1
}
],
"country": "<string>",
"remove_images": false,
"remove_class_names": [
"<string>"
],
"llm_extract": {
"schema": {}
},
"links_on_page": {
"query_to_order_links_by": "<string>",
"include_links": [
"<string>"
],
"exclude_links": [
"<string>"
]
},
"screen_size": {
"screen_width": 123,
"screen_height": 123
},
"screenshot": {
"full_page": true
},
"metadata": {},
"max_age": 0
}
'import requests
url = "https://api.olostep.com/v1/scrapes"
payload = {
"url_to_scrape": "<string>",
"wait_before_scraping": 123,
"formats": [],
"actions": [
{
"type": "wait",
"milliseconds": 1
}
],
"country": "<string>",
"remove_images": False,
"remove_class_names": ["<string>"],
"llm_extract": { "schema": {} },
"links_on_page": {
"query_to_order_links_by": "<string>",
"include_links": ["<string>"],
"exclude_links": ["<string>"]
},
"screen_size": {
"screen_width": 123,
"screen_height": 123
},
"screenshot": { "full_page": True },
"metadata": {},
"max_age": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url_to_scrape: '<string>',
wait_before_scraping: 123,
formats: [],
actions: [{type: 'wait', milliseconds: 1}],
country: '<string>',
remove_images: false,
remove_class_names: ['<string>'],
llm_extract: {schema: {}},
links_on_page: {
query_to_order_links_by: '<string>',
include_links: ['<string>'],
exclude_links: ['<string>']
},
screen_size: {screen_width: 123, screen_height: 123},
screenshot: {full_page: true},
metadata: {},
max_age: 0
})
};
fetch('https://api.olostep.com/v1/scrapes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.olostep.com/v1/scrapes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url_to_scrape' => '<string>',
'wait_before_scraping' => 123,
'formats' => [
],
'actions' => [
[
'type' => 'wait',
'milliseconds' => 1
]
],
'country' => '<string>',
'remove_images' => false,
'remove_class_names' => [
'<string>'
],
'llm_extract' => [
'schema' => [
]
],
'links_on_page' => [
'query_to_order_links_by' => '<string>',
'include_links' => [
'<string>'
],
'exclude_links' => [
'<string>'
]
],
'screen_size' => [
'screen_width' => 123,
'screen_height' => 123
],
'screenshot' => [
'full_page' => true
],
'metadata' => [
],
'max_age' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.olostep.com/v1/scrapes"
payload := strings.NewReader("{\n \"url_to_scrape\": \"<string>\",\n \"wait_before_scraping\": 123,\n \"formats\": [],\n \"actions\": [\n {\n \"type\": \"wait\",\n \"milliseconds\": 1\n }\n ],\n \"country\": \"<string>\",\n \"remove_images\": false,\n \"remove_class_names\": [\n \"<string>\"\n ],\n \"llm_extract\": {\n \"schema\": {}\n },\n \"links_on_page\": {\n \"query_to_order_links_by\": \"<string>\",\n \"include_links\": [\n \"<string>\"\n ],\n \"exclude_links\": [\n \"<string>\"\n ]\n },\n \"screen_size\": {\n \"screen_width\": 123,\n \"screen_height\": 123\n },\n \"screenshot\": {\n \"full_page\": true\n },\n \"metadata\": {},\n \"max_age\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.olostep.com/v1/scrapes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url_to_scrape\": \"<string>\",\n \"wait_before_scraping\": 123,\n \"formats\": [],\n \"actions\": [\n {\n \"type\": \"wait\",\n \"milliseconds\": 1\n }\n ],\n \"country\": \"<string>\",\n \"remove_images\": false,\n \"remove_class_names\": [\n \"<string>\"\n ],\n \"llm_extract\": {\n \"schema\": {}\n },\n \"links_on_page\": {\n \"query_to_order_links_by\": \"<string>\",\n \"include_links\": [\n \"<string>\"\n ],\n \"exclude_links\": [\n \"<string>\"\n ]\n },\n \"screen_size\": {\n \"screen_width\": 123,\n \"screen_height\": 123\n },\n \"screenshot\": {\n \"full_page\": true\n },\n \"metadata\": {},\n \"max_age\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olostep.com/v1/scrapes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url_to_scrape\": \"<string>\",\n \"wait_before_scraping\": 123,\n \"formats\": [],\n \"actions\": [\n {\n \"type\": \"wait\",\n \"milliseconds\": 1\n }\n ],\n \"country\": \"<string>\",\n \"remove_images\": false,\n \"remove_class_names\": [\n \"<string>\"\n ],\n \"llm_extract\": {\n \"schema\": {}\n },\n \"links_on_page\": {\n \"query_to_order_links_by\": \"<string>\",\n \"include_links\": [\n \"<string>\"\n ],\n \"exclude_links\": [\n \"<string>\"\n ]\n },\n \"screen_size\": {\n \"screen_width\": 123,\n \"screen_height\": 123\n },\n \"screenshot\": {\n \"full_page\": true\n },\n \"metadata\": {},\n \"max_age\": 0\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"created": 123,
"metadata": {},
"url_to_scrape": "<string>",
"result": {
"html_content": "<string>",
"markdown_content": "<string>",
"text_content": "<string>",
"json_content": "<string>",
"screenshot_hosted_url": "<string>",
"html_hosted_url": "<string>",
"markdown_hosted_url": "<string>",
"text_hosted_url": "<string>",
"links_on_page": [
"<string>"
],
"page_metadata": {
"status_code": 123,
"title": "<string>"
}
},
"credits_consumed": 123,
"cost_usd": 123
}{
"id": "error_x2nmu5bqn6",
"object": "error",
"created": 1777923912,
"metadata": {},
"error": {
"type": "invalid_request_error",
"code": "dns_resolution_failed",
"message": "The URL contains a typo, or the domain does not exist."
}
}{
"id": "error_ogeb6rik8c",
"object": "error",
"created": 1777923969,
"url": "https://example.com",
"metadata": {},
"error": {
"type": "invalid_request_error",
"code": "tls_error",
"detail": "err_ssl_tlsv1_alert_internal_error",
"message": "The website closed or rejected the TLS handshake. The server may be misconfigured or use an unsupported SSL/TLS version."
}
}{
"id": "error_qat3d1amjt",
"object": "error",
"created": 1777923969,
"url": "https://example.com",
"metadata": {},
"error": {
"type": "request_timeout",
"code": "scrape_poll_timeout",
"message": "Request timed out while waiting for scrape result. The page may be slow, blocked for our fetchers, or temporarily unavailable."
}
}max_age (in secondi) per riutilizzare uno scrape recente con gli stessi parametri invece di recuperare nuovamente la pagina. Il valore predefinito è 0 (sempre fresco). Nel playground della dashboard, il valore predefinito è 24 ore. Vedi Caching per i dettagli.Autorizzazioni
Intestazione di autenticazione Bearer del tipo Bearer , dove è il tuo token di autenticazione.
Corpo
L'URL da cui iniziare lo scraping.
Tempo di attesa in millisecondi prima di iniziare lo scraping.
Formati nei quali vuoi il contenuto.
html, markdown, text, json, raw_pdf, screenshot Opzione per rimuovere determinati selettori CSS dal contenuto. Facoltativamente, puoi anche passare un array JSON stringificato di selettori specifici che vuoi rimuovere. I selettori CSS rimossi quando questa opzione è impostata su default sono ['nav','footer','script','style','noscript','svg',[role=alert],[role=banner],[role=dialog],[role=alertdialog],[role=region][aria-label*=skip i],[aria-modal=true]]
default, none, array Azioni da eseguire sulla pagina prima di ottenere il contenuto.
- Attendere
- Clic
- Compila Input
- Scorri
Show child attributes
Show child attributes
Paese residenziale da cui caricare la richiesta. Valori supportati sono: - US (Stati Uniti) - CA (Canada) - IT (Italia) - IN (India) - GB (Inghilterra) - JP (Giappone) - MX (Messico) - AU (Australia) - ID (Indonesia) - UA (UAE) - RU (Russia) - RANDOM Alcune operazioni, come lo scraping di Google Search e Google News, supportano tutti i paesi.
Specifica il trasformatore HTML da usare, se presente. La libreria Mercury Parser di Postlight è utilizzata per rimuovere annunci e altri contenuti indesiderati dal contenuto estratto.
postlight, none Opzione per rimuovere le immagini dal contenuto estratto. Di default è false.
Elenco di nomi di classi da rimuovere dal contenuto.
Quando definisci json come formato, puoi usare questo parametro per specificare il parser da utilizzare. I parser sono utili per estrarre contenuti strutturati dalle pagine web. Olostep ha alcuni parser integrati per le pagine web più comuni, e puoi anche creare i tuoi parser.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Con questa opzione, puoi ottenere tutti i link presenti sulla pagina che stai scrappando. I link sono sempre restituiti come URL assoluti.
Show child attributes
Show child attributes
Configurazione per la dimensione dello schermo. Le dimensioni preimpostate sono disponibili tramite screen_type: desktop (1920x1080), mobile (414x896) o default (768x1024).
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Metadata definiti dall'utente. Non ancora supportati.
Età massima accettabile del contenuto memorizzato nella cache, in secondi. Quando esiste già uno scrape corrispondente ed è più recente di max_age secondi, Olostep restituisce il risultato memorizzato invece di avviare un nuovo scrape del browser. Il valore predefinito è 0 (sempre scrape fresco). Nel playground della dashboard, il valore predefinito è 86400 (24 ore). Il valore massimo consentito è 604800 (7 giorni). Vedi la sezione Caching nei documenti della funzione Scrapes per i dettagli.
x >= 0Risposta
Risposta riuscita con i dettagli di avvio dello scrape.
Scrape ID
Il tipo di oggetto. "scrape" per questo endpoint.
Epoch creato
Metadata definiti dall'utente.
L'URL che è stato scrappato.
Show child attributes
Show child attributes
Numero di crediti consumati da questa richiesta. Popolato dopo il completamento dell'esecuzione. I crediti sono la fonte di verità per la fatturazione.
Costo stimato in USD per questa richiesta. Popolato dopo il completamento dell'esecuzione. Calcolato dai crediti consumati e dal tuo piano tariffario — 99% accurato, ma credits_consumed è il valore autorevole.
Questa pagina è stata utile?