Opendata.cat Portals API

Portals de transparencia i dades obertes

GitHub OpenAPI

Operations 2

GET /portals.php Llista portals de transparencia #
GET /portal.php Detall d'un portal #

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/opendata-cat:opendata-cat-portals-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

opendata-cat-portals-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Opendata.cat Portals API
  description: API publica per accedir al cataleg de +2.800 datasets de dades obertes de Catalunya. 9 portals (Generalitat, Barcelona, Diba, AOC, Reus, Girona, FGC, Idescat, Renfe) + dades de +1.000 municipis. Queryable via Socrata, CKAN, Opendatasoft, Idescat API, GTFS-RT i Renfe GTFS-RT JSON.
  version: 1.0.0
  contact:
    name: opendata.cat
    url: https://opendata.cat
    email: xavi.vinaixa@gmail.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
- url: https://opendata.cat/api
  description: Produccio
tags:
- name: Portals
  description: Portals de transparencia i dades obertes
paths:
  /portals.php:
    get:
      tags:
      - Portals
      summary: Llista portals de transparencia
      description: Retorna la llista paginada de 1.769 portals de transparencia d'administracions publiques catalanes. Permet cercar per nom i filtrar per tipus d'administracio.
      operationId: listPortals
      parameters:
      - name: q
        in: query
        description: Cerca per nom oficial del portal.
        schema:
          type: string
      - name: admin
        in: query
        description: 'Filtrar per tipus d''administracio (ex: ''Ajuntament'', ''Consell Comarcal'').'
        schema:
          type: string
      - name: page
        in: query
        description: Numero de pagina.
        schema:
          type: integer
          default: 1
          minimum: 1
      - name: limit
        in: query
        description: Resultats per pagina.
        schema:
          type: integer
          default: 50
          minimum: 10
          maximum: 100
      responses:
        '200':
          description: Llista de portals paginada
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Portal'
                  total:
                    type: integer
                  page:
                    type: integer
                  limit:
                    type: integer
                  pages:
                    type: integer
                  admins:
                    type: array
                    items:
                      type: object
                      properties:
                        tipus_administracio:
                          type: string
                        total:
                          type: integer
  /portal.php:
    get:
      tags:
      - Portals
      summary: Detall d'un portal
      description: Retorna les dades d'un portal de transparencia per slug.
      operationId: getPortal
      parameters:
      - name: slug
        in: query
        required: true
        description: Slug del portal (URL-friendly).
        schema:
          type: string
        example: ajuntament-de-barcelona
      responses:
        '200':
          description: Detall del portal
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Portal'
        '404':
          description: Portal no trobat
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Portal:
      type: object
      properties:
        slug:
          type: string
          example: ajuntament-de-barcelona
        tipus_administracio:
          type: string
          example: Ajuntament
        tipus_institucio:
          type: string
        nom_oficial:
          type: string
          example: Ajuntament de Barcelona
        url:
          type: string
          format: uri
    Error:
      type: object
      properties:
        error:
          type: string
          description: Missatge d'error