API Scraping stron internetowych
Pobieraj publiczne strony internetowe jako HTML, Markdown lub tekst, korzystając z opcji synchronicznych i asynchronicznych. Użyj tej referencji, aby wybrać operację i zintegrować jej udokumentowany kontrakt odpowiedzi.
Operacje
POST /v1/scrape
POST
/v1/scrape
Kredyty: 1-20/item
Parametry treści
| Parametr | Typ | wymagane |
|---|---|---|
| url | string | wymagane |
| mode |
string
Dozwolone wartości
standardresilientrenderedrendered_resilient
Domyślnie
standard
|
opcjonalne |
| output |
string
Dozwolone wartości
htmltextmarkdown
Domyślnie
html
|
opcjonalne |
Pola odpowiedzi
| Pole | Typ |
|---|---|
data |
object |
data.url |
string |
data.final_url |
string |
data.status |
integer | null |
data.outcome |
string |
data.content_type |
string | null |
data.content |
string |
data.bytes |
integer |
data.truncated |
boolean |
data.redirect_count |
integer |
data.attempt_count |
integer |
data.duration_ms |
integer |
data.fetched_at |
string |
data.headers |
object |
data.rendered |
boolean |
billing |
object |
billing.credits_charged |
integer |
billing.credits_refunded |
integer |
billing.credits_per_item |
integer |
billing.credits_net |
integer |
billing.policy |
string |
Przykładowe żądanie
curl -X POST "https://domscan.net/v1/scrape" \
-H "Content-Type: application/json" \
-H "X-API-Key: $DOMSCAN_API_KEY" \
-d '{
"url": "https://example.com/",
"mode": "standard",
"output": "markdown"
}'const response = await fetch("https://domscan.net/v1/scrape", {
method: "POST",
headers: { "X-API-Key": process.env.DOMSCAN_API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({
"url": "https://example.com/",
"mode": "standard",
"output": "markdown"
}),
});
const data = await response.json();
console.log(data);import os
import requests
response = requests.post(
"https://domscan.net/v1/scrape",
headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
json={
"url": "https://example.com/",
"mode": "standard",
"output": "markdown",
},
)
print(response.json())package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"url": "https://example.com/",
"mode": "standard",
"output": "markdown"
}`)
req, err := http.NewRequest(http.MethodPost, "https://domscan.net/v1/scrape", body)
if err != nil {
panic(err)
}
req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(resp.Status, string(data))
}require "json"
require "net/http"
uri = URI("https://domscan.net/v1/scrape")
request = Net::HTTP::Post.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")
request["Content-Type"] = "application/json"
request.body = JSON.generate({
"url" => "https://example.com/",
"mode" => "standard",
"output" => "markdown"
})
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts JSON.pretty_generate(JSON.parse(response.body))Przykładowa odpowiedź
{
"data": {
"url": "https://example.com",
"final_url": "https://example.com",
"status": 1,
"outcome": "success",
"content_type": "domain",
"content": "example",
"bytes": 1,
"truncated": false,
"redirect_count": 1,
"attempt_count": 1,
"duration_ms": 1,
"fetched_at": "2026-08-27T12:00:00Z",
"headers": {},
"rendered": false
},
"billing": {
"credits_charged": 1,
"credits_refunded": 1,
"credits_per_item": 1,
"credits_net": 1,
"policy": "effort_based"
}
}
Kody statusu HTTP
200OK400Nieprawidłowe żądanie401Nieautoryzowany402Wymagana płatność403Zabronione409HTTP 409422HTTP 422429Zbyt wiele żądań503Usługa niedostępna
POST /v1/scrape/jobs
POST
/v1/scrape/jobs
Kredyty: 1-20/item
Parametry treści
| Parametr | Typ | wymagane |
|---|---|---|
| notify_webhook | unknown | opcjonalne |
| mode |
string
Dozwolone wartości
standardresilientrenderedrendered_resilient
Domyślnie
standard
|
opcjonalne |
| output |
string
Dozwolone wartości
htmltextmarkdown
Domyślnie
html
|
opcjonalne |
| urls | unknown[] | wymagane |
Pola odpowiedzi
| Pole | Typ |
|---|---|
job |
object |
job.id |
string |
job.status |
string |
job.mode |
string |
job.output |
string |
job.total |
integer |
job.counts |
object |
job.counts.pending |
integer |
job.counts.processing |
integer |
job.counts.succeeded |
integer |
job.counts.failed |
integer |
job.billing |
object |
job.billing.credits_charged |
integer |
job.billing.credits_refunded |
integer |
job.billing.credits_per_item |
integer |
job.billing.credits_net |
integer |
job.billing.policy |
string |
job.status_url |
string |
job.results_url |
string |
job.poll_after_ms |
integer | null |
job.created_at |
string |
job.started_at |
string | null |
job.completed_at |
string | null |
job.updated_at |
string |
job.processing_deadline_at |
string |
job.results_expires_at |
string |
idempotent_replay |
boolean |
Przykładowe żądanie
curl -X POST "https://domscan.net/v1/scrape/jobs" \
-H "Content-Type: application/json" \
-H "X-API-Key: $DOMSCAN_API_KEY" \
-d '{
"mode": "resilient",
"output": "text",
"urls": [
"https://example.com/",
{
"url": "https://example.org/",
"reference": "page-2"
}
]
}'const response = await fetch("https://domscan.net/v1/scrape/jobs", {
method: "POST",
headers: { "X-API-Key": process.env.DOMSCAN_API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({
"mode": "resilient",
"output": "text",
"urls": [
"https://example.com/",
{
"url": "https://example.org/",
"reference": "page-2"
}
]
}),
});
const data = await response.json();
console.log(data);import os
import requests
response = requests.post(
"https://domscan.net/v1/scrape/jobs",
headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
json={
"mode": "resilient",
"output": "text",
"urls": [
"https://example.com/",
{
"url": "https://example.org/",
"reference": "page-2",
},
],
},
)
print(response.json())package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"mode": "resilient",
"output": "text",
"urls": [
"https://example.com/",
{
"url": "https://example.org/",
"reference": "page-2"
}
]
}`)
req, err := http.NewRequest(http.MethodPost, "https://domscan.net/v1/scrape/jobs", body)
if err != nil {
panic(err)
}
req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(resp.Status, string(data))
}require "json"
require "net/http"
uri = URI("https://domscan.net/v1/scrape/jobs")
request = Net::HTTP::Post.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")
request["Content-Type"] = "application/json"
request.body = JSON.generate({
"mode" => "resilient",
"output" => "text",
"urls" => [
"https://example.com/",
{
"url" => "https://example.org/",
"reference" => "page-2"
}
]
})
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts JSON.pretty_generate(JSON.parse(response.body))Przykładowa odpowiedź
{
"job": {
"id": "example-id",
"status": "queued",
"mode": "standard",
"output": "html",
"total": 1,
"counts": {
"pending": 1,
"processing": 1,
"succeeded": 1,
"failed": 1
},
"billing": {
"credits_charged": 1,
"credits_refunded": 1,
"credits_per_item": 1,
"credits_net": 1,
"policy": "effort_based"
},
"status_url": "https://example.com",
"results_url": "https://example.com",
"poll_after_ms": 1,
"created_at": "2026-08-27T12:00:00Z",
"started_at": "2026-08-27T12:00:00Z",
"completed_at": "2026-08-27T12:00:00Z",
"updated_at": "2026-08-27T12:00:00Z",
"processing_deadline_at": "2026-08-27T12:00:00Z",
"results_expires_at": "2026-08-27T12:00:00Z"
},
"idempotent_replay": false
}
Kody statusu HTTP
202Przyjęto400Nieprawidłowe żądanie401Nieautoryzowany402Wymagana płatność403Zabronione409HTTP 409429Zbyt wiele żądań503Usługa niedostępna
GET /v1/scrape/jobs/:job_id
GET
/v1/scrape/jobs/:job_id
Kredyty: 0
Parametry zapytania
| Parametr | Typ | wymagane |
|---|---|---|
| job_id | string | wymagane |
Pola odpowiedzi
| Pole | Typ |
|---|---|
job |
object |
job.id |
string |
job.status |
string |
job.mode |
string |
job.output |
string |
job.total |
integer |
job.counts |
object |
job.counts.pending |
integer |
job.counts.processing |
integer |
job.counts.succeeded |
integer |
job.counts.failed |
integer |
job.billing |
object |
job.billing.credits_charged |
integer |
job.billing.credits_refunded |
integer |
job.billing.credits_per_item |
integer |
job.billing.credits_net |
integer |
job.billing.policy |
string |
job.status_url |
string |
job.results_url |
string |
job.poll_after_ms |
integer | null |
job.created_at |
string |
job.started_at |
string | null |
job.completed_at |
string | null |
job.updated_at |
string |
job.processing_deadline_at |
string |
job.results_expires_at |
string |
Przykładowe żądanie
curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/scrape/jobs/example"const response = await fetch("https://domscan.net/v1/scrape/jobs/example", {
headers: { "X-API-Key": process.env.DOMSCAN_API_KEY },
});
const data = await response.json();
console.log(data);import os
import requests
response = requests.get(
"https://domscan.net/v1/scrape/jobs/example",
headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
)
print(response.json())package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest(http.MethodGet, "https://domscan.net/v1/scrape/jobs/example", nil)
if err != nil {
panic(err)
}
req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(resp.Status, string(data))
}require "json"
require "net/http"
uri = URI("https://domscan.net/v1/scrape/jobs/example")
request = Net::HTTP::Get.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts JSON.pretty_generate(JSON.parse(response.body))Przykładowa odpowiedź
{
"job": {
"id": "example-id",
"status": "queued",
"mode": "standard",
"output": "html",
"total": 1,
"counts": {
"pending": 1,
"processing": 1,
"succeeded": 1,
"failed": 1
},
"billing": {
"credits_charged": 1,
"credits_refunded": 1,
"credits_per_item": 1,
"credits_net": 1,
"policy": "effort_based"
},
"status_url": "https://example.com",
"results_url": "https://example.com",
"poll_after_ms": 1,
"created_at": "2026-08-27T12:00:00Z",
"started_at": "2026-08-27T12:00:00Z",
"completed_at": "2026-08-27T12:00:00Z",
"updated_at": "2026-08-27T12:00:00Z",
"processing_deadline_at": "2026-08-27T12:00:00Z",
"results_expires_at": "2026-08-27T12:00:00Z"
}
}
Kody statusu HTTP
200OK401Nieautoryzowany404Nie znaleziono429Zbyt wiele żądań
GET /v1/scrape/jobs/:job_id/results
GET
/v1/scrape/jobs/:job_id/results
Kredyty: 0
Parametry zapytania
| Parametr | Typ | wymagane |
|---|---|---|
| job_id | string | wymagane |
| limit |
integer
Domyślnie
20
|
opcjonalne |
| offset |
integer
Domyślnie
0
|
opcjonalne |
Pola odpowiedzi
| Pole | Typ |
|---|---|
job |
object |
job.id |
string |
job.status |
string |
job.mode |
string |
job.output |
string |
job.total |
integer |
job.counts |
object |
job.counts.pending |
integer |
job.counts.processing |
integer |
job.counts.succeeded |
integer |
job.counts.failed |
integer |
job.billing |
object |
job.billing.credits_charged |
integer |
job.billing.credits_refunded |
integer |
job.billing.credits_per_item |
integer |
job.billing.credits_net |
integer |
job.billing.policy |
string |
job.status_url |
string |
job.results_url |
string |
job.poll_after_ms |
integer | null |
job.created_at |
string |
job.started_at |
string | null |
job.completed_at |
string | null |
job.updated_at |
string |
job.processing_deadline_at |
string |
job.results_expires_at |
string |
results[] |
object[] |
results[] |
object |
results[].index |
integer |
results[].url |
string |
results[].reference |
string |
results[].status |
string |
results[].data |
object |
results[].data.url |
string |
results[].data.final_url |
string |
results[].data.status |
integer | null |
results[].data.outcome |
string |
results[].data.content_type |
string | null |
results[].data.content |
string |
results[].data.bytes |
integer |
results[].data.truncated |
boolean |
results[].data.redirect_count |
integer |
results[].data.attempt_count |
integer |
results[].data.duration_ms |
integer |
results[].data.fetched_at |
string |
results[].data.headers |
object |
results[].data.rendered |
boolean |
results[].billing |
object |
results[].billing.credits_charged |
integer |
results[].billing.credits_refunded |
integer |
results[].billing.credits_per_item |
integer |
results[].billing.credits_net |
integer |
results[].billing.policy |
string |
pagination |
object |
Przykładowe żądanie
curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/scrape/jobs/example/results?limit=25&offset=0"const response = await fetch("https://domscan.net/v1/scrape/jobs/example/results?limit=25&offset=0", {
headers: { "X-API-Key": process.env.DOMSCAN_API_KEY },
});
const data = await response.json();
console.log(data);import os
import requests
response = requests.get(
"https://domscan.net/v1/scrape/jobs/example/results?limit=25&offset=0",
headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
)
print(response.json())package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest(http.MethodGet, "https://domscan.net/v1/scrape/jobs/example/results?limit=25&offset=0", nil)
if err != nil {
panic(err)
}
req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(resp.Status, string(data))
}require "json"
require "net/http"
uri = URI("https://domscan.net/v1/scrape/jobs/example/results?limit=25&offset=0")
request = Net::HTTP::Get.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts JSON.pretty_generate(JSON.parse(response.body))Przykładowa odpowiedź
{
"job": {
"id": "example-id",
"status": "queued",
"mode": "standard",
"output": "html",
"total": 1,
"counts": {
"pending": 1,
"processing": 1,
"succeeded": 1,
"failed": 1
},
"billing": {
"credits_charged": 1,
"credits_refunded": 1,
"credits_per_item": 1,
"credits_net": 1,
"policy": "effort_based"
},
"status_url": "https://example.com",
"results_url": "https://example.com",
"poll_after_ms": 1,
"created_at": "2026-08-27T12:00:00Z",
"started_at": "2026-08-27T12:00:00Z",
"completed_at": "2026-08-27T12:00:00Z",
"updated_at": "2026-08-27T12:00:00Z",
"processing_deadline_at": "2026-08-27T12:00:00Z",
"results_expires_at": "2026-08-27T12:00:00Z"
},
"results": [
{
"index": 1,
"url": "https://example.com",
"reference": "example",
"status": "pending",
"data": {
"url": "https://example.com",
"final_url": "https://example.com",
"status": 1,
"outcome": "success",
"content_type": "domain",
"content": "example",
"bytes": 1,
"truncated": false,
"redirect_count": 1,
"attempt_count": 1,
"duration_ms": 1,
"fetched_at": "2026-08-27T12:00:00Z",
"headers": {},
"rendered": false
},
"billing": {
"credits_charged": 1,
"credits_refunded": 1,
"credits_per_item": 1,
"credits_net": 1,
"policy": "effort_based"
}
}
],
"pagination": {}
}
Kody statusu HTTP
200OK400Nieprawidłowe żądanie401Nieautoryzowany404Nie znaleziono410HTTP 410429Zbyt wiele żądań