API Tutorials & Live Examples

Complete guides for using Ordliy API through RapidAPI. Learn how to extract structured data from images, PDFs, and text files with nested schemas. All examples are live and ready to test!

โšก Available exclusively on RapidAPI

Getting Started with RapidAPI

Ordliy is available exclusively through RapidAPI. Follow these simple steps to get started.

1

Sign Up on RapidAPI

Create a free account on RapidAPI if you don't have one. It takes less than a minute.

Visit RapidAPI โ†’
2

Subscribe to Ordliy API

Find Ordliy on RapidAPI Hub and subscribe. Start with the free tier or choose a plan that fits your needs.

Browse APIs โ†’
3

Get Your API Key

Once subscribed, RapidAPI will provide your unique API key. Copy it and keep it secure.

X-RapidAPI-Key: your-api-key-here
4

Start Making Calls

Use the tutorials below to start extracting data. All endpoints are available through RapidAPI.

https://rapidAPI.com/v1/json
๐Ÿ‘จโ€๐Ÿณ

Tutorial 1: Recipe Image Extraction

Extract structured recipe data from images with nested ingredients and instructions arrays

Sample Recipe Image

Old Recipe Card
Image URL: https://cdn.ordliy.com/old-recipe.jpg

Request Example

POST /v1/json via RapidAPI bash
curl -X POST https://rapidAPI.com/v1/json \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: ordliy.p.rapidapi.com" \
  -d '{
    "url": "https://cdn.ordliy.com/old-recipe.jpg",
    "returnSchema": {
      "recipe_name": {
        "key": "recipe_name",
        "description": "Name of the recipe",
        "type": "string"
      },
      "servings": {
        "key": "servings",
        "description": "Number of servings",
        "type": "number"
      },
      "prep_time": {
        "key": "prep_time",
        "description": "Prep time in minutes",
        "type": "number"
      },
      "cook_time": {
        "key": "cook_time",
        "description": "Cook time in minutes",
        "type": "number"
      },
      "ingredients": {
        "key": "ingredients",
        "description": "List of ingredients",
        "type": "array",
        "items": {
          "key": "ingredient",
          "description": "Ingredient with measurement",
          "type": "string"
        }
      },
      "instructions": {
        "key": "instructions",
        "description": "Cooking steps",
        "type": "array",
        "items": {
          "key": "step",
          "description": "A cooking step",
          "type": "string"
        }
      },
      "difficulty": {
        "key": "difficulty",
        "description": "Difficulty level",
        "type": "string"
      }
    }
  }'

Expected Response

JSON Response JSON
{
  "message": "Success",
  "returnSchema": {
    "recipe_name": "Butter Kernel Corn-Cheese Bake",
    "servings": 7,
    "prep_time": 10,
    "cook_time": 32.5,
    "ingredients": [
      "1/2 cup all-purpose flour",
      "1 16-ounce can Butter Kernel cream-style corn",
      "1 3-ounce package cream cheese, cut in cubes",
      "1/2 teaspoon onion salt",
      "1 16-ounce can Butter Kernel corn, drained",
      "1/2 cup shredded processed Swiss cheese (2 ounces)"
    ],
    "instructions": [
      "Stir flour into cream-style corn.",
      "Add cream cheese and onion; heat and stir till cheese melts.",
      "Stir in remaining ingredients.",
      "Pour into 1 1/2 quart casserole, top with buttered crumbs, if desired.",
      "Bake uncovered at 400ยฐF for 30 to 35 minutes."
    ],
    "difficulty": "Easy"
  }
}

๐Ÿ’ก Tips for Recipe Extraction

  • Use array type for ingredients and instructions to get them as separate items
  • Specify number type for servings, prep time, and cook time for proper data formatting
  • Add descriptive fields like "difficulty" or "cuisine" to get additional context
  • For complex recipes, you can nest ingredient objects with name, quantity, and unit fields
๐Ÿ“š

Tutorial 2: PDF Document Extraction

