---
title: "Query demographics for a polygon"
method: POST
path: "/v1/data/demographics"
tags: ["Demographics"]
---

# Query demographics for a polygon

`POST /v1/data/demographics`

## Request

- Base URL: `https://api.mapulus.com`
- URL: `https://api.mapulus.com/v1/data/demographics`
- Auth: HTTP bearer

Query demographic data for boundaries intersecting a GeoJSON polygon.

Draw a polygon on a map and get demographics for the area.
Returns either individual boundary results (with `overlap_fraction`) or
area-weighted aggregated statistics (`aggregate: true`).

Accepts the same field/topic/output-control parameters as the GET endpoint
for schema parity. Segment filters (`sex`, `age_min`, `age_max`) are not
supported for polygon queries and will return 400 if set.

Use `topics` or `fields` to control which data is returned.
Use `limit`/`offset` to paginate non-aggregate boundary results.

## Request body

- UnifiedPolygonRequest: Request body for POST /demographics (polygon query).
  - `geometry` GeoJsonGeometry, required: A GeoJSON geometry (Polygon or MultiPolygon).
    - `type` 'Polygon' | 'MultiPolygon', required: GeoJSON geometry type.
    - `coordinates` unknown[], required: GeoJSON coordinates array.
      - unknown
  - `boundary_type` 'sa1' | 'sa2' | 'sa3' | 'sa4' | 'lga' | 'poa' | 'sal' | 'ced' | 'sed' | 'gccsa' | 'ste' | 'sua' | 'ucl' | 'ra' | 'sos' | 'sosr' | 'iloc' | 'iare' | 'ireg' | 'flood' | 'us_state' | 'us_county' | 'us_tract' | 'us_bg' | 'us_place' | 'us_cousub' | 'us_cd' | 'us_sldu' | 'us_sldl' | 'us_cbsa' | 'us_csa' | 'us_unsd' | 'us_elsd' | 'us_scsd' | 'us_aiannh' | 'us_region' | 'us_division' | 'us_zcta' | 'us_ua' | 'us_puma': Statistical and administrative boundary types (AU + US).
  - `fields` string[], nullable: API field paths to return.
  - `topics` string, nullable: Comma-separated topic IDs (e.g. `age,income`).
  - `census_year` integer: Census year.
  - `sex` 'male' | 'female' | 'persons': Sex filter: `male`, `female`, or `persons`.
  - `age_min` integer, nullable: Minimum age (inclusive).
  - `age_max` integer, nullable: Maximum age (inclusive).
  - `aggregate` boolean: If true, return area-weighted aggregated stats.
  - `limit` integer: Max boundaries to return (non-aggregate).
  - `offset` integer: Pagination offset for boundary results.

## Response `200`

Demographic data for boundaries intersecting the polygon.

- unknown

## Other responses

- `422`: Validation Error

---

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