Poll a SmartBrowse run
curl --request GET \
--url https://api.webscrape.ai/v1/smartbrowse/runs/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.webscrape.ai/v1/smartbrowse/runs/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.webscrape.ai/v1/smartbrowse/runs/{id}', 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.webscrape.ai/v1/smartbrowse/runs/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.webscrape.ai/v1/smartbrowse/runs/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.webscrape.ai/v1/smartbrowse/runs/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.webscrape.ai/v1/smartbrowse/runs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "completed",
"request_id": "req_aB3xY9Kp",
"data": {
"id": "k7Xb9dRmQ2p",
"recipe_id": "m3Yc2tFvN8q",
"pages_extracted": 123,
"items_extracted": 123,
"credits_used": 123,
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"error": "<string>",
"result": {
"pages": [
{
"items": [
{}
]
}
],
"mode": "<string>",
"drift": 123,
"warnings": [
"<string>"
]
}
},
"credits_used": 0,
"credits_remaining": 123
}{
"status": "error",
"error": {
"code": "unauthorized",
"message": "missing or invalid credentials"
},
"request_id": "req_aB3xY9Kp"
}{
"status": "error",
"error": {
"code": "not_found",
"message": "recipe not found"
},
"request_id": "req_aB3xY9Kp"
}{
"status": "error",
"error": {
"code": "internal_error",
"message": "internal error"
},
"request_id": "req_aB3xY9Kp"
}SmartBrowse
Poll a SmartBrowse run
GET
/
smartbrowse
/
runs
/
{id}
Poll a SmartBrowse run
curl --request GET \
--url https://api.webscrape.ai/v1/smartbrowse/runs/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.webscrape.ai/v1/smartbrowse/runs/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.webscrape.ai/v1/smartbrowse/runs/{id}', 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.webscrape.ai/v1/smartbrowse/runs/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.webscrape.ai/v1/smartbrowse/runs/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.webscrape.ai/v1/smartbrowse/runs/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.webscrape.ai/v1/smartbrowse/runs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "completed",
"request_id": "req_aB3xY9Kp",
"data": {
"id": "k7Xb9dRmQ2p",
"recipe_id": "m3Yc2tFvN8q",
"pages_extracted": 123,
"items_extracted": 123,
"credits_used": 123,
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"error": "<string>",
"result": {
"pages": [
{
"items": [
{}
]
}
],
"mode": "<string>",
"drift": 123,
"warnings": [
"<string>"
]
}
},
"credits_used": 0,
"credits_remaining": 123
}{
"status": "error",
"error": {
"code": "unauthorized",
"message": "missing or invalid credentials"
},
"request_id": "req_aB3xY9Kp"
}{
"status": "error",
"error": {
"code": "not_found",
"message": "recipe not found"
},
"request_id": "req_aB3xY9Kp"
}{
"status": "error",
"error": {
"code": "internal_error",
"message": "internal error"
},
"request_id": "req_aB3xY9Kp"
}Authorizations
Path Parameters
Opaque run ID (~11 base62 chars).
Example:
"k7Xb9dRmQ2p"
Response
Run state returned.
Discriminator for the envelope variant.
Available options:
completed Per-request id. Also returned as the X-Request-ID response
header. Include it when reporting issues.
Example:
"req_aB3xY9Kp"
Show child attributes
Show child attributes
Always 0. Polling is free; the run's accrued credits are surfaced in data.credits_used.
Example:
0
⌘I