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

# Reverse geocode

> Resolves a coordinate to the postcode of the nearest active unit within a specified radius (default 25m, max 250m). Returns the full unit code plus the derived area/district/state hierarchy and a distance-graded confidence. Administrative names are included only for keys granted lookup level 2+.



## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/search/reverse
openapi: 3.1.0
info:
  title: NIPOST Postcode Gateway — Public API
  version: 0.1.0
  description: >
    Public API for Nigeria's national postcode system. Search and Lookup L1 are
    free; Lookup L2–L4 are commercial (credits); L5 is restricted. Authenticate
    with an API key.
servers:
  - url: https://api.postcode.gov.ng
    description: Production
  - url: http://localhost:8081
    description: Local gateway
security:
  - ApiKeyAuth: []
paths:
  /v1/search/reverse:
    get:
      summary: Reverse geocode
      description: >-
        Resolves a coordinate to the postcode of the nearest active unit within
        a specified radius (default 25m, max 250m). Returns the full unit code
        plus the derived area/district/state hierarchy and a distance-graded
        confidence. Administrative names are included only for keys granted
        lookup level 2+.
      parameters:
        - name: lng
          in: query
          required: true
          schema:
            type: number
        - name: lat
          in: query
          required: true
          schema:
            type: number
        - name: max_distance_m
          in: query
          required: false
          schema:
            type: number
            minimum: 0
            maximum: 250
            default: 25
          description: >-
            Search radius for this call. Honored as asked, tighter or looser
            than the 25m default, but silently clamped to the 250m hard ceiling
            if it asks for more than that -- see radius_m on the response for
            what was actually applied.
      responses:
        '200':
          description: Resolved postcode (found=false when nothing is within range)
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ReverseResponse'
components:
  schemas:
    ReverseResponse:
      type: object
      properties:
        found:
          type: boolean
        coordinate:
          type: array
          items:
            type: number
          description: '[lng, lat] echoed back'
        unit:
          type: object
          description: Nearest building within the snap radius (omitted when found=false)
          properties:
            postcode:
              type: string
              example: EK-01-A03-FK-01
            display:
              type: string
              example: EK 01 A03 FK 01
            distance_m:
              type: number
            confidence:
              type: string
              enum:
                - high
                - medium
                - low
            state_name:
              type: string
              description: L2+
            lga_name:
              type: string
              description: L2+
            locality_name:
              type: string
              description: L2+
            address:
              type: string
              description: Recent house address (L2+)
        area:
          type: string
          example: EK-01-A03-FK
        district:
          type: string
          example: EK-01-A03
        state:
          type: string
          example: EK
        message:
          type: string
          description: set when found=false
        radius_m:
          type: number
          description: >-
            The radius actually enforced for this call -- the 25m default, the
            caller's own max_distance_m, or 250m if that asked for more than the
            ceiling. Always set, even when found=false.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````