> 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/it/docs/batch

# Batch API asincroni

Accoda più richieste API supportate e raccogli i risultati senza mantenere aperta una connessione client.

POST /v1/batches

#### Come funziona l’elaborazione in batch

- Ogni batch accetta fino a 100 richieste GET pubbliche supportate.

- Ogni elemento mantiene il prezzo normale del proprio endpoint, e gli errori definitivi vengono rimborsati separatamente.

- Lo stato e i risultati del lavoro restano disponibili per tutti i membri dell’account per 24 ore.

- Un webhook HTTPS facoltativo può avvisare il tuo sistema quando l’elaborazione raggiunge uno stato definitivo.

#### Richiesta di esempio

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

#### Campi della risposta

| Campo | Tipo |
| --- | --- |
| `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 |

#### Risposta di esempio

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

### Verifica dello stato e annullamento

Interroga l’endpoint di stato, recupera i risultati in ordine o annulla il lavoro che non è ancora iniziato.

```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}
```

### Webhook di completamento firmati

Le firme dei webhook usano HMAC-SHA256 sul timestamp, un punto e il corpo esatto della richiesta. Verifica il timestamp prima di accettare una consegna.

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

### API unificata dei job

Leggi, sfoglia e annulla ogni job asincrono in un unico posto: batch API, scoperta di domini, scansioni delle tecnologie e job di scraping. I job continuano a essere creati sui propri endpoint, che funzionano senza modifiche. Tutte le operazioni di /v1/jobs sono gratuite.

```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
```

#### Struttura del job

Ogni job ha gli stessi campi: id, kind, status, timestamp, progress (total, done, succeeded, failed, cancelled), credits (charged, refunded) e link al job, ai suoi risultati e, finché può ancora essere annullato, alla relativa azione di annullamento. native_status conserva lo stato riportato dall’endpoint che ha creato il job.

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

#### Stati

queued e running indicano che il job è in corso. Un job in fase di annullamento riporta running finché l’annullamento non si conclude. completed significa che ogni elemento ha raggiunto uno stato finale, failed significa che il job è terminato senza alcun elemento riuscito e cancelled significa che il job è stato annullato. Gli elementi non riusciti sono conteggiati in progress.failed ed elencati nei risultati.

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

#### Paginazione

Sia l’elenco dei job sia la lettura dei risultati accettano limit (da 1 a 100, predefinito 25) e cursor. Passa il next_cursor della pagina precedente come cursor. Nell’ultima pagina vale null. I cursori sono firmati e legati al tuo account e al job, quindi un cursore modificato o di un altro account restituisce 400.

#### Annullamento

Annullare un job di batch API, scoperta di domini o scansione delle tecnologie ferma gli elementi non avviati e rimborsa i relativi crediti. Un elemento già in esecuzione può concludersi. Annullare un job già annullato restituisce 200. I job di scraping non possono essere annullati, e un job già terminato restituisce 409 con JOB_NOT_CANCELLABLE.

#### Webhook di completamento

Aggiungi notify_webhook: true a qualsiasi richiesta di creazione di un job per ricevere un evento firmato job.completed, job.failed o job.cancelled quando il job termina. L’evento viene inviato a ogni endpoint webhook firmato attivo che lo sottoscrive o che sottoscrive tutti gli eventi. Passa l’id di un endpoint al posto di true per inviarlo solo a quell’endpoint. Le consegne usano le stesse firme, gli stessi tentativi e lo stesso registro delle consegne degli avvisi di monitoraggio, e sono gratuite.

```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 Crediti: 1/item

#### Parametri del corpo

| Parametro | Tipo | obbligatorio |
| --- | --- | --- |
| notify_webhook | unknown | facoltativo |
| tlds | string[] | obbligatorio |
| limit | integer | facoltativo |
| cursor | string | facoltativo |
| min_length | integer Predefinito `3` | facoltativo |
| max_length | integer Predefinito `16` | facoltativo |
| singular_only | boolean Predefinito `false` | facoltativo |

#### Campi della risposta

| Campo | Tipo |
| --- | --- |
| `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 |

#### Richiesta di esempio

```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
})

#### Risposta di esempio

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

#### Codici di stato HTTP

- `200` OK
- `202` Accettato
- `400` Richiesta non valida
- `401` Non autorizzato
- `402` Pagamento richiesto
- `409` HTTP 409
- `429` Troppe richieste

GET /v1/batches Crediti: 0

