---
title: LlamaParse documentation | Developer Documentation
description: LlamaParse is the document processing platform from LlamaIndex. Parse converts PDFs, scans and Office files to markdown or JSON; Extract returns JSON in your schema; Classify, Split and Index cover sorting, segmenting and retrieval. One API key, with SDKs for Python, TypeScript, Go and Java.
---

## Your first result in under a minute

One API key, one SDK, five products. Get a key, install, run a sample.

[Open the quickstart ](/llamaparse/quickstart/index.md)[Get API key](https://cloud.llamaindex.ai)

## Available document APIs

LlamaParse is the document processing platform from LlamaIndex. Each product is a separate API on the same key and SDK. Chain them (Split, then Extract) or use one on its own.

[******](/llamaparse/parse/index.md)

[******************](/llamaparse/parse/index.md)

[**](/llamaparse/parse/index.md)

[→](/llamaparse/parse/index.md)

```
# Quarterly report

| Region | Revenue |
| ------ | ------- |
| North  | 1,240   |
| South  |   980   |
```

### [Parse](/llamaparse/parse/index.md)

[Agentic OCR for 130+ formats. PDFs, scans, tables, and charts to clean markdown, text, or JSON.](/llamaparse/parse/index.md)

[**](/llamaparse/extract/index.md)

[*Jordan Lee* · Senior engineer](/llamaparse/extract/index.md)

[*jordan@example.com*](/llamaparse/extract/index.md)

[Skills: *Python*, *SQL*, Rust](/llamaparse/extract/index.md)

[****](/llamaparse/extract/index.md)

```
{
  "name": "Jordan Lee",
  "email": "jordan@example.com",
  "skills": ["Python", "SQL"]
}
```

### [Extract](/llamaparse/extract/index.md)

[Pull typed, schema-shaped data out of documents, with citations back to the page.](/llamaparse/extract/index.md)

[What was the Q3 revenue by region?↑](/llamaparse/cloud-index-v2/getting_started/index.md)

[Q3 financial summary · p.40.92](/llamaparse/cloud-index-v2/getting_started/index.md)

[Regional performance table · p.70.88](/llamaparse/cloud-index-v2/getting_started/index.md)

[Management discussion · p.20.81](/llamaparse/cloud-index-v2/getting_started/index.md)

### [Index](/llamaparse/cloud-index-v2/getting_started/index.md)

[Managed ingestion, embedding, and retrieval for RAG over your document set.](/llamaparse/cloud-index-v2/getting_started/index.md)

[INV-2041.pdfinvoice0.97](/llamaparse/classify/index.md)

[scan\_0312.jpgreceipt0.91](/llamaparse/classify/index.md)

[msa-final.docxcontract0.99](/llamaparse/classify/index.md)

[po-88210.pdfpurchase order0.94](/llamaparse/classify/index.md)

### [Classify](/llamaparse/classify/index.md)

[Sort documents by type using natural-language rules, no training data needed.](/llamaparse/classify/index.md)

[******invoice · p1–3](/llamaparse/split/index.md)

[**********contract · p4–8](/llamaparse/split/index.md)

[****receipt · p9–10](/llamaparse/split/index.md)

### [Split](/llamaparse/split/index.md)

[Break combined files into logical sections before you parse or extract.](/llamaparse/split/index.md)

## Try it

The samples run as written once `LLAMA_CLOUD_API_KEY` is set. First download the files they upload: a sample invoice, a sample resume, and a bundle of shipping documents that includes invoices and export certificates:

Terminal window

```
curl -fL -o document.pdf https://media.githubusercontent.com/media/run-llama/llama-datasets/main/llama_agents/invoice-contracts/invoice-2-1.pdf
curl -fL -o resume.pdf https://raw.githubusercontent.com/run-llama/llama_cloud_services/main/examples/extract/data/resumes/software_architect.pdf
curl -fL -o combined.pdf https://cloud.llamaindex.ai/assets/demos/split/shipping.pdf
```

## Examples

Python  TypeScript  cURL

Parse a document PDF in, markdown out  Extract structured data Your schema, filled from the file  Classify documents Types and confidence per file  Split a combined file Page ranges per section

```
from llama_cloud import LlamaCloud


client = LlamaCloud()  # Uses LLAMA_CLOUD_API_KEY env var


# Upload and parse a document
file = client.files.create(file="document.pdf", purpose="parse")
result = client.parsing.parse(
    file_id=file.id,
    tier="agentic",
    version="latest",
    expand=["markdown"],
)


# Get markdown output
print(result.markdown.pages[0].markdown)
```

```
import LlamaCloud from '@llamaindex/llama-cloud';
import fs from 'fs';


const client = new LlamaCloud(); // Uses LLAMA_CLOUD_API_KEY env var


// Upload and parse a document
const file = await client.files.create({
  file: fs.createReadStream('document.pdf'),
  purpose: 'parse',
});
const result = await client.parsing.parse({
  file_id: file.id,
  tier: 'agentic',
  version: 'latest',
  expand: ['markdown']
});


// Get markdown output
console.log(result.markdown.pages[0].markdown);
```

Terminal window

```
# Upload the document
curl -X POST \
  https://api.cloud.llamaindex.ai/api/v1/beta/files \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
  -F 'purpose=parse' \
  -F 'file=@document.pdf;type=application/pdf'


# Start a Parse job with the returned file id
curl -X POST \
  'https://api.cloud.llamaindex.ai/api/v2/parse' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
  --data '{
    "file_id": "<file_id>",
    "tier": "agentic",
    "version": "latest"
  }'


# Fetch the markdown once the job completes
curl -X GET \
  'https://api.cloud.llamaindex.ai/api/v2/parse/<job_id>?expand=markdown' \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
```

```
from pydantic import BaseModel, Field
from llama_cloud import LlamaCloud


# Define your schema
class Resume(BaseModel):
    name: str = Field(description="Full name of candidate")
    email: str = Field(description="Email address")
    skills: list[str] = Field(description="Technical skills")


client = LlamaCloud()


# Upload and extract
file = client.files.create(file="resume.pdf", purpose="extract")
job = client.extract.run(
    file_input=file.id,
    configuration={
        "data_schema": Resume.model_json_schema(),
        "tier": "agentic",
    },
)
print(job.extract_result)
```

```
import LlamaCloud from '@llamaindex/llama-cloud';
import { z } from 'zod';
import fs from 'fs';


// Define your schema with Zod
const ResumeSchema = z.object({
  name: z.string().describe('Full name of candidate'),
  email: z.string().describe('Email address'),
  skills: z.array(z.string()).describe('Technical skills'),
});


const client = new LlamaCloud();


// Upload and extract
const file = await client.files.create({
  file: fs.createReadStream('resume.pdf'),
  purpose: 'extract',
});
let job = await client.extract.run({
  file_input: file.id,
  configuration: {
    data_schema: z.toJSONSchema(ResumeSchema),
    tier: 'agentic',
  },
});
console.log(job.extract_result);
```

Terminal window

```
# Upload the document
curl -X 'POST' \
  'https://api.cloud.llamaindex.ai/api/v1/beta/files' \
  -H 'Content-Type: multipart/form-data' \
  -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
  -F 'file=@resume.pdf' \
  -F purpose='extract'


# Run Extract with an inline JSON schema
curl -X 'POST' \
  'https://api.cloud.llamaindex.ai/api/v2/extract?project_id={PROJECT_ID}' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
  -d '{
    "file_input": "{FILE_ID}",
    "configuration": {
      "tier": "agentic",
      "data_schema": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "description": "Full name of candidate" },
          "email": { "type": "string", "description": "Email address" },
          "skills": { "type": "array", "items": { "type": "string" }, "description": "Technical skills" }
        }
      }
    }
  }'
```

```
from llama_cloud import LlamaCloud


client = LlamaCloud()


# Upload a document
file = client.files.create(file="document.pdf", purpose="classify")


# Run Classify with natural-language rules and wait for the result
job = client.classify.run(
    file_input=file.id,
    configuration={
        "rules": [
            {
                "type": "invoice",
                "description": "Documents with invoice numbers, line items, and totals",
            },
            {
                "type": "receipt",
                "description": "Short POS receipts with merchant and total",
            },
            {
                "type": "contract",
                "description": "Legal agreements with terms and signatures",
            },
        ],
    },
)


# `run` raises PollingError if the job fails, so reaching here means it succeeded
print(f"Type: {job.result.type}, Confidence: {job.result.confidence}")
```

```
import LlamaCloud from '@llamaindex/llama-cloud';
import fs from 'fs';


const client = new LlamaCloud();


// Upload a document
const file = await client.files.create({
  file: fs.createReadStream('document.pdf'),
  purpose: 'classify',
});


// Run Classify with natural-language rules and wait for the result
const job = await client.classify.run({
  file_input: file.id,
  configuration: {
    rules: [
      {
        type: 'invoice',
        description: 'Documents with invoice numbers, line items, and totals',
      },
      {
        type: 'receipt',
        description: 'Short POS receipts with merchant and total',
      },
      {
        type: 'contract',
        description: 'Legal agreements with terms and signatures',
      },
    ],
  },
});


// `run` throws if the job fails, so reaching here means it succeeded
console.log(`Type: ${job.result!.type}, Confidence: ${job.result!.confidence}`);
```

```
import time


from llama_cloud import LlamaCloud


client = LlamaCloud()


# Upload a combined PDF
file = client.files.create(file="combined.pdf", purpose="split")


# Split into logical sections
job = client.beta.split.create(
    document_input={"type": "file_id", "value": file.id},
    configuration={
        "categories": [
            {
                "name": "invoice",
                "description": "Commercial document with line items and totals"
            },
            {
                "name": "certificate",
                "description": "Certificate of origin or other export certificate"
            },
        ]
    },
)


# Poll until the job reaches a terminal state (Split statuses are lowercase)
result = client.beta.split.get(job.id)
while result.status in ("pending", "processing"):
    time.sleep(2)
    result = client.beta.split.get(job.id)


for segment in result.result.segments:
    print(f"Pages {segment.pages}: {segment.category} ({segment.confidence_category})")
```

```
import LlamaCloud from '@llamaindex/llama-cloud';
import fs from 'fs';


const client = new LlamaCloud();


// Upload a combined PDF
const file = await client.files.create({
  file: fs.createReadStream('combined.pdf'),
  purpose: 'split',
});


// Split into logical sections
const job = await client.beta.split.create({
  document_input: { type: 'file_id', value: file.id },
  configuration: {
    categories: [
      {
        name: 'invoice',
        description: 'Commercial document with line items and totals',
      },
      {
        name: 'certificate',
        description: 'Certificate of origin or other export certificate',
      },
    ],
  },
});


// Poll until the job reaches a terminal state (Split statuses are lowercase)
let result = await client.beta.split.get(job.id);
while (result.status === 'pending' || result.status === 'processing') {
  await new Promise((resolve) => setTimeout(resolve, 2000));
  result = await client.beta.split.get(job.id);
}


for (const segment of result.result.segments) {
  console.log(`Pages ${segment.pages}: ${segment.category} (${segment.confidence_category})`);
}
```

Terminal window

```
# Upload the combined PDF
curl -X 'POST' \
  'https://api.cloud.llamaindex.ai/api/v1/beta/files' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
  -F 'purpose=split' \
  -F 'file=@combined.pdf;type=application/pdf'


# Start a Split job
curl -X 'POST' \
  'https://api.cloud.llamaindex.ai/api/v1/beta/split/jobs' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
  -d '{
    "document_input": { "type": "file_id", "value": "YOUR_FILE_ID" },
    "configuration": {
      "categories": [
        { "name": "invoice", "description": "Commercial document with line items and totals" },
        { "name": "certificate", "description": "Certificate of origin or other export certificate" }
      ]
    }
  }'


# Poll the job until it completes
curl -X 'GET' \
  'https://api.cloud.llamaindex.ai/api/v1/beta/split/jobs/YOUR_JOB_ID' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
```

[Open in playground ](https://cloud.llamaindex.ai/parse)

## Next steps

- [Quickstart](/llamaparse/quickstart/index.md): install the SDK in Python, TypeScript, Go, Java, or the CLI and run every product end to end.
- [API reference](/reference/index.md): every endpoint, request and response shape, across all SDKs.
- [Give your coding agent these docs](/llamaparse/for-agents/mcp/index.md): `claude mcp add llama-index-docs --transport http https://developers.llamaindex.ai/mcp`
