GET
/batch/distill/{id}
Ottieni Stato Job Distillazione Batch

Verifica lo stato e recupera i risultati di un job di distillazione batch.

Stati della Risposta:

  • processing: Il job e attualmente in esecuzione
  • completed: Tutti gli URL sono stati elaborati
  • failed: Il job ha riscontrato un errore fatale

Best Practice per il Polling:

  • Interroga ogni 5-10 secondi per job con <10 URL
  • Interroga ogni 30-60 secondi per job piu grandi
  • Usa i webhook per maggiore efficienza

Risultati Parziali: Puoi recuperare i risultati completati mentre il job e ancora in elaborazione. L'array results conterra tutti gli URL elaborati fino a quel momento.

Autorizzazione

YOUR_API_KEY
AutorizzazioneBearer <token>

Ottieni la tua API key dal Thunderbit Dashboard. Formato header: Authorization: Bearer YOUR_API_KEY

In: header

Parametri di percorso

id*stringobbligatorio

ID del task batch

Parametri query

pageintegerpredefinito:0

Page number (0-based), default 0

Intervallo richiesto:0 <= x
pageSizeintegerpredefinito:20

Number of results per page (1-100), default 20

Intervallo richiesto:1 <= x <= 100

Risposta

application/json

Success response

successboolean
Esempio:
true
dataobject
Mostra attributi figli
idstring
Esempio:batch_abc123
statusstring
Valore in"PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | "CANCELLED" | "UNKNOWN"
Esempio:COMPLETED
totalinteger
Esempio:
3
completedinteger
Esempio:
2
failedinteger

Number of failed URLs

Esempio:
1
creditsUsedinteger
Esempio:
2
createdAtstring

Timestamp when the job was created

completedAtstring

Timestamp when the job completed (null if still processing)

resultsobject[]
Mostra attributi figli
indexinteger

Zero-based index of this URL in the original batch

Esempio:
0
urlstring

The processed URL

statusstring

Per-URL processing status: PENDING, PROCESSING, SUCCEEDED, or FAILED

Valore in"PENDING" | "PROCESSING" | "SUCCEEDED" | "FAILED"
Esempio:SUCCEEDED
markdownstring

Extracted markdown content (present when status is SUCCEEDED)

errorobject

Error detail (present when status is FAILED)

Mostra attributi figli
codestring
Esempio:DISTILL_FAILED
messagestring
Esempio:Failed to fetch the page: Connection timeout

Paginazione

  • pageSize è impostato a 20 per impostazione predefinita, con un massimo di 100 per richiesta. Imposta pageSize=100 per ottenere il massimo in ogni chiamata.
  • Per batch con più di 100 risultati, incrementa page (a partire da 0) finché results non è vuoto: page=0, page=1, ecc.
  • Il campo total nella risposta indica il numero totale di risultati del batch.

On this page