> ## Documentation Index
> Fetch the complete documentation index at: https://data.kushiro.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Search facility/location data by proximity

> Returns geocoded `fact_point` records within `radius_m` of a center point, ordered nearest-first, each annotated with `distance_m`. `lat`, `lng`, and `radius_m` are required. `source` is optional (omit it for a cross-source search); `category` further narrows results. Points without coordinates are excluded.



## OpenAPI

````yaml /openapi.json get /api/v1/points/near
openapi: 3.1.0
info:
  title: k-Data
  version: 0.1.0
  description: >-
    Preview read-only API for reshaped public data collected from Kushiro City
    sources. Response shapes, URLs, and published datasets may change without
    notice.
  license:
    name: CC BY 4.0
    url: https://creativecommons.org/licenses/by/4.0/deed.ja
servers:
  - url: https://data.kushiro.app
    description: Production
security: []
tags:
  - name: service
    description: Service metadata and health endpoints.
  - name: sources
    description: Published source summaries.
  - name: metrics
    description: Numeric data records.
  - name: points
    description: >-
      Facility and location-style data records such as public facilities, AED
      locations, evacuation sites, and indexes.
  - name: terms
    description: Terms of use and attribution notes.
paths:
  /api/v1/points/near:
    get:
      tags:
        - points
      summary: Search facility/location data by proximity
      description: >-
        Returns geocoded `fact_point` records within `radius_m` of a center
        point, ordered nearest-first, each annotated with `distance_m`. `lat`,
        `lng`, and `radius_m` are required. `source` is optional (omit it for a
        cross-source search); `category` further narrows results. Points without
        coordinates are excluded.
      operationId: nearPoints
      parameters:
        - name: lat
          in: query
          required: true
          description: Center latitude (-90 to 90).
          schema:
            type: number
            minimum: -90
            maximum: 90
        - name: lng
          in: query
          required: true
          description: Center longitude (-180 to 180).
          schema:
            type: number
            minimum: -180
            maximum: 180
        - name: radius_m
          in: query
          required: true
          description: Search radius in meters. Capped at 50000 (50km).
          schema:
            type: number
            exclusiveMinimum: 0
            maximum: 50000
        - name: source
          in: query
          required: false
          description: Source ID. When omitted, the search spans all sources.
          schema:
            type: string
            minLength: 1
        - name: category
          in: query
          required: false
          description: Point category exact match.
          schema:
            type: string
            minLength: 1
        - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          description: Proximity search result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PointsNearResult'
              examples:
                default:
                  value:
                    points:
                      - id: 1
                        source_id: kushiro_aed_locations
                        external_id: aed-1
                        name: 市役所本庁舎
                        category: aed
                        address: 釧路市黒金町7丁目5番地
                        lat: 42.984
                        lng: 144.381
                        geohash: null
                        attributes: null
                        fetched_at: '2026-04-29T00:00:00.000Z'
                        raw_blob_key: >-
                          raw/kushiro_aed_locations/2026-04-29T00-00-00.000Z/file.pdf
                        distance_m: 142
                    total: 1
                    limit: 1000
                    query:
                      lat: 42.985
                      lng: 144.382
                      radius_m: 1000
        '400':
          $ref: '#/components/responses/InvalidQueryParameters'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    Limit:
      name: limit
      in: query
      required: false
      description: Maximum number of items to return. Defaults to 1000.
      schema:
        type: integer
        minimum: 1
        maximum: 10000
        default: 1000
  schemas:
    PointsNearResult:
      type: object
      required:
        - points
        - total
        - limit
        - query
      properties:
        points:
          type: array
          items:
            $ref: '#/components/schemas/PointNearRow'
        total:
          type: integer
          minimum: 0
          description: Total points within the radius before `limit` truncation.
        limit:
          type: integer
          minimum: 1
          maximum: 10000
        query:
          type: object
          required:
            - lat
            - lng
            - radius_m
          properties:
            lat:
              type: number
            lng:
              type: number
            radius_m:
              type: number
          additionalProperties: false
      additionalProperties: false
    PointNearRow:
      type: object
      required:
        - id
        - source_id
        - external_id
        - name
        - category
        - address
        - lat
        - lng
        - geohash
        - attributes
        - fetched_at
        - raw_blob_key
        - distance_m
      properties:
        id:
          type: integer
        source_id:
          type: string
        external_id:
          type:
            - string
            - 'null'
        name:
          type: string
        category:
          type:
            - string
            - 'null'
        address:
          type:
            - string
            - 'null'
        lat:
          type:
            - number
            - 'null'
        lng:
          type:
            - number
            - 'null'
        geohash:
          type:
            - string
            - 'null'
        attributes:
          type:
            - object
            - 'null'
          additionalProperties: true
        fetched_at:
          type: string
          format: date-time
        raw_blob_key:
          type: string
        distance_m:
          type: integer
          minimum: 0
          description: >-
            Great-circle (Haversine) distance from the query center, rounded to
            whole meters.
      additionalProperties: false
    InvalidQueryError:
      type: object
      required:
        - error
        - issues
      properties:
        error:
          type: string
          example: invalid query parameters
        issues:
          type: array
          items:
            type: object
            required:
              - path
              - message
            properties:
              path:
                type: string
              message:
                type: string
            additionalProperties: false
      additionalProperties: false
    InternalServerError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: internal server error
      additionalProperties: false
  responses:
    InvalidQueryParameters:
      description: The query string failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InvalidQueryError'
          examples:
            missingSource:
              value:
                error: invalid query parameters
                issues:
                  - path: source
                    message: 'Invalid input: expected string, received undefined'
    InternalServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InternalServerError'
          examples:
            default:
              value:
                error: internal server error

````