> For the complete documentation index see https://domscan.net/llms.txt. Markdown versions of every docs page are available by appending .md to the page URL.

Source: https://domscan.net/pl/docs/batch

# Asynchroniczne partie żądań API

Dodawaj wiele obsługiwanych żądań API do kolejki i odbieraj ich wyniki bez utrzymywania otwartego połączenia klienta.

POST /v1/batches

#### Jak działa przetwarzanie partiami

- Każda partia może zawierać do 100 obsługiwanych publicznych żądań GET.

- Każdy element zachowuje standardową cenę swojego endpointu, a kredyty za ostatecznie nieudane elementy są zwracane niezależnie.

- Stan zadania i wyniki pozostają dostępne dla wszystkich członków konta przez 24 godziny.

- Opcjonalny webhook HTTPS może powiadomić Twój system, gdy przetwarzanie osiągnie stan końcowy.

#### Przykładowe żądanie

```bash
curl -X POST "https://domscan.net/v1/batches" \
  -H "X-API-Key: $DOMSCAN_API_KEY" \
  -H "Idempotency-Key: customer-import-42" \
  -H "Content-Type: application/json" \
  -d '{
    "requests": [
      {"path": "/v1/status", "query": {"domain": "example.com"}},
      {"path": "/v1/dns", "query": {"domain": "example.org", "type": "MX"}}
    ]
  }'
```

#### Pola odpowiedzi

| Pole | Typ |
| --- | --- |
| `job` | object |
| `job.id` | string |
| `job.status` | string |
| `job.total` | integer |
| `job.counts` | object |
| `job.counts.pending` | integer |
| `job.counts.processing` | integer |
| `job.counts.succeeded` | integer |
| `job.counts.failed` | integer |
| `job.counts.cancelled` | integer |
| `job.billing` | object |
| `job.billing.credits_charged` | integer |
| `job.billing.credits_refunded` | integer |
| `job.billing.credits_net` | integer |
| `job.webhook` | object |
| `job.webhook.configured` | boolean |
| `job.webhook.status` | string |
| `job.webhook.attempts` | integer |
| `job.status_url` | string |
| `job.results_url` | string |
| `job.results_csv_url` | string |
| `job.poll_after_ms` | integer \| null |
| `job.created_at` | string |
| `job.started_at` | string \| null |
| `job.completed_at` | string \| null |
| `job.cancelled_at` | string \| null |
| `job.updated_at` | string |
| `job.processing_deadline_at` | string |
| `job.results_expires_at` | string |

#### Przykładowa odpowiedź

```json
{
  "job": {
    "id": "example-id",
    "status": "queued",
    "total": 1,
    "counts": {
      "pending": 1,
      "processing": 1,
      "succeeded": 1,
      "failed": 1,
      "cancelled": 1
    },
    "billing": {
      "credits_charged": 1,
      "credits_refunded": 1,
      "credits_net": 1
    },
    "webhook": {
      "configured": false,
      "status": "not_configured",
      "attempts": 1
    },
    "status_url": "https://example.com",
    "results_url": "https://example.com",
    "results_csv_url": "https://example.com",
    "created_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",
    "poll_after_ms": 1,
    "started_at": "2026-08-27T12:00:00Z",
    "completed_at": "2026-08-27T12:00:00Z",
    "cancelled_at": "2026-08-27T12:00:00Z"
  }
}
```

### Odpytywanie i anulowanie

Odpytuj endpoint stanu, pobieraj uporządkowane wyniki lub anuluj zadania, które jeszcze się nie rozpoczęły.

```http
GET /v1/batches/{job_id}
GET /v1/batches/{job_id}/results
GET /v1/batches/{job_id}/results?format=csv
DELETE /v1/batches/{job_id}
```

### Podpisane webhooki zakończenia

Podpisy webhooków używają HMAC-SHA256 dla znacznika czasu, kropki i dokładnej treści żądania. Przed przyjęciem dostarczenia zweryfikuj znacznik czasu.

```http
X-DomScan-Event: batch.completed
X-DomScan-Timestamp: 1785231000
X-DomScan-Signature: sha256=...
```

### Ujednolicone API zadań

Odczytuj, stronicuj i anuluj każde zadanie asynchroniczne w jednym miejscu: partie żądań API, wyszukiwania domen, skany technologii i zadania scrapowania. Zadania nadal tworzy się na ich własnych endpointach, które działają bez zmian. Każda operacja /v1/jobs jest bezpłatna.

```http
GET  /v1/jobs?limit=25&kind=tech_scan
GET  /v1/jobs/{job_id}
GET  /v1/jobs/{job_id}/results?limit=25&cursor=...
POST /v1/jobs/{job_id}/cancel
```

#### Kształt zadania

Każde zadanie ma te same pola: id, kind, status, znaczniki czasu, progress (total, done, succeeded, failed, cancelled), credits (charged, refunded) oraz linki do zadania, jego wyników i, dopóki można je anulować, do akcji anulowania. native_status zachowuje status zgłoszony przez endpoint, który utworzył zadanie.

