Skip to main content
POST
/
api
/
v1
/
pdf
/
extract
curl -X POST https://api.hypermodel.ai/api/v1/pdf/extract \
  -H "Content-Type: application/json" \
  -d '{
    "pdfUrl": "https://example.com/financial-report.pdf",
    "schema": {
      "type": "object",
      "properties": {
        "company_name": { "type": "string" },
        "revenue": { "type": "string" },
        "employees": { "type": "number" },
        "founded_year": { "type": "number" }
      }
    },
    "prompt": "Extract company financial information"
  }'
{
  "success": true,
  "data": {
    "company_name": "Example Corp",
    "revenue": "$10M",
    "employees": 50,
    "founded_year": 2020
  }
}
This endpoint does not require authentication

Body Parameters

pdfUrl
string
required
URL of the PDF document to extract data from
schema
object
required
JSON Schema defining the structure of data to extract
prompt
string
Optional custom prompt to guide extraction
curl -X POST https://api.hypermodel.ai/api/v1/pdf/extract \
  -H "Content-Type: application/json" \
  -d '{
    "pdfUrl": "https://example.com/financial-report.pdf",
    "schema": {
      "type": "object",
      "properties": {
        "company_name": { "type": "string" },
        "revenue": { "type": "string" },
        "employees": { "type": "number" },
        "founded_year": { "type": "number" }
      }
    },
    "prompt": "Extract company financial information"
  }'
{
  "success": true,
  "data": {
    "company_name": "Example Corp",
    "revenue": "$10M",
    "employees": 50,
    "founded_year": 2020
  }
}

Use Cases

Extract key financial metrics from annual reports, quarterly statements, or financial summaries.
{
  "pdfUrl": "https://example.com/annual-report.pdf",
  "schema": {
    "type": "object",
    "properties": {
      "revenue": { "type": "string" },
      "profit": { "type": "string" },
      "growth_rate": { "type": "string" }
    }
  }
}
Extract structured information from candidate resumes or CVs.
{
  "pdfUrl": "https://example.com/resume.pdf",
  "schema": {
    "type": "object",
    "properties": {
      "name": { "type": "string" },
      "email": { "type": "string" },
      "phone": { "type": "string" },
      "experience": { "type": "array" },
      "education": { "type": "array" }
    }
  }
}
Parse invoice details for accounting or expense management systems.
{
  "pdfUrl": "https://example.com/invoice.pdf",
  "schema": {
    "type": "object",
    "properties": {
      "invoice_number": { "type": "string" },
      "date": { "type": "string" },
      "total": { "type": "number" },
      "items": { "type": "array" }
    }
  }
}
Extract key terms and information from legal contracts or agreements.
{
  "pdfUrl": "https://example.com/contract.pdf",
  "schema": {
    "type": "object",
    "properties": {
      "parties": { "type": "array" },
      "start_date": { "type": "string" },
      "end_date": { "type": "string" },
      "value": { "type": "string" }
    }
  }
}

Tips for Better Results

Clear Schema

Define a clear, specific schema that matches the structure of data in your PDF

Custom Prompts

Use custom prompts to guide the AI to focus on specific sections or data types

Accessible PDFs

Ensure PDFs are text-based or have OCR applied for best extraction results

Test Incrementally

Start with simple extractions and gradually add more fields to your schema
I