dados.gov.pt Spatial API

Spatial references

GitHub OpenAPI

Operations 7

GET /spatial/coverage/{level}/ List each zone for a given level with their datasets count #
GET /spatial/granularities/ List all known spatial granularities #
GET /spatial/levels/ List all known levels #
GET /spatial/zone/{id}/ Fetch a zone #
GET /spatial/zone/{id}/datasets/ Fetch datasets for a given zone #
GET /spatial/zones/suggest/ Geospatial zones suggest endpoint using mongoDB contains #
GET /spatial/zones/{ids}/ Fetch a zone list as GeoJSON #

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/open-government-portugal:open-government-portugal-spatial-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. See our Privacy Policy and Terms.

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

OpenAPI Specification

open-government-portugal-spatial-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: uData API
  title: uData Spatial API
  version: '1.0'
servers:
- url: /api/1
tags:
- description: Spatial references
  name: Spatial
paths:
  /spatial/coverage/{level}/:
    parameters:
    - in: path
      name: level
      required: true
      schema:
        type: string
    get:
      operationId: spatial_coverage
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/GeoJSONFeatureCollection'
                type: array
      summary: List each zone for a given level with their datasets count
      tags:
      - Spatial
  /spatial/granularities/:
    get:
      operationId: spatial_granularities
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/GeoGranularity'
                type: array
      summary: List all known spatial granularities
      tags:
      - Spatial
  /spatial/levels/:
    get:
      operationId: spatial_levels
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/GeoLevel'
                type: array
      summary: List all known levels
      tags:
      - Spatial
  /spatial/zone/{id}/:
    get:
      operationId: spatial_zone
      parameters:
      - description: A zone identifier
        in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
      summary: Fetch a zone
      tags:
      - Spatial
  /spatial/zone/{id}/datasets/:
    get:
      operationId: spatial_zone_datasets
      parameters:
      - description: A zone identifier
        in: path
        name: id
        required: true
        schema:
          type: string
      - description: Append dynamic datasets
        in: query
        name: dynamic
        schema:
          type: boolean
      - description: The amount of datasets to fetch
        in: query
        name: size
        schema:
          type: integer
          default: 25
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetReference'
      summary: Fetch datasets for a given zone
      tags:
      - Spatial
  /spatial/zones/suggest/:
    get:
      operationId: suggest_zones
      parameters:
      - description: The string to autocomplete/suggest
        in: query
        name: q
        required: true
        schema:
          type: string
      - description: The amount of suggestion to fetch
        in: query
        name: size
        schema:
          type: integer
          default: 10
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/TerritorySuggestion'
                type: array
      summary: Geospatial zones suggest endpoint using mongoDB contains
      tags:
      - Spatial
  /spatial/zones/{ids}/:
    get:
      operationId: spatial_zones
      parameters:
      - description: A zone identifiers list (comma separated)
        in: path
        name: ids
        required: true
        schema:
          type: string
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeoJSONFeatureCollection'
      summary: Fetch a zone list as GeoJSON
      tags:
      - Spatial
components:
  schemas:
    GeoJSON:
      properties:
        coordinates:
          description: The geometry as coordinates lists
          items:
            type: object
          type: array
        type:
          description: The GeoJSON Type
          enum:
          - Point
          - LineString
          - Polygon
          - MultiPoint
          - MultiLineString
          - MultiPolygon
          example: Point
          type: string
      required:
      - coordinates
      - type
      type: object
    DatasetReference:
      allOf:
      - $ref: '#/components/schemas/BaseReference'
      - properties: {}
        type: object
    GeoLevel:
      properties:
        id:
          description: The level identifier
          type: string
        name:
          description: The level name
          type: string
      required:
      - id
      - name
      type: object
    GeoJSONFeature:
      properties:
        geometry:
          $ref: '#/components/schemas/GeoJSON'
        id:
          type: string
        properties:
          type: object
        type:
          enum:
          - Feature
          example: Feature
          type: string
      required:
      - geometry
      - type
      type: object
    BaseReference:
      discriminator:
        propertyName: class
      properties:
        class:
          description: The object class
          type: string
        id:
          description: The object unique identifier
          type: string
      required:
      - class
      - id
      type: object
    GeoJSONFeatureCollection:
      properties:
        features:
          items:
            $ref: '#/components/schemas/GeoJSONFeature'
          type: array
        type:
          enum:
          - FeatureCollection
          example: FeatureCollection
          type: string
      required:
      - features
      - type
      type: object
    GeoGranularity:
      properties:
        id:
          description: The granularity identifier
          type: string
        name:
          description: The granularity name
          type: string
      required:
      - id
      - name
      type: object
    TerritorySuggestion:
      properties:
        code:
          description: The territory main code
          type: string
        id:
          description: The territory identifier
          type: string
        level:
          description: The territory administrative level
          type: string
        name:
          description: The territory name
          type: string
        uri:
          description: The zone uri
          type: string
      required:
      - code
      - id
      - level
      - name
      - uri
      type: object
  securitySchemes:
    apikey:
      in: header
      name: X-API-KEY
      type: apiKey