dados.gov.pt Topics API

Topics related operations

GitHub OpenAPI

Operations 11

GET /topics/ List all topics #
POST /topics/ Create a topic #
GET /topics/search/ List or search all topics #
DELETE /topics/{topic}/ Delete a given topic #
GET /topics/{topic}/ Get a given topic #
PUT /topics/{topic}/ Update a given topic #
DELETE /topics/{topic}/elements/ Delete all elements from a Topic #
GET /topics/{topic}/elements/ Get a given topic's elements with pagination #
POST /topics/{topic}/elements/ Topic elements create #
DELETE /topics/{topic}/elements/{element_id}/ Delete a given element from the given topic #
PUT /topics/{topic}/elements/{element_id}/ Update a given element from the given topic #

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-topics-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-topics-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: udata API v2
  title: uData Topics API
  version: '2.0'
servers:
- url: /api/2
tags:
- description: Topics related operations
  name: Topics
paths:
  /topics/:
    get:
      operationId: get_topics_api
      parameters:
      - description: The search query
        in: query
        name: q
        schema:
          type: string
      - description: The field (and direction) on which sorting apply
        in: query
        name: sort
        schema:
          type: string
          enum:
          - name
          - created
          - last_modified
          - -name
          - -created
          - -last_modified
      - description: The page to display
        in: query
        name: page
        schema:
          type: integer
          default: 1
      - description: The page size
        in: query
        name: page_size
        schema:
          type: integer
          default: 20
      - description: If set to true, it will filter on private topics only. If set to false, it will exclude private topics. User must be authenticated and results are limited to user visibility
        in: query
        name: private
        schema:
          type: boolean
      - in: query
        name: tag
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      - in: query
        name: geozone
        schema:
          type: string
      - in: query
        name: granularity
        schema:
          type: string
      - in: query
        name: organization
        schema:
          type: string
      - in: query
        name: owner
        schema:
          type: string
      - in: query
        name: featured
        schema:
          type: boolean
      - 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/TopicPage'
      summary: List all topics
      tags:
      - Topics
    post:
      operationId: create_topic
      parameters:
      - 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/Topic'
        '400':
          description: Validation error
      summary: Create a topic
      tags:
      - Topics
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TopicInput'
        required: true
  /topics/search/:
    get:
      operationId: search_topics
      parameters:
      - description: The search query
        in: query
        name: q
        schema:
          type: string
      - in: query
        name: tag
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      - in: query
        name: featured
        schema:
          type: boolean
      - in: query
        name: last_update_range
        schema:
          type: string
          enum:
          - last_30_days
          - last_12_months
          - last_3_years
      - in: query
        name: organization
        schema:
          type: string
      - in: query
        name: producer_type
        schema:
          type: string
          enum:
          - company
          - association
          - local-authority
          - public-service
          - user
          - not-specified
      - description: The field (and direction) on which sorting apply
        in: query
        name: sort
        schema:
          type: string
          enum:
          - name
          - created
          - last_modified
          - -name
          - -created
          - -last_modified
      - description: The page to display
        in: query
        name: page
        schema:
          type: integer
          default: 1
      - description: The page size
        in: query
        name: page_size
        schema:
          type: integer
          default: 20
      - 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/TopicSearchPage'
      summary: List or search all topics
      tags:
      - Topics
  /topics/{topic}/:
    parameters:
    - description: The topic ID
      in: path
      name: topic
      required: true
      schema:
        type: string
    delete:
      operationId: delete_topic
      responses:
        '204':
          description: Object deleted
        '403':
          description: Forbidden
        '404':
          description: Topic not found
      summary: Delete a given topic
      tags:
      - Topics
    get:
      operationId: get_topic
      parameters:
      - 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/Topic'
        '404':
          description: Topic not found
      summary: Get a given topic
      tags:
      - Topics
    put:
      operationId: update_topic
      parameters:
      - 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/Topic'
        '400':
          description: Validation error
        '403':
          description: Forbidden
        '404':
          description: Topic not found
      summary: Update a given topic
      tags:
      - Topics
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TopicInput'
        required: true
  /topics/{topic}/elements/:
    parameters:
    - description: The topic ID
      in: path
      name: topic
      required: true
      schema:
        type: string
    delete:
      description: 'This a workaround for https://github.com/kvesteri/wtforms-json/issues/43

        -> we can''t use PUT /api/2/topics/{topic}/ with an empty list of elements'
      operationId: topic_elements_delete
      responses:
        '403':
          description: Forbidden
        '404':
          description: Topic not found
      summary: Delete all elements from a Topic
      tags:
      - Topics
    get:
      operationId: topic_elements
      parameters:
      - description: query string to search through elements
        in: query
        name: q
        schema:
          type: string
      - description: The field (and direction) on which sorting apply
        in: query
        name: sort
        schema:
          type: string
      - description: The page to fetch
        in: query
        name: page
        schema:
          type: integer
          default: 1
      - description: The page size to fetch
        in: query
        name: page_size
        schema:
          type: integer
          default: 20
      - description: The class of elements to fetch (eg. Dataset or Reuse)
        in: query
        name: class
        schema:
          type: string
      - in: query
        name: tag
        style: form
        explode: true
        schema:
          type: array
          items:
            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/TopicElementPage'
      summary: Get a given topic's elements with pagination
      tags:
      - Topics
    post:
      operationId: topic_elements_create
      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/TopicElement'
                type: array
        '400':
          description: Expecting a list
        '403':
          description: Forbidden
        '404':
          description: Topic not found
      tags:
      - Topics
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/ModelReference'
              type: array
        required: true
      summary: Topic elements create
      x-summary-source: derived
  /topics/{topic}/elements/{element_id}/:
    parameters:
    - description: The topic ID
      in: path
      name: topic
      required: true
      schema:
        type: string
    - description: The element ID
      in: query
      name: element
      schema:
        type: string
    - in: path
      name: element_id
      required: true
      schema:
        type: string
    delete:
      operationId: delete_topic_element_api_/topics/<topic:topic>/elements/<element_id>/
      responses:
        '204':
          description: Success
        '404':
          description: Topic not found
      summary: Delete a given element from the given topic
      tags:
      - Topics
    put:
      operationId: topic_element_update
      parameters:
      - 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/TopicElement'
        '204':
          description: Success
        '404':
          description: Topic not found
      summary: Update a given element from the given topic
      tags:
      - Topics
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TopicElement'
        required: true
