Documentation

OCR Endpoint

Extract clean text from image URLs — fast, simple, and free to use.

Overview

The OCR endpoint wraps a slim Tesseract 5 CLI.
Provide public image URLs; receive an array of { url, text } objects. No keys, no persistent storage.

Key Features

  • JPEG & PNG up to 5 MB
  • Auto‑unwraps Google‑Images redirect links
  • Batch up to 10 images per request
  • note field when no text is detected

How it Works

  1. Stream the image from its URL.
  2. Convert to lossless PNG in memory.
  3. Run Tesseract (page‑seg‑mode 6).
  4. Trim whitespace and return UTF‑8 text.

Endpoint

MethodPathDescription
POST/api/v1/jsonsheet/ocrReturns plain text for every image URL

Request Payload

Content‑Type: application/json

{
  "urls": [
    "https://cdn.example.com/banner.jpg",
    "https://i.imgur.com/quote.png"
  ]
}

Rules

  • Max 10 URLs per call.
  • Accepted: .jpg, .jpeg, .png.
  • 5 MB hard limit per image.

Typical Response

{
  "results": [
    {
      "url":  "https://cdn.example.com/banner.jpg",
      "text": "Coffee is always a good idea"
    },
    {
      "url":  "https://i.imgur.com/quote.png",
      "text": null,
      "note": "No text found. Ensure image has readable characters."
    }
  ]
}

Error Responses

StatusMessageReason / Fix
400Invalid bodyurls must be a non‑empty HTTPS array
413Image too largeReduce file below 5 MB
429Too Many RequestsRate‑limit exceeded – wait ≤ 60 s
500Tesseract errorCorrupted or unsupported image

Quick‑Start Snippets

Shell (cURL)

curl -X POST https://api.jsonsheet.com/api/v1/jsonsheet/ocr \
  -H "Content-Type: application/json" \
  -d '{"urls":["https://i.imgur.com/hello.png"]}'

JavaScript (Fetch)

await fetch("https://api.jsonsheet.com/api/v1/jsonsheet/ocr", {
  method: "POST",
  headers: {"Content-Type":"application/json"},
  body: JSON.stringify({ urls: [imgUrl] })
}).then(r => r.json()).then(console.log);

Python

import requests, json, pprint
payload = {"urls": ["https://i.imgur.com/hello.png"]}
r = requests.post(
  "https://api.jsonsheet.com/api/v1/jsonsheet/ocr",
  json=payload, timeout=30)
pprint.pprint(r.json())

C#

var body = new StringContent(
  JsonSerializer.Serialize(new { urls = new[] { imgUrl } }),
  Encoding.UTF8, "application/json");

using var hc = new HttpClient();
var resp = await hc.PostAsync(
  "https://api.jsonsheet.com/api/v1/jsonsheet/ocr", body);

Console.WriteLine(await resp.Content.ReadAsStringAsync());

Go

payload := map[string][]string{"urls": {imgURL}}
buf, _ := json.Marshal(payload)

req, _ := http.NewRequest("POST",
  "https://api.jsonsheet.com/api/v1/jsonsheet/ocr",
  bytes.NewReader(buf))
req.Header.Set("Content-Type", "application/json")

resp, _ := http.DefaultClient.Do(req)

Rate Limits

  • 50 requests / minute
  • 2 000 requests / day

FAQ

  • Do I need an API key? Nope. The OCR endpoint is completely open and stateless just POST your image URLs.
  • Is my picture stored? Never. Each image is streamed, processed in memory, then discarded. Nothing is written to disk except a short‑lived temp file and that is deleted before the response is sent.
  • What languages are recognised? Currently English. Additional .traineddata files (Spanish, French, German, Sinhala, Tamil) are on the roadmap and will roll out without breaking changes.
  • Hand‑written notes? Basic handwriting works sometimes but accuracy is low. For production‑grade handwriting recognition consider a specialised model such as Azure Cognitive Vision or Google Vision.
  • Can I OCR PDFs? Not yet. Multi‑page PDF → text is planned for Q3 2025.