```json
{
  "job": {
    "id": "tsj_4f2a9c1e7b3d4a5f8e6c2b1a0d9f8e7c",
    "kind": "tech_scan",
    "status": "running",
    "native_status": "running",
    "created_at": "2026-10-10T12:00:00Z",
    "updated_at": "2026-10-10T12:00:20Z",
    "started_at": "2026-10-10T12:00:05Z",
    "completed_at": null,
    "results_expires_at": "2026-10-12T12:00:00Z",
    "progress": { "total": 2, "done": 1, "succeeded": 1, "failed": 0, "cancelled": 0 },
    "credits": { "charged": 6, "refunded": 0 },
    "notify_webhook": { "endpoint_id": null, "status": "waiting", "event_type": null, "deliveries": 0 },
    "links": {
      "self": "https://domscan.net/v1/jobs/tsj_4f2a9c1e7b3d4a5f8e6c2b1a0d9f8e7c",
      "results": "https://domscan.net/v1/jobs/tsj_4f2a9c1e7b3d4a5f8e6c2b1a0d9f8e7c/results",
      "cancel": "https://domscan.net/v1/jobs/tsj_4f2a9c1e7b3d4a5f8e6c2b1a0d9f8e7c/cancel"
    }
  }
}
```

#### Statusy

queued i running oznaczają, że zadanie jest w toku. Zadanie, które jest anulowane, zgłasza running do czasu zakończenia anulowania. completed oznacza, że każdy element osiągnął stan końcowy, failed oznacza, że zadanie zakończyło się bez ani jednego udanego elementu, a cancelled oznacza, że zadanie anulowano. Nieudane elementy są liczone w progress.failed i wymienione w wynikach.

`batch`, `domain_discovery`, `tech_scan`, `scrape` &middot; `queued`, `running`, `completed`, `failed`, `cancelled`

#### Paginacja

Zarówno wyświetlanie zadań, jak i odczyt wyników akceptują limit (od 1 do 100, domyślnie 25) oraz cursor. Przekaż next_cursor z poprzedniej strony jako cursor. Na ostatniej stronie ma wartość null. Kursory są podpisane i powiązane z Twoim kontem oraz zadaniem, więc zmodyfikowany lub cudzy kursor zwraca 400.

#### Anulowanie

Anulowanie partii żądań API, wyszukiwania domen lub skanu technologii zatrzymuje niezaczęte elementy i zwraca ich kredyty. Element, który już się wykonuje, może się zakończyć. Anulowanie zadania, które jest już anulowane, zwraca 200. Zadań scrapowania nie można anulować, a zadanie, które już się zakończyło, zwraca 409 z JOB_NOT_CANCELLABLE.

#### Webhook zakończenia

Dodaj notify_webhook: true do dowolnego żądania utworzenia zadania, aby po jego zakończeniu otrzymać jedno podpisane zdarzenie job.completed, job.failed lub job.cancelled. Zdarzenie trafia do każdego aktywnego podpisanego endpointu webhooka, który je subskrybuje lub subskrybuje wszystkie zdarzenia. Przekaż identyfikator endpointu zamiast true, aby wysłać je tylko na ten endpoint. Dostarczanie korzysta z tych samych podpisów, ponowień i dziennika dostarczeń co alerty monitorowania i jest bezpłatne.

```bash
curl -X POST "https://domscan.net/v1/tech/jobs" \
  -H "X-API-Key: $DOMSCAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"targets": ["example.com"], "notify_webhook": true}'

X-DomScan-Event: job.completed
X-DomScan-Event-Id: evt_job_tsj_4f2a9c1e7b3d4a5f8e6c2b1a0d9f8e7c
```

POST /v1/domain-discovery/jobs Kredyty: 1/item

#### Parametry treści

| Parametr | Typ | wymagane |
| --- | --- | --- |
| notify_webhook | unknown | opcjonalne |
| tlds | string[] | wymagane |
| limit | integer | opcjonalne |
| cursor | string | opcjonalne |
| min_length | integer Domyślnie `3` | opcjonalne |
| max_length | integer Domyślnie `16` | opcjonalne |
| singular_only | boolean Domyślnie `false` | opcjonalne |

#### Pola odpowiedzi

| Pole | Typ |
| --- | --- |
| `job` | object |
| `job.id` | string |
| `job.status` | string |
| `job.total` | integer |
| `job.counts` | object |
| `job.counts.pending` | integer |
| `job.counts.processing` | integer |
| `job.counts.succeeded` | integer |
| `job.counts.failed` | integer |
| `job.counts.cancelled` | integer |
| `job.billing` | object |
| `job.billing.credits_charged` | integer |
| `job.billing.credits_refunded` | integer |
| `job.billing.credits_net` | integer |
| `job.webhook` | object |
| `job.webhook.configured` | boolean |
| `job.webhook.status` | string |
| `job.webhook.attempts` | integer |
| `job.status_url` | string |
| `job.results_url` | string |
| `job.results_csv_url` | string |
| `job.poll_after_ms` | integer \| null |
| `job.created_at` | string |
| `job.started_at` | string \| null |
| `job.completed_at` | string \| null |
| `job.cancelled_at` | string \| null |
| `job.updated_at` | string |
| `job.processing_deadline_at` | string |
| `job.results_expires_at` | string |
| `discovery` | object |
| `discovery.corpus` | string |
| `discovery.corpus_version` | string |
| `discovery.total_matching_words` | integer |
| `discovery.page_offset` | integer |
| `discovery.page_words` | integer |
| `discovery.domain_checks` | integer |
| `discovery.tlds[]` | string[] |
| `discovery.filters` | object |
| `discovery.filters.min_length` | integer |
| `discovery.filters.max_length` | integer |
| `discovery.filters.singular_only` | boolean |
| `discovery.credits_per_domain` | integer |
| `discovery.next_cursor` | string \| null |

