Spatial India Districts API

The Districts API from Spatial India — 2 operation(s) for districts.

GitHub OpenAPI

Operations 2

GET /districts Districts, with optional indicator values #
GET /districts/{objectid} One district's full profile #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/spatialindia-com:spatialindia-com-districts-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

spatialindia-com-districts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Spatialindia Com Districts API
  version: 1.0.0
  contact:
    name: Spatial India
    url: https://spatialindia.com/api-platform
  license:
    name: Free for personal and non-commercial use, with attribution
    url: https://spatialindia.com/terms
  termsOfService: https://spatialindia.com/terms
  description: 'Operations tagged Districts across 2 of this provider''s published API definitions: openapi.json, spatialindia-com-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.spatialindia.com/v1
tags:
- name: Districts
paths:
  /districts:
    get:
      operationId: listDistricts
      summary: Districts, with optional indicator values
      description: 'Without `indicators` this is the district directory — name, state, LGD code, 2011 population and area. With `indicators` it is the joined table, sorted and paged. Ranking, comparison and name search are all this one endpoint.


        Districts a source never covered are valued `null` and sort **last** in both directions, so a "worst" ranking never leads with missing data.'
      parameters:
      - name: state
        in: query
        required: false
        schema:
          type: string
        description: Restrict to one state. Matched on a normalised name, so case and punctuation do not matter.
        example: Maharashtra
      - name: q
        in: query
        required: false
        schema:
          type: string
        description: District name or a known alternative spelling. Matched exactly first, falling back to substring only when nothing matched exactly. Returns every match, with its state.
        example: bilaspur
      - $ref: '#/components/parameters/indicators'
      - name: sort
        in: query
        required: false
        schema:
          type: string
          default: objectid
        description: 'A field to sort by: `objectid`, `district`, `state`, `population_2011`, `area_sqkm`, or any indicator id you asked for in `indicators`. This names a **field**; direction is `order`.'
        example: nfhs5_stunting
      - name: order
        in: query
        required: false
        schema:
          type: string
          enum:
          - asc
          - desc
          default: asc
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: A page of districts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DistrictList'
        '400':
          description: An unknown indicator id or sort field, more than 5 indicators, or a `limit` above 100.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Districts
    servers:
    - url: https://api.spatialindia.com/v1
  /districts/{objectid}:
    get:
      operationId: getDistrict
      summary: One district's full profile
      description: Every published indicator for one district in a single call. `indicators` narrows it and, unlike on `/districts`, is uncapped — the default is already everything.
      parameters:
      - $ref: '#/components/parameters/objectid'
      - name: indicators
        in: query
        required: false
        schema:
          type: string
        description: Comma-separated indicator ids. Omit for every published indicator.
      responses:
        '200':
          description: The district.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DistrictProfile'
        '400':
          description: An unknown indicator id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No district carries that objectid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Districts
    servers:
    - url: https://api.spatialindia.com/v1
components:
  schemas:
    Meta:
      type: object
      description: On every response. This block is what makes the numbers quotable.
      properties:
        dataset_version:
          type: string
          description: The date this dataset was last updated.
        boundary_vintage:
          type: string
        districts:
          type: integer
          description: Named districts in this dataset.
        indicators:
          type: array
          items:
            $ref: '#/components/schemas/IndicatorMeta'
          description: One entry per indicator returned, in the order requested.
        attribution:
          type: array
          items:
            type: string
          description: The credit each source licence requires. Reproduce these wherever the data appears.
        citation:
          type: string
      required:
      - dataset_version
      - boundary_vintage
      - districts
      - attribution
      - citation
    DistrictList:
      type: object
      properties:
        meta:
          $ref: '#/components/schemas/Meta'
        total:
          type: integer
        count:
          type: integer
        limit:
          type: integer
        offset:
          type: integer
        districts:
          type: array
          items:
            $ref: '#/components/schemas/District'
      required:
      - meta
      - total
      - count
      - districts
    District:
      type: object
      properties:
        objectid:
          type: integer
        dist_lgd:
          type:
          - string
          - 'null'
          description: The government's own LGD district code. Null where the district has none.
        district:
          type: string
        state:
          type: string
        population_2011:
          type:
          - integer
          - 'null'
        area_sqkm:
          type:
          - number
          - 'null'
        values:
          type: object
          additionalProperties:
            type:
            - number
            - 'null'
          description: Indicator id to value. `null` means not covered, never zero.
        estimated:
          type: object
          additionalProperties:
            type: boolean
          description: Per district and per indicator, not per source. `true` means this value was estimated — see `meta.indicators[].estimation_method` for how.
      required:
      - objectid
      - district
      - state
    IndicatorMeta:
      type: object
      description: What one returned indicator is, where it came from and what it does not say.
      properties:
        id:
          type: string
        name:
          type: string
        unit:
          type:
          - string
          - 'null'
        source:
          type:
          - string
          - 'null'
        vintage:
          type:
          - string
          - 'null'
          description: The reference period of the data, not the publication date.
        caveat:
          type:
          - string
          - 'null'
          description: Reproduce this alongside the number.
        estimation_method:
          type:
          - string
          - 'null'
        polarity:
          type:
          - string
          - 'null'
          enum:
          - higher-better
          - higher-worse
          - neutral
          - null
          description: Which direction is good. `neutral` means neither tail is good or bad — a headcount, a share, a rate with two failure modes — and must not be ranked as an achievement.
        status:
          type: string
          enum:
          - published
          - deprecated
      required:
      - id
      - name
      - status
    DistrictProfile:
      type: object
      properties:
        meta:
          $ref: '#/components/schemas/Meta'
        district:
          $ref: '#/components/schemas/District'
      required:
      - meta
      - district
    Error:
      type: object
      properties:
        error:
          type: string
          description: A stable machine-readable code.
        message:
          type: string
        hint:
          type: string
          description: How to correct the request. Present on some 404s.
      required:
      - error
  parameters:
    limit:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 50
    objectid:
      name: objectid
      in: path
      required: true
      schema:
        type: integer
      description: 'The district''s id in this dataset. Resolve a name to one with `GET /v1/districts?q=`. Ids are pinned: a district keeps its objectid across data refreshes.'
      example: 421
    offset:
      name: offset
      in: query
      required: false
      schema:
        type: integer
        minimum: 0
        default: 0
    indicators:
      name: indicators
      in: query
      required: false
      schema:
        type: string
      description: Comma-separated indicator ids from `/v1/indicators`. At most 5.
      example: nfhs5_stunting,ag_gini
x-refined-from:
- openapi.json
- spatialindia-com-openapi.json