---
title: "Detect text bounding boxes inside a polygon on a page"
method: POST
path: "/api/v0/components/{component_id}/schematic/detect-text-in-region"
tags: ["Components"]
---

# Detect text bounding boxes inside a polygon on a page

`POST /api/v0/components/{component_id}/schematic/detect-text-in-region`

## Request

- Base URL: `https://api.outerport.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.outerport.com/api/v0/components/{component_id}/schematic/detect-text-in-region`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/outerport/apis/outerport-api/docs/api/v0/components/:component_id/schematic/detect-text-in-region/post.ts> (a function with typed inputs; its response is checked against the schema)

Crops the page to the polygon's bounding rect (with padding for PP-OCRv5 context), runs text detection on the crop, and filters detections by polygon centroid. One GPU round trip. Returns detected bboxes in page-pixel coords. Recognition is not performed; callers needing text content route the bboxes through /ocr-regions. Results are ephemeral and not persisted.

## Path parameters

- `component_id` string, required

## Query parameters

- `vc_id` string, required: Public ID of the target visual component

## Request body

- DetectTextInRegionRequest
  - `polygon` Point[], required: Closed polygon in page-pixel coordinates. Minimum 3 vertices.
    - `x` number, required
    - `y` number, required

## Response `200`

Successful Response

- DetectTextInRegionResponse
  - `result` DetectedBox[], required
    - `bbox` DetectedRect, required
      - `x0` integer, required
      - `y0` integer, required
      - `x1` integer, required
      - `y1` integer, required
  - `timings` DetectTextTimings, required
    - `fetch_ms` integer, required
    - `decode_ms` integer, required
    - `detect_ms` integer, required
    - `total_ms` integer, required
  - `image_width` integer, required
  - `image_height` integer, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-09-25** `fcd15f6d35b4`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/outerport/apis/outerport-api/changes/api/v0/components/:component_id/schematic/detect-text-in-region/post.md)

---

[API](https://skmtc.dev/outerport/apis/outerport-api.md) - [All operations](https://skmtc.dev/outerport/apis/outerport-api/llms.txt) - [OpenAPI document](https://skmtc.dev/outerport/apis/outerport-api/revisions/08b5bf6f7f18?raw)