#### Przykładowe żądanie

```bash
curl -X POST "https://domscan.net/v1/domain-discovery/jobs" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $DOMSCAN_API_KEY" \
  -d '{
  "tlds": [
    "io",
    "ai"
  ],
  "limit": 50,
  "min_length": 4,
  "max_length": 8,
  "singular_only": true
}'
```

```javascript
const response = await fetch("https://domscan.net/v1/domain-discovery/jobs", {
  method: "POST",
  headers: { "X-API-Key": process.env.DOMSCAN_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({
    "tlds": [
      "io",
      "ai"
    ],
    "limit": 50,
    "min_length": 4,
    "max_length": 8,
    "singular_only": true
  }),
});
const data = await response.json();
console.log(data);
```

```python
import os
import requests

response = requests.post(
    "https://domscan.net/v1/domain-discovery/jobs",
    headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
    json={
        "tlds": [
            "io",
            "ai",
        ],
        "limit": 50,
        "min_length": 4,
        "max_length": 8,
        "singular_only": True,
    },
)
print(response.json())
```

```go
package main

func main() {
	body := strings.NewReader(`{
	  "tlds": [
	    "io",
	    "ai"
	  ],
	  "limit": 50,
	  "min_length": 4,
	  "max_length": 8,
	  "singular_only": true
	}`)
	req, err := http.NewRequest(http.MethodPost, "https://domscan.net/v1/domain-discovery/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")

```ruby
require "json"
require "net/http"

uri = URI("https://domscan.net/v1/domain-discovery/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({
  "tlds" => [
    "io",
    "ai"
  ],
  "limit" => 50,
  "min_length" => 4,
  "max_length" => 8,
  "singular_only" => true
})

#### Przykładowa odpowiedź

```json
{
  "job": {
    "id": "example-id",
    "status": "queued",
    "total": 1,
    "counts": {
      "pending": 1,
      "processing": 1,
      "succeeded": 1,
      "failed": 1,
      "cancelled": 1
    },
    "billing": {
      "credits_charged": 1,
      "credits_refunded": 1,
      "credits_net": 1
    },
    "webhook": {
      "configured": false,
      "status": "not_configured",
      "attempts": 1
    },
    "status_url": "https://example.com",
    "results_url": "https://example.com",
    "results_csv_url": "https://example.com",
    "created_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",
    "poll_after_ms": 1,
    "started_at": "2026-08-27T12:00:00Z",
    "completed_at": "2026-08-27T12:00:00Z",
    "cancelled_at": "2026-08-27T12:00:00Z"
  },
  "discovery": {
    "corpus": "iannuttall/unclaimed",
    "corpus_version": "example",
    "total_matching_words": 1,
    "page_offset": 1,
    "page_words": 1,
    "domain_checks": 1,
    "tlds": [
      "com",
      "net",
      "org"
    ],
    "filters": {
      "min_length": 1,
      "max_length": 1,
      "singular_only": false
    },
    "credits_per_domain": 1,
    "next_cursor": "example"
  }
}
```

#### Kody statusu HTTP

- `200` OK
- `202` Przyjęto
- `400` Nieprawidłowe żądanie
- `401` Nieautoryzowany
- `402` Wymagana płatność
- `409` HTTP 409
- `429` Zbyt wiele żądań

GET /v1/batches Kredyty: 0

#### Parametry zapytania

| Parametr | Typ | wymagane |
| --- | --- | --- |
| limit | integer Domyślnie `25` | opcjonalne |

#### Pola odpowiedzi

| Pole | Typ |
| --- | --- |
| `jobs[]` | object[] |
| `jobs[]` | object |
| `jobs[].id` | string |
| `jobs[].status` | string |
| `jobs[].total` | integer |
| `jobs[].counts` | object |
| `jobs[].counts.pending` | integer |
| `jobs[].counts.processing` | integer |
| `jobs[].counts.succeeded` | integer |
| `jobs[].counts.failed` | integer |
| `jobs[].counts.cancelled` | integer |
| `jobs[].billing` | object |
| `jobs[].billing.credits_charged` | integer |
| `jobs[].billing.credits_refunded` | integer |
| `jobs[].billing.credits_net` | integer |
| `jobs[].webhook` | object |
| `jobs[].webhook.configured` | boolean |
| `jobs[].webhook.status` | string |
| `jobs[].webhook.attempts` | integer |
| `jobs[].status_url` | string |
| `jobs[].results_url` | string |
| `jobs[].results_csv_url` | string |
| `jobs[].poll_after_ms` | integer \| null |
| `jobs[].created_at` | string |
| `jobs[].started_at` | string \| null |
| `jobs[].completed_at` | string \| null |
| `jobs[].cancelled_at` | string \| null |
| `jobs[].updated_at` | string |
| `jobs[].processing_deadline_at` | string |
| `jobs[].results_expires_at` | string |
| `retention_hours` | integer |

#### Przykładowe żądanie

```bash
curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/batches?limit=25"
```

