Referencja API

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 Otwórz referencję API
POST /v1/scrape/jobs Otwórz referencję API
GET /v1/scrape/jobs/:job_id Otwórz referencję API
GET /v1/scrape/jobs/:job_id/results Otwórz referencję API

POST /v1/scrape

Operacja: scrapePage Kredyty i uwierzytelnianie: 1-20 Wymagane uwierzytelnianie
POST /v1/scrape

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

Odpowiedź Fields

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ład Request

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"
}'

Example Odpowiedź

{
  "data": {
    "url": "https://example.com",
    "final_url": "https://example.com",
    "status": 1,
    "outcome": "success",
    "content_type": "string",
    "content": "string",
    "bytes": 1,
    "truncated": true,
    "redirect_count": 1,
    "attempt_count": 1,
    "duration_ms": 1,
    "fetched_at": "2026-04-15T12:00:00Z",
    "headers": {},
    "rendered": true
  },
  "billing": {
    "credits_charged": 1,
    "credits_refunded": 1,
    "credits_per_item": 1,
    "credits_net": 1,
    "policy": "effort_based"
  }
}

POST /v1/scrape/jobs

Operacja: createScrapeJob Kredyty i uwierzytelnianie: 1-20 Wymagane uwierzytelnianie
POST /v1/scrape/jobs

Parametry treści

Parametr Typ wymagane
mode string
Dozwolone wartości standardresilientrenderedrendered_resilient
Domyślnie standard
opcjonalne
output string
Dozwolone wartości htmltextmarkdown
Domyślnie html
opcjonalne
urls unknown[] wymagane

Odpowiedź Fields

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ład Request

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"
    }
  ]
}'

Example Odpowiedź

{
  "job": {
    "id": "string",
    "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-04-15T12:00:00Z",
    "started_at": "2026-04-15T12:00:00Z",
    "completed_at": "2026-04-15T12:00:00Z",
    "updated_at": "2026-04-15T12:00:00Z",
    "processing_deadline_at": "2026-04-15T12:00:00Z",
    "results_expires_at": "2026-04-15T12:00:00Z"
  },
  "idempotent_replay": true
}

GET /v1/scrape/jobs/:job_id

Operacja: getScrapeJob Kredyty i uwierzytelnianie: Bezpłatnie Wymagane uwierzytelnianie
GET /v1/scrape/jobs/:job_id

Parametry zapytania

Parametr Typ wymagane
job_id string wymagane

Odpowiedź Fields

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ład Request

curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/scrape/jobs/example.com"

Example Odpowiedź

{
  "job": {
    "id": "string",
    "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-04-15T12:00:00Z",
    "started_at": "2026-04-15T12:00:00Z",
    "completed_at": "2026-04-15T12:00:00Z",
    "updated_at": "2026-04-15T12:00:00Z",
    "processing_deadline_at": "2026-04-15T12:00:00Z",
    "results_expires_at": "2026-04-15T12:00:00Z"
  }
}

GET /v1/scrape/jobs/:job_id/results

Operacja: getScrapeJobResults Kredyty i uwierzytelnianie: Bezpłatnie Wymagane uwierzytelnianie
GET /v1/scrape/jobs/:job_id/results

Parametry zapytania

Parametr Typ wymagane
job_id string wymagane
limit integer
Domyślnie 20
opcjonalne
offset integer
Domyślnie 0
opcjonalne

Odpowiedź Fields

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ład Request

curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/scrape/jobs/example.com/results?limit=25&offset=0"

Example Odpowiedź

{
  "job": {
    "id": "string",
    "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-04-15T12:00:00Z",
    "started_at": "2026-04-15T12:00:00Z",
    "completed_at": "2026-04-15T12:00:00Z",
    "updated_at": "2026-04-15T12:00:00Z",
    "processing_deadline_at": "2026-04-15T12:00:00Z",
    "results_expires_at": "2026-04-15T12:00:00Z"
  },
  "results": [
    {
      "index": 1,
      "url": "https://example.com",
      "reference": "string",
      "status": "pending",
      "data": {
        "url": "https://example.com",
        "final_url": "https://example.com",
        "status": 1,
        "outcome": "success",
        "content_type": "string",
        "content": "string",
        "bytes": 1,
        "truncated": true,
        "redirect_count": 1,
        "attempt_count": 1,
        "duration_ms": 1,
        "fetched_at": "2026-04-15T12:00:00Z",
        "headers": {},
        "rendered": true
      },
      "billing": {
        "credits_charged": 1,
        "credits_refunded": 1,
        "credits_per_item": 1,
        "credits_net": 1,
        "policy": "effort_based"
      }
    }
  ],
  "pagination": {}
}

Materiały referencyjne