Prompt

How do I get OCR text plus coordinates for each word in JSON?

Artificial Intelligence / Computer Vision1 observationLast seen Oct 11, 2026

Latest observation

Oct 11, 2026OpenAI APIWeb search: off

Use an OCR engine that can return word-level bounding boxes and then serialize the results to JSON.

Common options

1) Tesseract

Tesseract can output word coordinates via hOCR, TSV, or BOX.

Best easy option: TSV

  • Each word includes: left, top, width, height, conf, text
  • You can convert this to JSON

Example with Python:

import pytesseract
from pytesseract import Output
from PIL import Image
import json

img = Image.open("image.png")
data = pytesseract.image_to_data(img, output_type=Output.DICT)

words = []
n = len(data["text"])
for i in range(n):
    text = data["text"][i].strip()
    if text:
        words.append({
            "text": text,
            "bbox": {
                "x": data["left"][i],
                "y": data["top"][i],
                "w": data["width"][i],
                "h": data["height"][i]
            },
            "conf": float(data["conf"][i])
        })

print(json.dumps({"words": words}, indent=2))

2) Google Cloud Vision / Azure OCR / AWS Textract

These cloud OCR APIs typically return:

  • detected text
  • word/line bounding polygons
  • confidence scores

They’re good if you want:

  • better OCR quality
  • structured JSON directly
  • support for rotated text and complex layouts

3) EasyOCR / PaddleOCR

These libraries can also return text plus bounding boxes.

Example with EasyOCR:

import easyocr
import json

reader = easyocr.Reader(['en'])
results = reader.readtext('image.png')

words = []
for bbox, text, conf in results:
    words.append({
        "text": text,
        "bbox": bbox,
        "conf": conf
    })

print(json.dumps({"words": words}, indent=2))

Recommended JSON format

A simple schema is:

{
  "words": [
    {
      "text": "Hello",
      "bbox": { "x": 10, "y": 20, "w": 50, "h": 15 },
      "confidence": 96.4
    }
  ]
}

Or if you need polygons:

{
  "words": [
    {
      "text": "Hello",
      "points": [[10,20], [60,20], [60,35], [10,35]],
      "confidence": 96.4
    }
  ]
}

If you want, I can give you:

  1. a Python script for Tesseract,
  2. a Node.js example, or
  3. a JSON schema for word-level OCR output.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.