```javascript
const response = await fetch("https://domscan.net/v1/batches?limit=25", {
  headers: { "X-API-Key": process.env.DOMSCAN_API_KEY },
});
const data = await response.json();
console.log(data);
```

```python
import os
import requests

response = requests.get(
    "https://domscan.net/v1/batches?limit=25",
    headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
)
print(response.json())
```

```go
package main

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://domscan.net/v1/batches?limit=25", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))

```ruby
require "json"
require "net/http"

uri = URI("https://domscan.net/v1/batches?limit=25")
request = Net::HTTP::Get.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")

#### Przykładowa odpowiedź

```json
{
  "jobs": [
    {
      "id": "example-id",
      "status": "queued",
      "total": 1,
      "counts": {
        "pending": 1,
        "processing": 1,
        "succeeded": 1,
        "failed": 1,
        "cancelled": 1
      },
      "billing": {
        "credits_charged": 1,
        "credits_refunded": 1,
        "credits_net": 1
      },
      "webhook": {
        "configured": false,
        "status": "not_configured",
        "attempts": 1
      },
      "status_url": "https://example.com",
      "results_url": "https://example.com",
      "results_csv_url": "https://example.com",
      "created_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",
      "poll_after_ms": 1,
      "started_at": "2026-08-27T12:00:00Z",
      "completed_at": "2026-08-27T12:00:00Z",
      "cancelled_at": "2026-08-27T12:00:00Z"
    }
  ],
  "retention_hours": 24
}
```

#### Kody statusu HTTP

- `200` OK
- `400` Nieprawidłowe żądanie
- `401` Nieautoryzowany
- `429` Zbyt wiele żądań

GET /v1/batches/: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.total` | integer |
| `job.counts` | object |
| `job.counts.pending` | integer |
| `job.counts.processing` | integer |
| `job.counts.succeeded` | integer |
| `job.counts.failed` | integer |
| `job.counts.cancelled` | integer |
| `job.billing` | object |
| `job.billing.credits_charged` | integer |
| `job.billing.credits_refunded` | integer |
| `job.billing.credits_net` | integer |
| `job.webhook` | object |
| `job.webhook.configured` | boolean |
| `job.webhook.status` | string |
| `job.webhook.attempts` | integer |
| `job.status_url` | string |
| `job.results_url` | string |
| `job.results_csv_url` | string |
| `job.poll_after_ms` | integer \| null |
| `job.created_at` | string |
| `job.started_at` | string \| null |
| `job.completed_at` | string \| null |
| `job.cancelled_at` | string \| null |
| `job.updated_at` | string |
| `job.processing_deadline_at` | string |
| `job.results_expires_at` | string |

#### Przykładowe żądanie

```bash
curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/batches/string"
```

```javascript
const response = await fetch("https://domscan.net/v1/batches/string", {
  headers: { "X-API-Key": process.env.DOMSCAN_API_KEY },
});
const data = await response.json();
console.log(data);
```

```python
import os
import requests

response = requests.get(
    "https://domscan.net/v1/batches/string",
    headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
)
print(response.json())
```

```go
package main

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://domscan.net/v1/batches/string", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))

```ruby
require "json"
require "net/http"

uri = URI("https://domscan.net/v1/batches/string")
request = Net::HTTP::Get.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")

#### Przykładowa odpowiedź

```json
{
  "job": {
    "id": "example-id",
    "status": "queued",
    "total": 1,
    "counts": {
      "pending": 1,
      "processing": 1,
      "succeeded": 1,
      "failed": 1,
      "cancelled": 1
    },
    "billing": {
      "credits_charged": 1,
      "credits_refunded": 1,
      "credits_net": 1
    },
    "webhook": {
      "configured": false,
      "status": "not_configured",
      "attempts": 1
    },
    "status_url": "https://example.com",
    "results_url": "https://example.com",
    "results_csv_url": "https://example.com",
    "created_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",
    "poll_after_ms": 1,
    "started_at": "2026-08-27T12:00:00Z",
    "completed_at": "2026-08-27T12:00:00Z",
    "cancelled_at": "2026-08-27T12:00:00Z"
  }
}
```

#### Kody statusu HTTP

- `200` OK
- `401` Nieautoryzowany
- `404` Nie znaleziono
- `429` Zbyt wiele żądań

GET /v1/batches/:job_id/results Kredyty: 0

#### Parametry zapytania

| Parametr | Typ | wymagane |
| --- | --- | --- |
| job_id | string | wymagane |
| after | integer Domyślnie `-1` | opcjonalne |
| limit | integer Domyślnie `100` | opcjonalne |
| format | string Dozwolone wartości `json`, `csv` Domyślnie `json` | opcjonalne |

#### Pola odpowiedzi

| Pole | Typ |
| --- | --- |
| `job` | object |
| `job.id` | string |
| `job.status` | string |
| `job.total` | integer |
| `job.counts` | object |
| `job.counts.pending` | integer |
| `job.counts.processing` | integer |
| `job.counts.succeeded` | integer |
| `job.counts.failed` | integer |
| `job.counts.cancelled` | integer |
| `job.billing` | object |
| `job.billing.credits_charged` | integer |
| `job.billing.credits_refunded` | integer |
| `job.billing.credits_net` | integer |
| `job.webhook` | object |
| `job.webhook.configured` | boolean |
| `job.webhook.status` | string |
| `job.webhook.attempts` | integer |
| `job.status_url` | string |
| `job.results_url` | string |
| `job.results_csv_url` | string |
| `job.poll_after_ms` | integer \| null |
| `job.created_at` | string |
| `job.started_at` | string \| null |
| `job.completed_at` | string \| null |
| `job.cancelled_at` | string \| null |
| `job.updated_at` | string |
| `job.processing_deadline_at` | string |
| `job.results_expires_at` | string |
| `results[]` | object[] |
| `results[]` | object |
| `results[].position` | integer |
| `results[].reference` | string \| null |
| `results[].request` | object |
| `results[].request.method` | string |
| `results[].request.path` | string |
| `results[].request.query` | object |
| `results[].status` | string |
| `results[].attempts` | integer |
| `results[].http_status` | integer \| null |
| `results[].result` | object \| null |
| `results[].error` | object \| null |
| `results[].billing` | object |
| `results[].started_at` | string \| null |
| `results[].completed_at` | string \| null |
| `next_after` | integer \| null |

#### Przykładowe żądanie

```bash
curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/batches/example/results?after=-1&limit=25&format=json"
```

```javascript
const response = await fetch("https://domscan.net/v1/batches/example/results?after=-1&limit=25&format=json", {
  headers: { "X-API-Key": process.env.DOMSCAN_API_KEY },
});
const data = await response.json();
console.log(data);
```

```python
import os
import requests