components:
  schemas:
    ModelReference:
      properties:
        class:
          description: The model class
          type: string
        id:
          description: The object identifier
          type: string
      required:
      - class
      - id
      type: object
    TopicInput:
      properties:
        created_at:
          description: The topic creation date
          format: date-time
          readOnly: true
          type: string
        description:
          description: The topic description in Markdown
          format: markdown
          type: string
        elements:
          items:
            allOf:
            - $ref: '#/components/schemas/TopicElement'
            description: The topic elements
          type: array
        extras:
          description: Extras attributes as key-value pairs
          type: object
        featured:
          description: Is the topic featured
          type: boolean
        id:
          description: The topic identifier
          type: string
        last_modified:
          description: The topic last modification date
          format: date-time
          readOnly: true
          type: string
        name:
          description: The topic name
          type: string
        organization:
          allOf:
          - $ref: '#/components/schemas/OrganizationReference'
          description: The publishing organization
          readOnly: true
        owner:
          allOf:
          - $ref: '#/components/schemas/UserReference'
          description: The owner user
          readOnly: true
        private:
          description: Is the topic private
          type: boolean
        slug:
          description: The topic permalink string
          readOnly: true
          type: string
        spatial:
          allOf:
          - $ref: '#/components/schemas/SpatialCoverage'
          description: The spatial coverage
        tags:
          description: Some keywords to help in search
          items:
            type: string
          type: array
        uri:
          description: The topic API URI
          readOnly: true
          type: string
      required:
      - description
      - name
      - tags
      type: object
    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
    Badge__read:
      properties:
        kind:
          type: string
      required:
      - kind
      type: object
    SpatialCoverage:
      properties:
        geom:
          allOf:
          - $ref: '#/components/schemas/GeoJSON'
          description: A multipolygon for the whole coverage
        granularity:
          default: other
          description: The spatial/territorial granularity (full Granularity object if `X-Get-Datasets-Full-Objects` is set, ID of the granularity otherwise)
          type: object
        zones:
          description: The covered zones identifiers (full GeoZone objects if `X-Get-Datasets-Full-Objects` is set, IDs of the zones otherwise)
          type: object
      type: object
    TopicElement:
      properties:
        description:
          description: The element description
          type: string
        element:
          allOf:
          - $ref: '#/components/schemas/ModelReference'
          description: The element target object
        extras:
          description: Extras attributes as key-value pairs
          type: object
        id:
          description: The element id
          type: string
        tags:
          description: The element tags
          items:
            type: string
          type: array
        title:
          description: The element title
          type: string
      type: object
    TopicElementPage:
      properties:
        data:
          description: The page data
          items:
            $ref: '#/components/schemas/TopicElement'
          type: array
        next_page:
          description: The next page URL if exists
          type: string
        page:
          description: The current page
          minimum: 1
          type: integer
        page_size:
          description: The page size used for pagination
          minimum: 0
          type: integer
        previous_page:
          description: The previous page URL if exists
          type: string
        total:
          description: The total paginated items
          minimum: 0
          type: integer
      required:
      - page
      - page_size
      - total
      type: object
    OrganizationPermissions:
      properties:
        delete:
          type: boolean
        edit:
          type: boolean
        harvest:
          type: boolean
        members:
          type: boolean
        private:
          type: boolean
      type: object
    Topic:
      properties:
        created_at:
          description: The topic creation date
          format: date-time
          readOnly: true
          type: string
        description:
          description: The topic description in Markdown
          format: markdown
          type: string
        elements:
          description: Link to the topic elements
          type: object
        extras:
          description: Extras attributes as key-value pairs
          type: object
        featured:
          description: Is the topic featured
          type: boolean
        id:
          description: The topic identifier
          type: string
        last_modified:
          description: The topic last modification date
          format: date-time
          readOnly: true
          type: string
        name:
          description: The topic name
          type: string
        organization:
          allOf:
          - $ref: '#/components/schemas/OrganizationReference'
          description: The publishing organization
          readOnly: true
        owner:
          allOf:
          - $ref: '#/components/schemas/UserReference'
          description: The owner user
          readOnly: true
        private:
          description: Is the topic private
          type: boolean
        slug:
          description: The topic permalink string
          readOnly: true
          type: string
        spatial:
          allOf:
          - $ref: '#/components/schemas/SpatialCoverage'
          description: The spatial coverage
        tags:
          description: Some keywords to help in search
          items:
            type: string
          type: array
        uri:
          description: The topic API URI
          readOnly: true
          type: string
      required:
      - description
      - name
      - tags
      type: object
    UserReference:
      properties:
        avatar:
          description: The user avatar URL
          type: string
        avatar_thumbnail:
          description: The user avatar thumbnail URL. This is the square (500x500) and cropped version.
          type: string
        first_name:
          description: The user first name
          readOnly: true
          type: string
        last_name:
          description: The user larst name
          readOnly: true
          type: string
        page:
          description: The user web page URL
          readOnly: true
          type: string
        slug:
          description: The user permalink string
          readOnly: true
          type: string
        uri:
          description: The API URI for this user
          readOnly: true
          type: string
      type: object
    TopicSearchPage:
      properties:
        data:
          description: The page data
          items:
            $ref: '#/components/schemas/Topic'
          type: array
        facets:
          description: Facets/aggregations for filtering
          type: object
        next_page:
          description: The next page URL if exists
          type: string
        page:
          description: The current page
          minimum: 1
          type: integer
        page_size:
          description: The page size used for pagination
          minimum: 0
          type: integer
        previous_page:
          description: The previous page URL if exists
          type: string
        total:
          description: The total paginated items
          minimum: 0
          type: integer
      required:
      - page
      - page_size
      - total
      type: object
    OrganizationReference:
      properties:
        acronym:
          description: The organization acronym
          type: string
        badges:
          description: The organization badges
          items:
            $ref: '#/components/schemas/Badge__read'
          readOnly: true
          type: array
        logo:
          description: The organization logo URL
          type: string
        logo_thumbnail:
          description: The organization logo thumbnail URL. This is the square (100x100) and cropped version.
          type: string
        name:
          description: The organization name
          readOnly: true
          type: string
        page:
          description: The organization web page URL
          readOnly: true
          type: string
        permissions:
          allOf:
          - $ref: '#/components/schemas/OrganizationPermissions'
          readOnly: true
        slug:
          description: The organization string used as permalink
          readOnly: true
          type: string
        uri:
          description: The API URI for this organization
          readOnly: true
          type: string
      type: object
    TopicPage:
      properties:
        data:
          description: The page data
          items:
            $ref: '#/components/schemas/Topic'
          type: array
        next_page:
          description: The next page URL if exists
          type: string
        page:
          description: The current page
          minimum: 1
          type: integer
        page_size:
          description: The page size used for pagination
          minimum: 0
          type: integer
        previous_page:
          description: The previous page URL if exists
          type: string
        total:
          description: The total paginated items
          minimum: 0
          type: integer
      required:
      - page
      - page_size
      - total
      type: object
  securitySchemes:
    apikey:
      in: header
      name: X-API-KEY
      type: apiKey