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

# Extract Information

> Extract structured information from documents (PDF or images)

<Note>
  This API requires authentication. See our [Authentication Guide](/common/authentication) for details.
</Note>

### Features

* Supports PDF and image files (jpg, jpeg, png)
* Accepts URLs or base64-encoded file content
* Maximum file size: 10MB
* Supports both direct schema and template-based extraction

### Input Options

1. Document URL
2. Base64 encoded file content
3. Direct extraction schema or template ID

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.example.com/api/extractor/v1/extract \
    -H "Authorization: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://example.com/document.pdf",
      "schema": {
        "fields": [
          {"name": "invoice_number", "type": "string"},
          {"name": "total_amount", "type": "number"}
        ]
      }
    }'
  ```

  ```python Python theme={null}
  import requests

  payload = {
      "url": "https://example.com/document.pdf",
      "schema": {
          "fields": [
              {"name": "invoice_number", "type": "string"},
              {"name": "total_amount", "type": "number"}
          ]
      }
  }

  response = requests.post(
      "https://api.example.com/api/extractor/v1/extract",
      headers={
          "Authorization": "YOUR_API_KEY",
          "Content-Type": "application/json"
      },
      json=payload
  )
  result = response.json()
  ```
</RequestExample>


## OpenAPI

````yaml POST /api/extractor/v1/extract
openapi: 3.1.0
info:
  title: Image Extraction API
  description: Extract structured data from images and PDFs
  version: 1.0.0
servers: []
security:
  - APIKeyHeader: []
paths:
  /api/extractor/v1/extract:
    post:
      tags:
        - extractor
      summary: Extract Information from Document
      description: |-
        Extract structured information from documents (PDF or images).
            
            **Features:**
            * Supports PDF and image files (jpg, jpeg, png)
            * Accepts URLs or base64-encoded file content
            * Maximum file size: 10MB
            * Supports both direct schema and template-based extraction
            
            **Input Options:**
            1. Document URL
            2. Base64 encoded file content
            3. Direct extraction schema or template ID
      operationId: extract_text_api_extractor_v1_extract_post
      requestBody:
        content:
          application/json:
            schema:
              type: object
              title: Request Data
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtractionResponse'
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              examples:
                no_document:
                  summary: No document provided
                  value:
                    detail: No document provided
                invalid_type:
                  summary: Invalid file type
                  value:
                    detail: Unsupported file type
                file_too_large:
                  summary: File too large
                  value:
                    detail: File too large
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
        '422':
          description: Validation error in request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
      security:
        - APIKeyHeader: []
components:
  schemas:
    ExtractionResponse:
      properties:
        data:
          type: object
          title: Data
        confidence:
          type: number
          maximum: 1
          minimum: 0
          title: Confidence
      type: object
      required:
        - data
        - confidence
      title: ExtractionResponse
    ErrorDetail:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: ErrorDetail
      description: Standard error response schema
    AuthError:
      properties:
        detail:
          type: string
          title: Detail
        error_code:
          type: string
          title: Error Code
          default: unauthorized
      type: object
      required:
        - detail
      title: AuthError
      description: Authentication error response schema
    ValidationError:
      properties:
        detail:
          items:
            type: object
          type: array
          title: Detail
      type: object
      required:
        - detail
      title: ValidationError
      description: Validation error response schema
    RateLimitError:
      properties:
        detail:
          type: string
          title: Detail
        retry_after:
          anyOf:
            - type: integer
            - type: 'null'
          title: Retry After
      type: object
      required:
        - detail
      title: RateLimitError
      description: Rate limit error response schema
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization
      description: Enter your API key

````