response = requests.get(
    "https://domscan.net/v1/batches/example/results?after=-1&limit=25&format=json",
    headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
)
print(response.json())
```

```go
package main

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://domscan.net/v1/batches/example/results?after=-1&limit=25&format=json", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))

```ruby
require "json"
require "net/http"

uri = URI("https://domscan.net/v1/batches/example/results?after=-1&limit=25&format=json")
request = Net::HTTP::Get.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")

#### Przykładowa odpowiedź

```json
{
  "job": {
    "id": "example-id",
    "status": "queued",
    "total": 1,
    "counts": {
      "pending": 1,
      "processing": 1,
      "succeeded": 1,
      "failed": 1,
      "cancelled": 1
    },
    "billing": {
      "credits_charged": 1,
      "credits_refunded": 1,
      "credits_net": 1
    },
    "webhook": {
      "configured": false,
      "status": "not_configured",
      "attempts": 1
    },
    "status_url": "https://example.com",
    "results_url": "https://example.com",
    "results_csv_url": "https://example.com",
    "created_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",
    "poll_after_ms": 1,
    "started_at": "2026-08-27T12:00:00Z",
    "completed_at": "2026-08-27T12:00:00Z",
    "cancelled_at": "2026-08-27T12:00:00Z"
  },
  "results": [
    {
      "position": 1,
      "request": {
        "method": "GET",
        "path": "example",
        "query": {}
      },
      "status": "pending",
      "attempts": 1,
      "http_status": 1,
      "result": {},
      "error": {},
      "billing": {},
      "reference": "example",
      "started_at": "2026-08-27T12:00:00Z",
      "completed_at": "2026-08-27T12:00:00Z"
    }
  ],
  "next_after": 1
}
```

#### Kody statusu HTTP

- `200` OK
- `400` Nieprawidłowe żądanie
- `401` Nieautoryzowany
- `404` Nie znaleziono
- `429` Zbyt wiele żądań

DELETE /v1/batches/: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.total` | integer |
| `job.counts` | object |
| `job.counts.pending` | integer |
| `job.counts.processing` | integer |
| `job.counts.succeeded` | integer |
| `job.counts.failed` | integer |
| `job.counts.cancelled` | integer |
| `job.billing` | object |
| `job.billing.credits_charged` | integer |
| `job.billing.credits_refunded` | integer |
| `job.billing.credits_net` | integer |
| `job.webhook` | object |
| `job.webhook.configured` | boolean |
| `job.webhook.status` | string |
| `job.webhook.attempts` | integer |
| `job.status_url` | string |
| `job.results_url` | string |
| `job.results_csv_url` | string |
| `job.poll_after_ms` | integer \| null |
| `job.created_at` | string |
| `job.started_at` | string \| null |
| `job.completed_at` | string \| null |
| `job.cancelled_at` | string \| null |
| `job.updated_at` | string |
| `job.processing_deadline_at` | string |
| `job.results_expires_at` | string |

#### Przykładowe żądanie

```bash
curl -X DELETE "https://domscan.net/v1/batches/string" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $DOMSCAN_API_KEY" \
  -d '{}'
```

```javascript
const response = await fetch("https://domscan.net/v1/batches/string", {
  method: "DELETE",
  headers: { "X-API-Key": process.env.DOMSCAN_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({}),
});
const data = await response.json();
console.log(data);
```

```python
import os
import requests

response = requests.delete(
    "https://domscan.net/v1/batches/string",
    headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
    json={},
)
print(response.json())
```

```go
package main

func main() {
	body := strings.NewReader(`{}`)
	req, err := http.NewRequest(http.MethodDelete, "https://domscan.net/v1/batches/string", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))
	req.Header.Set("Content-Type", "application/json")

```ruby
require "json"
require "net/http"

uri = URI("https://domscan.net/v1/batches/string")
request = Net::HTTP::Delete.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")
request["Content-Type"] = "application/json"
request.body = JSON.generate({})

