> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spidra.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a parse batch

> A parse batch's progress, counts and every document's status, optionally with their results.

## Request

```bash theme={null}
curl "https://api.spidra.io/api/parse/batch/bd108121-f10b-407d-99d5-cb40a0939248" \
  -H "Authorization: Bearer $SPIDRA_API_KEY"
```

Add `?include=results` to get each finished document's Markdown too.

## Response

```json theme={null}
{
  "batchId": "bd108121-f10b-407d-99d5-cb40a0939248",
  "status": "completed",
  "counts": { "queued": 0, "running": 0, "completed": 2, "failed": 0 },
  "creditsUsed": 2,
  "documents": [
    { "jobId": "9cb7e05b-a16c-4fd5-8bae-ce9adf074cbf", "status": "completed", "fileName": "1706.03762", "sourceUrl": "https://arxiv.org/pdf/1706.03762", "fileId": "0b007010-b3f6-4398-a3ba-e5c2518839c8", "format": "PDF", "totalPages": 15, "pagesParsed": 1, "creditsUsed": 1 },
    { "jobId": "60c9f3bb-f43a-4407-a86d-a45107a7c4c8", "status": "completed", "fileName": "1706.03762", "sourceUrl": "https://arxiv.org/pdf/1706.03762", "fileId": "7578d785-660d-44fe-91ec-18bb4fe833b1", "format": "PDF", "totalPages": 15, "pagesParsed": 1, "creditsUsed": 1 }
  ]
}
```

`status` is `running` until every document has finished, then `completed`. Each document can also be read on its own with [GET /parse/\{jobId}](https://docs.spidra.io/api-reference/parse/parse-status.md).

## Errors

| Status | When |
| - | - |
| `404` | No parse batch with this ID on your account. |


## OpenAPI

````yaml GET /parse/batch/{batchId}
openapi: 3.1.0
info:
  title: Spidra API
  version: 1.0.0
  description: >-
    Public API endpoints for web scraping via Spidra. Authenticate with
    `Authorization: Bearer YOUR_API_KEY`.
servers:
  - url: https://api.spidra.io/api
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /parse/batch/{batchId}:
    get:
      tags:
        - Parse
      summary: Get a Parse Batch
      parameters:
        - name: batchId
          in: path
          required: true
          schema:
            type: string
        - name: include
          in: query
          required: false
          schema:
            type: string
            enum:
              - results
          description: Include each finished document's Markdown.
      responses:
        '200':
          description: Batch progress
          content:
            application/json:
              schema:
                type: object
                properties:
                  batchId:
                    type: string
                  status:
                    type: string
                    enum:
                      - running
                      - completed
                  counts:
                    type: object
                  creditsUsed:
                    type: integer
                  documents:
                    type: array
                    items:
                      type: object
                      properties:
                        jobId:
                          type: string
                        status:
                          type: string
                          enum:
                            - queued
                            - running
                            - completed
                            - failed
                        fileName:
                          type:
                            - string
                            - 'null'
                        sourceUrl:
                          type:
                            - string
                            - 'null'
                        fileId:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Parse the same file again with other options for 24
                            hours.
                        format:
                          type:
                            - string
                            - 'null'
                        totalPages:
                          type:
                            - integer
                            - 'null'
                        pagesParsed:
                          type:
                            - integer
                            - 'null'
                        creditsUsed:
                          type: integer
                        error:
                          type: string
                          description: >-
                            Why the document failed. Failed documents aren't
                            charged.
                        progress:
                          type: object
                          properties:
                            message:
                              type: string
                            done:
                              type: integer
                            total:
                              type: integer
                        markdown:
                          type: string
                        pages:
                          type: array
                          items:
                            type: object
                            properties:
                              pageNumber:
                                type: integer
                              markdown:
                                type: string
                              method:
                                type: string
                                enum:
                                  - text
                                  - ocr
                                description: 'text: the page''s own text; ocr: read with AI'
                              error:
                                type: string
                          description: With includePages (or ?pages=true).
                        json:
                          description: Extracted fields, when prompt or schema was given.
                        warnings:
                          type: array
                          items:
                            type: string
                        metadata:
                          type: object
                          properties:
                            fileName:
                              type:
                                - string
                                - 'null'
                            sourceUrl:
                              type:
                                - string
                                - 'null'
                            format:
                              type: string
                            totalPages:
                              type: integer
                            pagesParsed:
                              type: integer
                            ocrPages:
                              type: integer
                        durationMs:
                          type:
                            - integer
                            - 'null'
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.