---
title: "Batch point-in-polygon"
method: POST
path: "/v1/pip/batch"
tags: ["Spatial Queries"]
---

# Batch point-in-polygon

`POST /v1/pip/batch`

## Request

- Base URL: `https://api.terranode.co`
- URL: `https://api.terranode.co/v1/pip/batch`
- Auth: API key in header `x-api-key`

Run point-in-polygon for multiple points against a single polygon dataset. Points can be provided in the request body (JSON array, CSV, NDJSON, or GeoJSON FeatureCollection) or referenced from an existing point dataset via the points_* parameters.

## Query parameters

- `system_dataset` string
- `dataset` string
- `dataset_id` string, uuid
- `version` integer
- `format` 'json' | 'csv'
- `async` 'true'
- `webhook_url` string, uri
- `points_system_dataset` string
- `points_dataset` string
- `points_dataset_id` string, uuid

## Request body

- BatchInputPoint[]: Array of point objects. Also accepts a GeoJSON FeatureCollection with Point geometries (coordinates are extracted automatically).
  - `lat` number, required
  - `lng` number, required

## Response `200`

Synchronous batch result.

- BatchPipResponse
  - `summary` BatchPipSummary, required
    - `total` integer, required
    - `matched` integer, required
    - `unmatched` integer, required
  - `dataset` string, required
  - `version` integer, required
  - `results` BatchPipResult[], required
    - `index` integer, required: Zero-based index of the input point.
    - `input` object, required: The original input point with passthrough properties.
    - `match` boolean, required
    - `match_count` integer, required: Number of dataset features matching this point.
    - `matches` PipMatch[], required
      - `properties` FeatureProperties, required: Key-value properties from the matched feature. Keys and values depend on the dataset.
      - `on_boundary` boolean, required: True if the point lies exactly on the polygon boundary.
    - `nearest` PipNearest
      - `properties` FeatureProperties, required: Key-value properties from the matched feature. Keys and values depend on the dataset.
      - `distance_m` number, required: Distance to nearest edge in meters.
      - `distance_mi` number, required: Distance to nearest edge in miles.
  - `latency_ms` number, required
  - `api_version` string, required
  - `semantics_version` string, required

## Other responses

- `202`: Async job accepted.
- `400`: Invalid request parameters or body.
- `401`: Missing or invalid API key.
- `404`: Resource not found.
- `422`: Geometry type mismatch. The dataset's geometry type is incompatible with the requested operation (e.g., Point dataset used with PIP).
- `429`: Monthly request quota exceeded.
- `500`: Internal server error.

---

[API](https://skmtc.dev/terranode/apis/terranode-geospatial-api.md) · [All operations](https://skmtc.dev/terranode/apis/terranode-geospatial-api/llms.txt) · [OpenAPI document](https://skmtc.dev/terranode/apis/terranode-geospatial-api/revisions/bdd80613bc7a?raw)
