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

# The states

> Every state the frames lie in, by name, with its code, geopolitical zone, frame count and extent. No key is needed: the hierarchy is reference data about the grid, not anyone's dataset, and the response is cacheable for an hour. The same answer is on `GET /v1/frames/admin` for a key holder.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/states
openapi: 3.1.0
info:
  title: LOCI API
  version: 1.0.0
  summary: >-
    The Milsat spatial index over HTTP: find the frame at a location, the frames
    around it, what is recorded on them, and a worded answer about them.
  description: >-
    Four calls, all under `/v1/frames`, all read-only, all with an API key.


    Nigeria is covered by a grid of **frames**: cells roughly a kilometre
    across, each with a stable numeric id. Every dataset on LOCI falls within
    frames, so a frame id is the key to everything known about a place. The API
    lets your code resolve a location to its frame, list the frames around a
    point, read what the datasets your organisation owns or licenses record on
    those frames, and ask a question about them in plain language.


    Every response is wrapped in an envelope: a success carries `data`, a
    failure carries `error` with a machine-readable `code` and a human
    `message`. Branch on the code; the message may be reworded.


    Send the key as `Authorization: Bearer loci_sk_…`. A key acts for one
    organisation, is read-only, and expires.
servers:
  - url: https://api.loci.ng
    description: The LOCI API, which the app at loci.ng also uses.
  - url: http://localhost:8088
    description: A local development stack, which the examples here were captured against.
security:
  - apiKey: []
tags:
  - name: Frames
    description: The spatial index and what is recorded on it.
paths:
  /v1/states:
    get:
      tags:
        - Frames
      summary: The states
      description: >-
        Every state the frames lie in, by name, with its code, geopolitical
        zone, frame count and extent. No key is needed: the hierarchy is
        reference data about the grid, not anyone's dataset, and the response is
        cacheable for an hour. The same answer is on `GET /v1/frames/admin` for
        a key holder.
      operationId: statesList
      parameters: []
      responses:
        '200':
          description: The units, by name.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/AdminUnits'
                required:
                  - data
              examples:
                states:
                  summary: 'No parameters: the states'
                  description: >-
                    Captured against the national index; 37 states came back,
                    three shown.
                  value:
                    data:
                      level: state
                      units:
                        - level: state
                          name: ABIA
                          code: '31'
                          zone: SOUTH EAST
                          frames: 6981
                          bbox:
                            - 7.14158
                            - 4.82227
                            - 7.98629
                            - 6.04485
                        - level: state
                          name: ADAMAWA
                          code: '7'
                          zone: NORTH EAST
                          frames: 49533
                          bbox:
                            - 11.34152
                            - 7.37867
                            - 13.72762
                            - 10.94946
                        - level: state
                          name: AKWA IBOM
                          code: '30'
                          zone: SOUTH SOUTH
                          frames: 10071
                          bbox:
                            - 7.46147
                            - 4.45754
                            - 8.34618
                            - 5.51828
        '400':
          description: A required parameter is missing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security: []
components:
  schemas:
    AdminUnits:
      type: object
      properties:
        level:
          type: string
          enum:
            - state
            - lga
            - ward
          description: Which level the units are.
        units:
          type: array
          items:
            $ref: '#/components/schemas/AdminUnit'
      required:
        - level
        - units
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Stable and machine-readable. Branch on it.
            message:
              type: string
              description: For people. May be reworded.
          required:
            - code
            - message
      required:
        - error
    AdminUnit:
      type: object
      properties:
        level:
          type: string
          enum:
            - state
            - lga
            - ward
        name:
          type: string
          description: As the baseline spells it.
          example: KAFUR
        code:
          type: string
          description: The baseline's code for the unit.
          example: '169'
        state:
          type: string
          description: The state above an LGA or a ward.
        lga:
          type: string
          description: The LGA above a ward.
        zone:
          type: string
          description: The geopolitical zone.
        frames:
          type: integer
          description: How many frames lie in the unit.
        bbox:
          $ref: '#/components/schemas/BBox'
      required:
        - level
        - name
        - frames
        - bbox
    BBox:
      type: array
      description: '`[minLon, minLat, maxLon, maxLat]` in degrees.'
      items:
        type: number
      minItems: 4
      maxItems: 4
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: loci_sk_…
      description: >-
        An API key minted in the Developers tab of the LOCI app, sent as
        `Authorization: Bearer loci_sk_…`. Acts for one organisation, is
        read-only, and expires.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.