> ## 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 — resolve a coordinate to the nearest postcode

> Resolves a coordinate to the postcode of the nearest active unit within SEARCH_REVERSE_MAX_M (default 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 — resolve a coordinate to the nearest postcode
      description: >-
        Resolves a coordinate to the postcode of the nearest active unit within
        SEARCH_REVERSE_MAX_M (default 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
      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+
        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
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````