Extract structured data from multi-page PDF documents including textbooks, manuals, and reports

Sample PDF Document

๐Ÿ“„

Test Textbook PDF

Multi-page educational document

View PDF โ†’
PDF URL: https://cdn.ordliy.com/test-text-book.pdf

Request Example

POST /v1/json via RapidAPI bash
curl -X POST https://rapidAPI.com/v1/json \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: ordliy.p.rapidapi.com" \
  -d '{
    "url": "https://cdn.ordliy.com/test-text-book.pdf",
    "returnSchema": {
      "document_title": {
        "key": "document_title",
        "description": "Title of the document",
        "type": "string"
      },
      "author": {
        "key": "author",
        "description": "Author name",
        "type": "string"
      },
      "table_of_contents": {
        "key": "table_of_contents",
        "description": "List of chapters",
        "type": "array",
        "items": {
          "key": "chapter",
          "description": "Chapter details",
          "type": "object",
          "properties": {
            "chapter_number": {
              "key": "chapter_number",
              "description": "Chapter number",
              "type": "number"
            },
            "chapter_title": {
              "key": "chapter_title",
              "description": "Chapter title",
              "type": "string"
            },
            "page_number": {
              "key": "page_number",
              "description": "Starting page",
              "type": "number"
            }
          }
        }
      },
      "total_pages": {
        "key": "total_pages",
        "description": "Total pages in document",
        "type": "number"
      },
      "key_topics": {
        "key": "key_topics",
        "description": "Main topics covered",
        "type": "array",
        "items": {
          "key": "topic",
          "description": "A topic",
          "type": "string"
        }
      },
      "publication_info": {
        "key": "publication_info",
        "description": "Publication details",
        "type": "object",
        "properties": {
          "publisher": {
            "key": "publisher",
            "description": "Publisher name",
            "type": "string"
          },
          "year": {
            "key": "year",
            "description": "Publication year",
            "type": "number"
          },
          "isbn": {
            "key": "isbn",
            "description": "ISBN number",
            "type": "string"
          }
        }
      }
    }
  }'

Expected Response

JSON Response JSON
{
  "message": "Success",
  "returnSchema": {
    "document_title": "Introduction to Machine Learning",
    "author": "Dr. Jane Smith",
    "table_of_contents": [
      {
        "chapter_number": 1,
        "chapter_title": "Foundations of Machine Learning",
        "page_number": 15
      },
      {
        "chapter_number": 2,
        "chapter_title": "Supervised Learning Algorithms",
        "page_number": 42
      },
      {
        "chapter_number": 3,
        "chapter_title": "Neural Networks and Deep Learning",
        "page_number": 89
      }
    ],
    "total_pages": 350,
    "key_topics": [
      "Linear Regression",
      "Decision Trees",
      "Neural Networks",
      "Deep Learning",
      "Model Evaluation"
    ],
    "publication_info": {
      "publisher": "Tech Publishing House",
      "year": 2023,
      "isbn": "978-1-234-56789-0"
    }
  }
}

๐Ÿ’ก Tips for PDF Extraction

  • PDFs support up to 1,000 pages per document
  • Use nested arrays of objects for table of contents with chapter details
  • Extract metadata like publication info as nested objects
  • For invoices or forms, structure line items as arrays with consistent properties
  • Native digital PDFs work better than scanned images

More Quick Examples

Common use cases with ready-to-use schemas

๐Ÿงพ

Receipt Processing

Extract store name, date, items, and totals from receipts with nested item arrays.

{ "store_name": {...}, "items": [ {"name": "...", "price": 0, "quantity": 0} ], "total": {...} }
โœ“ Nested arrays โœ“ Number types โœ“ Date parsing
๐Ÿ“„

Invoice Data

Extract customer details, line items, and payment info with deeply nested structures.

{ "customer": { "name": "...", "address": {...} }, "items": [{...}] }
โœ“ Deep nesting โœ“ Objects in arrays โœ“ Multi-page
๐Ÿ›๏ธ