#### Przykładowa odpowiedź

```json
{
  "job": {
    "id": "example-id",
    "status": "queued",
    "total": 1,
    "counts": {
      "pending": 1,
      "processing": 1,
      "succeeded": 1,
      "failed": 1,
      "cancelled": 1
    },
    "billing": {
      "credits_charged": 1,
      "credits_refunded": 1,
      "credits_net": 1
    },
    "webhook": {
      "configured": false,
      "status": "not_configured",
      "attempts": 1
    },
    "status_url": "https://example.com",
    "results_url": "https://example.com",
    "results_csv_url": "https://example.com",
    "created_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",
    "poll_after_ms": 1,
    "started_at": "2026-08-27T12:00:00Z",
    "completed_at": "2026-08-27T12:00:00Z",
    "cancelled_at": "2026-08-27T12:00:00Z"
  }
}
```

#### Kody statusu HTTP

- `202` Przyjęto
- `401` Nieautoryzowany
- `404` Nie znaleziono
- `409` HTTP 409
- `429` Zbyt wiele żądań

GET /v1/jobs Kredyty: 0

#### Parametry zapytania

| Parametr | Typ | wymagane |
| --- | --- | --- |
| limit | integer Domyślnie `25` | opcjonalne |
| cursor | string | opcjonalne |
| kind | string Dozwolone wartości `batch`, `tech_scan`, `scrape`, `domain_discovery`, `crawl` | opcjonalne |

#### Pola odpowiedzi

| Pole | Typ |
| --- | --- |
| `jobs[]` | object[] |
| `jobs[]` | object |
| `jobs[].id` | string |
| `jobs[].kind` | string |
| `jobs[].status` | string |
| `jobs[].native_status` | string |
| `jobs[].created_at` | string \| null |
| `jobs[].updated_at` | string \| null |
| `jobs[].started_at` | string \| null |
| `jobs[].completed_at` | string \| null |
| `jobs[].results_expires_at` | string \| null |
| `jobs[].progress` | object |
| `jobs[].progress.total` | integer |
| `jobs[].progress.done` | integer |
| `jobs[].progress.succeeded` | integer |
| `jobs[].progress.failed` | integer |
| `jobs[].progress.cancelled` | integer |
| `jobs[].credits` | object |
| `jobs[].credits.charged` | integer |
| `jobs[].credits.refunded` | integer |
| `jobs[].notify_webhook` | object |
| `jobs[].notify_webhook.endpoint_id` | string \| null |
| `jobs[].notify_webhook.status` | string |
| `jobs[].notify_webhook.event_type` | string \| null |
| `jobs[].notify_webhook.deliveries` | integer |
| `jobs[].links` | object |
| `jobs[].links.self` | string |
| `jobs[].links.results` | string |
| `jobs[].links.cancel` | string \| null |
| `limit` | integer |
| `has_more` | boolean |
| `next_cursor` | string \| null |

#### Przykładowe żądanie

```bash
curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/jobs?limit=25&cursor=example&kind=batch"
```

```javascript
const response = await fetch("https://domscan.net/v1/jobs?limit=25&cursor=example&kind=batch", {
  headers: { "X-API-Key": process.env.DOMSCAN_API_KEY },
});
const data = await response.json();
console.log(data);
```

```python
import os
import requests

response = requests.get(
    "https://domscan.net/v1/jobs?limit=25&cursor=example&kind=batch",
    headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
)
print(response.json())
```

```go
package main

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://domscan.net/v1/jobs?limit=25&cursor=example&kind=batch", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))

```ruby
require "json"
require "net/http"

uri = URI("https://domscan.net/v1/jobs?limit=25&cursor=example&kind=batch")
request = Net::HTTP::Get.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")

#### Przykładowa odpowiedź

```json
{
  "jobs": [
    {
      "id": "example-id",
      "kind": "batch",
      "status": "queued",
      "native_status": "queued",
      "created_at": "2026-08-27T12:00:00Z",
      "updated_at": "2026-08-27T12:00:00Z",
      "started_at": "2026-08-27T12:00:00Z",
      "completed_at": "2026-08-27T12:00:00Z",
      "results_expires_at": "2026-08-27T12:00:00Z",
      "progress": {
        "total": 1,
        "done": 1,
        "succeeded": 1,
        "failed": 1,
        "cancelled": 1
      },
      "credits": {
        "charged": 1,
        "refunded": 1
      },
      "notify_webhook": {
        "endpoint_id": "example",
        "status": "waiting",
        "event_type": "job.completed",
        "deliveries": 1
      },
      "links": {
        "self": "https://example.com",
        "results": "https://example.com",
        "cancel": "https://example.com"
      }
    }
  ],
  "limit": 1,
  "has_more": false,
  "next_cursor": "example"
}
```

#### Kody statusu HTTP

- `200` OK
- `400` Nieprawidłowe żądanie
- `401` Nieautoryzowany
- `429` Zbyt wiele żądań

GET /v1/jobs/:job_id Kredyty: 0

#### Parametry zapytania

| Parametr | Typ | wymagane |
| --- | --- | --- |
| job_id | string | wymagane |

#### Pola odpowiedzi

