開発者向けリファレンス

非同期 API バッチ

対応する多数の API リクエストをキューに追加し、クライアント接続を開いたままにせず結果を取得できます。

非同期 API バッチ

対応する多数の API リクエストをキューに追加し、クライアント接続を開いたままにせず結果を取得できます。

POST /v1/batches

バッチ処理の仕組み

  • 各バッチでは、対応する公開 GET リクエストを最大 100 件まで受け付けます。
  • 各項目には通常のエンドポイント料金が適用され、最終的に失敗した項目は個別に返金されます。
  • ジョブのステータスと結果は、アカウントのすべてのメンバーが 24 時間確認できます。
  • 任意の HTTPS Webhook を設定すると、処理が最終状態に達したときにシステムへ通知できます。

リクエスト例

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

レスポンスフィールド

フィールド タイプ
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

レスポンス例

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

ポーリングとキャンセル

ステータスエンドポイントをポーリングし、順序どおりの結果を取得できます。また、開始前の処理はキャンセルできます。

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

Webhook の署名は、タイムスタンプ、ピリオド、リクエスト本文そのものを連結したデータに HMAC-SHA256 を適用して生成されます。通知を受け入れる前にタイムスタンプを検証してください。

X-DomScan-Event: batch.completed
X-DomScan-Timestamp: 1785231000
X-DomScan-Signature: sha256=...
POST /v1/domain-discovery/jobs

ボディパラメータ

パラメータ タイプ 必須
tlds string[] 必須
limit integer オプション
cursor string オプション
min_length integer
デフォルト 3
オプション
max_length integer
デフォルト 16
オプション
singular_only boolean
デフォルト false
オプション

レスポンスフィールド

フィールド タイプ
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

リクエスト例

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

レスポンス例

{
  "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"
  }
}
GET /v1/batches

クエリパラメータ

パラメータ タイプ 必須
limit integer
デフォルト 25
オプション

レスポンスフィールド

フィールド タイプ
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

リクエスト例

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

レスポンス例

{
  "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
}
GET /v1/batches/:job_id

クエリパラメータ

パラメータ タイプ 必須
job_id string 必須

レスポンスフィールド

フィールド タイプ
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

リクエスト例

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

レスポンス例

{
  "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"
  }
}
GET /v1/batches/:job_id/results

クエリパラメータ

パラメータ タイプ 必須
job_id string 必須
after integer
デフォルト -1
オプション
limit integer
デフォルト 100
オプション
format string
許可された値 jsoncsv
デフォルト json
オプション

レスポンスフィールド

フィールド タイプ
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

リクエスト例

curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/batches/example/results?after=-1&limit=25&format=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
}
DELETE /v1/batches/:job_id

クエリパラメータ

パラメータ タイプ 必須
job_id string 必須

レスポンスフィールド

フィールド タイプ
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

リクエスト例

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

レスポンス例

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

素晴らしい企業の人々に使用されています

InstantOutseerMongoDBRespondentSage Expense ManagementInstantlyD.R. HortonWhatConvertsAdobeMotionElementsLLM Pulse