<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ram</title>
    <description>The latest articles on DEV Community by Ram (@ramlabsdev).</description>
    <link>https://dev.to/ramlabsdev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3863717%2F0f4b608f-8b21-473a-9cae-c22863009dfb.png</url>
      <title>DEV Community: Ram</title>
      <link>https://dev.to/ramlabsdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ramlabsdev"/>
    <language>en</language>
    <item>
      <title>How to Extract Structured Data from Any Document with One API Call</title>
      <dc:creator>Ram</dc:creator>
      <pubDate>Mon, 06 Apr 2026 11:06:05 +0000</pubDate>
      <link>https://dev.to/ramlabsdev/how-to-extract-structured-data-from-any-document-with-one-api-call-9bb</link>
      <guid>https://dev.to/ramlabsdev/how-to-extract-structured-data-from-any-document-with-one-api-call-9bb</guid>
      <description>&lt;p&gt;Every developer has faced this: you have a PDF invoice, a scanned receipt, or a resume — and you need the data in JSON. The traditional approach involves OCR libraries, regex parsing, and lots of edge-case handling.&lt;/p&gt;

&lt;p&gt;I built &lt;a href="https://extract.ramlabs.dev" rel="noopener noreferrer"&gt;ScoutExtract&lt;/a&gt; to solve this with a single API call.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;Send a POST request with:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your &lt;strong&gt;document&lt;/strong&gt; (text, PDF as base64, or image as base64)&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;schema&lt;/strong&gt; describing the fields you want&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Get back typed JSON with &lt;strong&gt;confidence scores&lt;/strong&gt; for every field.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Example — Invoice Parsing
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
python
import requests

response = requests.post(
    "https://api.ramlabs.dev/v1/extract",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "document": """
            INVOICE #2024-0892
            Vendor: CloudStack Solutions Inc.
            Date: March 15, 2024

            API Integration    1    $2,500.00
            Cloud Hosting      3      $199.00

            Subtotal: $3,097.00
            Tax (8.875%): $274.86
            Total: $3,371.86
        """,
        "schema": "invoice"
    }
)

data = response.json()["data"]
print(f"Invoice: {data['invoice_number']['value']}")   # 2024-0892
print(f"Total: ${data['total']['value']}")              # 3371.86
print(f"Confidence: {data['total']['confidence']}")     # 0.99

Pre-built Schemas
ScoutExtract includes schemas for common document types:

Schema  Use Case
invoice Invoices, bills, purchase orders
receipt Store receipts, transaction records
resume  Resumes, CVs
contract    Agreements, legal contracts
Custom Schemas
Don't see your document type? Define your own:

custom_schema = {
    "product_name": {"type": "string"},
    "price_usd": {"type": "number"},
    "in_stock": {"type": "boolean"},
    "features": {
        "type": "array",
        "items": {"type": "string"}
    }
}

response = requests.post(
    "https://api.ramlabs.dev/v1/extract",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "document": product_page_text,
        "schema": custom_schema
    }
)

PDF Support
Extract from PDF files by sending base64-encoded content:

import base64

with open("invoice.pdf", "rb") as f:
    pdf_b64 = base64.b64encode(f.read()).decode()

response = requests.post(
    "https://api.ramlabs.dev/v1/extract",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "document": pdf_b64,
        "documentType": "pdf",
        "schema": "invoice"
    }
)

Confidence Scores
Every extracted field includes a confidence score (0.0 to 1.0). This enables smart automation:

data = response.json()["data"]

for field_name, field_data in data.items():
    confidence = field_data["confidence"]
    if confidence &amp;gt; 0.9:
        save_to_database(field_name, field_data["value"])
    elif confidence &amp;gt; 0.7:
        queue_for_review(field_name, field_data["value"], confidence)
    else:
        assign_to_human(field_name, field_data)

Pricing
Free: 25 extractions/month (no credit card)
Starter: $49/mo — 1,000 extractions
Pro: $199/mo — 5,000 extractions
Scale: $499/mo — 25,000 extractions
Links
Website: extract.ramlabs.dev
Docs: extract.ramlabs.dev/docs
GitHub: github.com/ramlabsdev/scoutextract-sdk
Blog: extract.ramlabs.dev/blog
Would love to hear what document types you'd find most useful. Drop a comment!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>api</category>
      <category>ai</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
