Back to top

API Documentation

Boundary

Overview

Boundaries represent geographic areas (countries, cities, neighborhoods, postal codes) stored as GeoJSON geometries.

Clients can search for boundaries by name (autocomplete/suggestions), then use the returned GeoJSON to pass to endpoints like /valerts or draw on a map.

Search boundaries

Search boundaries
GET/boundaries/search{?q}

q (string, optional) - Search query for boundary name (e.g. “Dallas”, “90210”)

boundary_type (string, optional) - Filter by type: country, city, neighborhood, or postal_code

country (string, optional) - Filter by country code (e.g. “US”, “CA”, “MX”)

state (string, optional) - Filter by state/province name (e.g. “Texas”, “Ontario”)

limit (integer, optional) - Maximum number of results (default: 50)

start (integer, optional) - Offset for pagination (default: 0)

Example URI

GET /boundaries/search?q=Test Neighborhood
URI Parameters
HideShow
q
string (required) Example: Test Neighborhood
Response  200
HideShow
Body
{
  "code": "OK",
  "data": [
    {
      "id": "b06ab2f5-365a-42ae-8d0c-0ad8f2505dd2",
      "external_id": "relation/999001",
      "boundary_type": "neighborhood",
      "title": "Test Neighborhood",
      "country": "US",
      "state": "Texas",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -96.8,
              32.78
            ],
            [
              -96.79,
              32.78
            ],
            [
              -96.79,
              32.79
            ],
            [
              -96.8,
              32.79
            ],
            [
              -96.8,
              32.78
            ]
          ]
        ]
      },
      "center": {
        "type": "Point",
        "coordinates": [
          -96.795,
          32.785
        ]
      },
      "created_at": 1775341971.530653,
      "updated_at": 1775341971.530653,
      "type": "boundary"
    }
  ],
  "info": {
    "count": 1,
    "total": 1
  }
}

Search by type

Search by type
GET/boundaries/search{?boundary_type}

Example URI

GET /boundaries/search?boundary_type=neighborhood
URI Parameters
HideShow
boundary_type
string (required) Example: neighborhood
Response  200
HideShow
Body
{
  "code": "OK",
  "data": [
    {
      "id": "b06ab2f5-365a-42ae-8d0c-0ad8f2505dd2",
      "external_id": "relation/999001",
      "boundary_type": "neighborhood",
      "title": "Test Neighborhood",
      "country": "US",
      "state": "Texas",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -96.8,
              32.78
            ],
            [
              -96.79,
              32.78
            ],
            [
              -96.79,
              32.79
            ],
            [
              -96.8,
              32.79
            ],
            [
              -96.8,
              32.78
            ]
          ]
        ]
      },
      "center": {
        "type": "Point",
        "coordinates": [
          -96.795,
          32.785
        ]
      },
      "created_at": 1775341971.530653,
      "updated_at": 1775341971.530653,
      "type": "boundary"
    }
  ],
  "info": {
    "count": 1,
    "total": 1
  }
}

Search by country

Search by country
GET/boundaries/search{?country}

Example URI

GET /boundaries/search?country=US
URI Parameters
HideShow
country
string (required) Example: US
Response  200
HideShow
Body
{
  "code": "OK",
  "data": [
    {
      "id": "b06ab2f5-365a-42ae-8d0c-0ad8f2505dd2",
      "external_id": "relation/999001",
      "boundary_type": "neighborhood",
      "title": "Test Neighborhood",
      "country": "US",
      "state": "Texas",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -96.8,
              32.78
            ],
            [
              -96.79,
              32.78
            ],
            [
              -96.79,
              32.79
            ],
            [
              -96.8,
              32.79
            ],
            [
              -96.8,
              32.78
            ]
          ]
        ]
      },
      "center": {
        "type": "Point",
        "coordinates": [
          -96.795,
          32.785
        ]
      },
      "created_at": 1775341971.530653,
      "updated_at": 1775341971.530653,
      "type": "boundary"
    }
  ],
  "info": {
    "count": 1,
    "total": 1
  }
}

Get boundary by ID

Get boundary by ID
GET/boundaries/{id}

Returns a single boundary with full GeoJSON geometry and center point.

Example URI

GET /boundaries/b06ab2f5-365a-42ae-8d0c-0ad8f2505dd2
URI Parameters
HideShow
id
string (required) Example: b06ab2f5-365a-42ae-8d0c-0ad8f2505dd2
Response  200
HideShow
Body
{
  "code": "OK",
  "data": {
    "id": "b06ab2f5-365a-42ae-8d0c-0ad8f2505dd2",
    "external_id": "relation/999001",
    "boundary_type": "neighborhood",
    "title": "Test Neighborhood",
    "country": "US",
    "state": "Texas",
    "geometry": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            -96.8,
            32.78
          ],
          [
            -96.79,
            32.78
          ],
          [
            -96.79,
            32.79
          ],
          [
            -96.8,
            32.79
          ],
          [
            -96.8,
            32.78
          ]
        ]
      ]
    },
    "center": {
      "type": "Point",
      "coordinates": [
        -96.795,
        32.785
      ]
    },
    "created_at": 1775341971.530653,
    "updated_at": 1775341971.530653,
    "type": "boundary"
  }
}

Generated by aglio on 04 Apr 2026