---
title: "Find regions of a page similar to a template rect"
method: POST
path: "/api/v0/components/{component_id}/schematic/template-match"
tags: ["Components"]
---

# Find regions of a page similar to a template rect

`POST /api/v0/components/{component_id}/schematic/template-match`

## 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/template-match`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/outerport/apis/outerport-api/docs/api/v0/components/:component_id/schematic/template-match/post.ts> (a function with typed inputs; its response is checked against the schema)

Runs OpenCV TM_CCOEFF_NORMED template matching against the rendered page image. 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

- TemplateMatchRequest
  - `template` TemplateRect, required
    - `x0` number, required
    - `y0` number, required
    - `x1` number, required
    - `y1` number, required
  - `exclude_bboxes` TemplateRect[]
    - `x0` number, required
    - `y0` number, required
    - `x1` number, required
    - `y1` number, required
  - `options` TemplateMatchOptions
    - `threshold` number
    - `four_rotations` boolean
    - `max_pre_nms_candidates` integer

## Response `200`

Successful Response

- TemplateMatchResponse
  - `result` MatchResultModel[], required
    - `bbox` MatchRect, required
      - `x0` integer, required
      - `y0` integer, required
      - `x1` integer, required
      - `y1` integer, required
    - `score` number, required
    - `rotation` integer, required
  - `timings` TemplateMatchTimings, required
    - `fetch_ms` integer, required
    - `decode_ms` integer, required
    - `match_ms` integer, required
    - `scan_ms` integer, required
    - `nms_ms` integer, required
    - `total_ms` integer, required
  - `image_width` integer, required
  - `image_height` integer, required
  - `template_width` integer, required
  - `template_height` integer, required
  - `candidates_before_nms` integer, required
  - `candidates_before_cap` integer

## 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/template-match/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)