| Pole | Typ |
| --- | --- |
| `job` | object |
| `job.id` | string |
| `job.kind` | string |
| `job.status` | string |
| `job.native_status` | string |
| `job.created_at` | string \| null |
| `job.updated_at` | string \| null |
| `job.started_at` | string \| null |
| `job.completed_at` | string \| null |
| `job.results_expires_at` | string \| null |
| `job.progress` | object |
| `job.progress.total` | integer |
| `job.progress.done` | integer |
| `job.progress.succeeded` | integer |
| `job.progress.failed` | integer |
| `job.progress.cancelled` | integer |
| `job.credits` | object |
| `job.credits.charged` | integer |
| `job.credits.refunded` | integer |
| `job.notify_webhook` | object |
| `job.notify_webhook.endpoint_id` | string \| null |
| `job.notify_webhook.status` | string |
| `job.notify_webhook.event_type` | string \| null |
| `job.notify_webhook.deliveries` | integer |
| `job.links` | object |
| `job.links.self` | string |
| `job.links.results` | string |
| `job.links.cancel` | string \| null |

#### Przykładowe żądanie

```bash
curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/jobs/string"
```

```javascript
const response = await fetch("https://domscan.net/v1/jobs/string", {
  headers: { "X-API-Key": process.env.DOMSCAN_API_KEY },
});
const data = await response.json();
console.log(data);
```

```python
import os
import requests

response = requests.get(
    "https://domscan.net/v1/jobs/string",
    headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
)
print(response.json())
```

```go
package main

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://domscan.net/v1/jobs/string", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))

```ruby
require "json"
require "net/http"

uri = URI("https://domscan.net/v1/jobs/string")
request = Net::HTTP::Get.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")

#### Przykładowa odpowiedź

```json
{
  "job": {
    "id": "example-id",
    "kind": "batch",
    "status": "queued",
    "native_status": "queued",
    "created_at": "2026-08-27T12:00:00Z",
    "updated_at": "2026-08-27T12:00:00Z",
    "started_at": "2026-08-27T12:00:00Z",
    "completed_at": "2026-08-27T12:00:00Z",
    "results_expires_at": "2026-08-27T12:00:00Z",
    "progress": {
      "total": 1,
      "done": 1,
      "succeeded": 1,
      "failed": 1,
      "cancelled": 1
    },
    "credits": {
      "charged": 1,
      "refunded": 1
    },
    "notify_webhook": {
      "endpoint_id": "example",
      "status": "waiting",
      "event_type": "job.completed",
      "deliveries": 1
    },
    "links": {
      "self": "https://example.com",
      "results": "https://example.com",
      "cancel": "https://example.com"
    }
  }
}
```

#### Kody statusu HTTP

- `200` OK
- `401` Nieautoryzowany
- `404` Nie znaleziono
- `429` Zbyt wiele żądań

GET /v1/jobs/:job_id/results Kredyty: 0

#### Parametry zapytania

| Parametr | Typ | wymagane |
| --- | --- | --- |
| job_id | string | wymagane |
| limit | integer Domyślnie `25` | opcjonalne |
| cursor | string | opcjonalne |

#### Pola odpowiedzi

| Pole | Typ |
| --- | --- |
| `job` | object |
| `job.id` | string |
| `job.kind` | string |
| `job.status` | string |
| `job.native_status` | string |
| `job.created_at` | string \| null |
| `job.updated_at` | string \| null |
| `job.started_at` | string \| null |
| `job.completed_at` | string \| null |
| `job.results_expires_at` | string \| null |
| `job.progress` | object |
| `job.progress.total` | integer |
| `job.progress.done` | integer |
| `job.progress.succeeded` | integer |
| `job.progress.failed` | integer |
| `job.progress.cancelled` | integer |
| `job.credits` | object |
| `job.credits.charged` | integer |
| `job.credits.refunded` | integer |
| `job.notify_webhook` | object |
| `job.notify_webhook.endpoint_id` | string \| null |
| `job.notify_webhook.status` | string |
| `job.notify_webhook.event_type` | string \| null |
| `job.notify_webhook.deliveries` | integer |
| `job.links` | object |
| `job.links.self` | string |
| `job.links.results` | string |
| `job.links.cancel` | string \| null |
| `results[]` | object[] |
| `results[]` | object |
| `results[].index` | integer |
| `results[].status` | string |
| `results[].reference` | string \| null |
| `results[].input` | unknown |
| `results[].data` | object \| null |
| `results[].error` | object |
| `results[].error.code` | string |
| `results[].error.message` | string |
| `results[].error.retryable` | boolean |
| `results[].credits` | object |
| `results[].credits.charged` | integer |
| `results[].credits.refunded` | integer |
| `limit` | integer |
| `has_more` | boolean |
| `next_cursor` | string \| null |

#### Przykładowe żądanie

```bash
curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/jobs/string/results?limit=25&cursor=example"
```

```javascript
const response = await fetch("https://domscan.net/v1/jobs/string/results?limit=25&cursor=example", {
  headers: { "X-API-Key": process.env.DOMSCAN_API_KEY },
});
const data = await response.json();
console.log(data);
```

```python
import os
import requests

response = requests.get(
    "https://domscan.net/v1/jobs/string/results?limit=25&cursor=example",
    headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
)
print(response.json())
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://domscan.net/v1/jobs/string/results?limit=25&cursor=example", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))

```ruby
require "json"
require "net/http"