#### Parametri di query

| Parametro | Tipo | obbligatorio |
| --- | --- | --- |
| limit | integer Predefinito `25` | facoltativo |

#### Campi della risposta

| Campo | Tipo |
| --- | --- |
| `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 |

#### Richiesta di esempio

```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")

#### Risposta di esempio

```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
}
```

#### Codici di stato HTTP

- `200` OK
- `400` Richiesta non valida
- `401` Non autorizzato
- `429` Troppe richieste

GET /v1/batches/:job_id Crediti: 0

#### Parametri di query

| Parametro | Tipo | obbligatorio |
| --- | --- | --- |
| job_id | string | obbligatorio |

#### Campi della risposta

| Campo | Tipo |
| --- | --- |
| `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 |

#### Richiesta di esempio

```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")

#### Risposta di esempio

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

#### Codici di stato HTTP

- `200` OK
- `401` Non autorizzato
- `404` Non trovato
- `429` Troppe richieste

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

#### Parametri di query

| Parametro | Tipo | obbligatorio |
| --- | --- | --- |
| job_id | string | obbligatorio |
| after | integer Predefinito `-1` | facoltativo |
| limit | integer Predefinito `100` | facoltativo |
| format | string Valori consentiti `json`, `csv` Predefinito `json` | facoltativo |

#### Campi della risposta

| Campo | Tipo |
| --- | --- |
| `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 |

#### Richiesta di esempio

```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")

#### Risposta di esempio

```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
}
```

#### Codici di stato HTTP

- `200` OK
- `400` Richiesta non valida
- `401` Non autorizzato
- `404` Non trovato
- `429` Troppe richieste

DELETE /v1/batches/:job_id Crediti: 0

#### Parametri di query

| Parametro | Tipo | obbligatorio |
| --- | --- | --- |
| job_id | string | obbligatorio |

#### Campi della risposta

| Campo | Tipo |
| --- | --- |
| `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 |

#### Richiesta di esempio

```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({})

#### Risposta di esempio

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

#### Codici di stato HTTP

- `202` Accettato
- `401` Non autorizzato
- `404` Non trovato
- `409` HTTP 409
- `429` Troppe richieste

GET /v1/jobs Crediti: 0

#### Parametri di query

| Parametro | Tipo | obbligatorio |
| --- | --- | --- |
| limit | integer Predefinito `25` | facoltativo |
| cursor | string | facoltativo |
| kind | string Valori consentiti `batch`, `tech_scan`, `scrape`, `domain_discovery`, `crawl` | facoltativo |

#### Campi della risposta

| Campo | Tipo |
| --- | --- |
| `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 |

#### Richiesta di esempio

```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")

#### Risposta di esempio

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

#### Codici di stato HTTP

- `200` OK
- `400` Richiesta non valida
- `401` Non autorizzato
- `429` Troppe richieste

GET /v1/jobs/:job_id Crediti: 0

#### Parametri di query

| Parametro | Tipo | obbligatorio |
| --- | --- | --- |
| job_id | string | obbligatorio |

#### Campi della risposta

| Campo | Tipo |
| --- | --- |
| `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 |

#### Richiesta di esempio

```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")

#### Risposta di esempio

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

#### Codici di stato HTTP

- `200` OK
- `401` Non autorizzato
- `404` Non trovato
- `429` Troppe richieste

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

#### Parametri di query

| Parametro | Tipo | obbligatorio |
| --- | --- | --- |
| job_id | string | obbligatorio |
| limit | integer Predefinito `25` | facoltativo |
| cursor | string | facoltativo |

#### Campi della risposta

| Campo | Tipo |
| --- | --- |
| `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 |

#### Richiesta di esempio

```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")

#### Risposta di esempio

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

#### Codici di stato HTTP

- `200` OK
- `400` Richiesta non valida
- `401` Non autorizzato
- `404` Non trovato
- `410` HTTP 410
- `429` Troppe richieste

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

#### Parametri di query

| Parametro | Tipo | obbligatorio |
| --- | --- | --- |
| job_id | string | obbligatorio |

#### Campi della risposta

| Campo | Tipo |
| --- | --- |
| `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 |

#### Richiesta di esempio

```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))
```

#### Risposta di esempio

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

#### Codici di stato HTTP

- `200` OK
- `202` Accettato
- `401` Non autorizzato
- `404` Non trovato
- `409` HTTP 409
- `429` Troppe richieste