Product Analysis

Extract product specs, features, and pricing with nested specification objects.

{ "product_name": "...", "specs": {...}, "features": ["..."] }
โœ“ Mixed types โœ“ Spec objects โœ“ Feature arrays
๐Ÿ“

Form Data

Extract form fields, checkboxes, and signatures with boolean types and structured data.

{ "applicant": {...}, "agreed_terms": true, "selections": ["..."] }
โœ“ Boolean fields โœ“ Checkboxes โœ“ Multi-select
๐Ÿ“ธ

Photo Analysis

Analyze photos for objects, people, and context with scene details as nested objects.

{ "scene": {...}, "people_count": 0, "activities": ["..."] }
โœ“ Scene analysis โœ“ Object detection โœ“ Context arrays
๐Ÿ“‹

Meeting Notes

Extract meeting info, attendees, and action items from text files with structured data.

{ "meeting_title": "...", "attendees": ["..."], "action_items": [{...}] }
โœ“ Text parsing โœ“ List extraction โœ“ Task objects

Complete API Feature Set

Everything you need for document and image extraction via RapidAPI

๐Ÿ“„ File Type Support

  • Images (JPEG, PNG, GIF, WebP, AVIF, BMP)
  • PDFs (up to 1,000 pages per document)
  • Text Files (.txt, plain text)
  • Maximum file size: 10MB

๐Ÿ—๏ธ Schema Types

  • string: Text values (default)
  • number: Integers and decimals
  • boolean: true/false values
  • array: Lists of any type
  • object: Nested structures
  • Unlimited nesting depth

โšก Two Simple Endpoints

  • /v1/json - Extract from URLs or Base64
  • /v1/form-data - Upload files directly
  • Both support identical schema format
  • Same response structure

๐Ÿ”’ Security & Privacy

  • Files processed in-memory only
  • No permanent storage
  • Geo-blocking protection
  • Prompt injection safeguards
  • Enterprise-grade security

๐Ÿ’ฐ Pricing via RapidAPI

  • Pay-per-use model
  • Most affordable LLM/VLM OCR
  • No hidden fees
  • Free tier available
  • Scale as you grow

๐Ÿš€ Performance

  • Lightning-fast processing
  • Powered by Google Gemini
  • Results in seconds
  • High accuracy rates
  • Reliable uptime

Best Practices for Schema Design

Tips to get the most accurate results from the API

๐Ÿ“

Write Clear Descriptions

The more specific your field descriptions, the better the AI can extract the right data.

โœ“ Good: "Invoice date in MM/DD/YYYY format"
โœ— Avoid: "Date"
๐ŸŽฏ

Choose Correct Types

Use the appropriate data type for each field to ensure proper formatting in the response.

โœ“ Good: price: number, in_stock: boolean
โœ— Avoid: Everything as string
๐Ÿ—๏ธ

Structure Wisely

Group related fields into objects. Use arrays for repeating data like line items.

โœ“ Good: customer โ†’ address โ†’ { street, city }
โœ— Avoid: Flat customer_street, customer_city
๐Ÿ”ข

Arrays of Objects

For lists with multiple properties, always use arrays of objects instead of strings.

โœ“ Good: items: [{ name, qty, price }]
โœ— Avoid: items: ["item1, qty1, price1"]
๐Ÿ“

Optimize File Quality

Use clear, high-resolution images and native PDFs for best results.

โœ“ Good: 1080p+ images, good lighting
โœ— Avoid: Blurry, low-resolution files
โšก

Test and Iterate

Start with a simple schema and gradually add complexity based on results.

โœ“ Process: Simple โ†’ Test โ†’ Refine โ†’ Retest

Ready to Start Extracting Data?

Get your RapidAPI key and start using Ordliy OCR API today. Pay-per-use pricing with the most affordable rates.

๐Ÿ”‘ Ordliy API is exclusively available through RapidAPI for secure, reliable access