uri = URI("https://domscan.net/v1/jobs/string/results?limit=25&cursor=example")
request = Net::HTTP::Get.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")

#### Przykładowa odpowiedź

```json
{
  "job": {
    "id": "example-id",
    "kind": "batch",
    "status": "queued",
    "native_status": "queued",
    "created_at": "2026-08-27T12:00:00Z",
    "updated_at": "2026-08-27T12:00:00Z",
    "started_at": "2026-08-27T12:00:00Z",
    "completed_at": "2026-08-27T12:00:00Z",
    "results_expires_at": "2026-08-27T12:00:00Z",
    "progress": {
      "total": 1,
      "done": 1,
      "succeeded": 1,
      "failed": 1,
      "cancelled": 1
    },
    "credits": {
      "charged": 1,
      "refunded": 1
    },
    "notify_webhook": {
      "endpoint_id": "example",
      "status": "waiting",
      "event_type": "job.completed",
      "deliveries": 1
    },
    "links": {
      "self": "https://example.com",
      "results": "https://example.com",
      "cancel": "https://example.com"
    }
  },
  "results": [
    {
      "index": 1,
      "status": "pending",
      "reference": "example",
      "input": "example",
      "data": {},
      "error": {
        "code": "example",
        "message": "Request completed",
        "retryable": false
      },
      "credits": {
        "charged": 1,
        "refunded": 1
      }
    }
  ],
  "limit": 1,
  "has_more": false,
  "next_cursor": "example"
}
```

#### Kody statusu HTTP

- `200` OK
- `400` Nieprawidłowe żądanie
- `401` Nieautoryzowany
- `404` Nie znaleziono
- `410` HTTP 410
- `429` Zbyt wiele żądań

POST /v1/jobs/:job_id/cancel Kredyty: 0

#### Parametry zapytania

| Parametr | Typ | wymagane |
| --- | --- | --- |
| job_id | string | wymagane |

#### Pola odpowiedzi

| Pole | Typ |
| --- | --- |
| `job` | object |
| `job.id` | string |
| `job.kind` | string |
| `job.status` | string |
| `job.native_status` | string |
| `job.created_at` | string \| null |
| `job.updated_at` | string \| null |
| `job.started_at` | string \| null |
| `job.completed_at` | string \| null |
| `job.results_expires_at` | string \| null |
| `job.progress` | object |
| `job.progress.total` | integer |
| `job.progress.done` | integer |
| `job.progress.succeeded` | integer |
| `job.progress.failed` | integer |
| `job.progress.cancelled` | integer |
| `job.credits` | object |
| `job.credits.charged` | integer |
| `job.credits.refunded` | integer |
| `job.notify_webhook` | object |
| `job.notify_webhook.endpoint_id` | string \| null |
| `job.notify_webhook.status` | string |
| `job.notify_webhook.event_type` | string \| null |
| `job.notify_webhook.deliveries` | integer |
| `job.links` | object |
| `job.links.self` | string |
| `job.links.results` | string |
| `job.links.cancel` | string \| null |
| `cancellation` | string |

#### Przykładowe żądanie

```bash
curl -X POST "https://domscan.net/v1/jobs/string/cancel" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $DOMSCAN_API_KEY" \
  -d '{}'
```

```javascript
const response = await fetch("https://domscan.net/v1/jobs/string/cancel", {
  method: "POST",
  headers: { "X-API-Key": process.env.DOMSCAN_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({}),
});
const data = await response.json();
console.log(data);
```

```python
import os
import requests

response = requests.post(
    "https://domscan.net/v1/jobs/string/cancel",
    headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
    json={},
)
print(response.json())
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
	"strings"
)

func main() {
	body := strings.NewReader(`{}`)
	req, err := http.NewRequest(http.MethodPost, "https://domscan.net/v1/jobs/string/cancel", 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))
}
```

```ruby
require "json"
require "net/http"

uri = URI("https://domscan.net/v1/jobs/string/cancel")
request = Net::HTTP::Post.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")
request["Content-Type"] = "application/json"
request.body = JSON.generate({})

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ź

```json
{
  "job": {
    "id": "example-id",
    "kind": "batch",
    "status": "queued",
    "native_status": "queued",
    "created_at": "2026-08-27T12:00:00Z",
    "updated_at": "2026-08-27T12:00:00Z",
    "started_at": "2026-08-27T12:00:00Z",
    "completed_at": "2026-08-27T12:00:00Z",
    "results_expires_at": "2026-08-27T12:00:00Z",
    "progress": {
      "total": 1,
      "done": 1,
      "succeeded": 1,
      "failed": 1,
      "cancelled": 1
    },
    "credits": {
      "charged": 1,
      "refunded": 1
    },
    "notify_webhook": {
      "endpoint_id": "example",
      "status": "waiting",
      "event_type": "job.completed",
      "deliveries": 1
    },
    "links": {
      "self": "https://example.com",
      "results": "https://example.com",
      "cancel": "https://example.com"
    }
  },
  "cancellation": "accepted"
}
```

#### Kody statusu HTTP

- `200` OK
- `202` Przyjęto
- `401` Nieautoryzowany
- `404` Nie znaleziono
- `409` HTTP 409
- `429` Zbyt wiele żądań
