Cernion Query Tools API

The Query Tools API from Cernion — 4 operation(s) for query tools.

Operations 5

POST /api/query/ask Natural language query to energy data (MaStR, ENTSO-E, SMARD) #
POST /api/query/ask-learned Template-based queries using self-learning system (20x faster) #
GET /api/query/search Search Cernion energy objects (companies, VDMI, ZNP, grid connections, EDM) #
POST /api/query/search Search Cernion data with a JSON request body #
POST /api/query/discover Schema discovery for databases, tables, columns, and available tools #

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/cernion-de:cernion-de-query-tools-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

cernion-de-query-tools-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Cernion Energy Tools Query Tools API
  version: 0.99.22
  description: 'MicroService Agent System for Energy Markets - REST API with AI integration.


    CERNION_TOKEN: request at https://cernion.de/ or by email: dev@stromdao.com.


    For the public instance at https://api.cernion.de/, create your token at https://cernion.de/cet-token/.'
servers:
- url: https://api.cernion.de
  description: API Server
tags:
- name: Query Tools
paths:
  /api/query/ask:
    post:
      summary: Natural language query to energy data (MaStR, ENTSO-E, SMARD)
      tags:
      - Query Tools
      operationId: query_ask
      parameters:
      - $ref: '#/components/parameters/TokenQuery'
      responses:
        '200':
          description: Successful query execution with answer and metadata
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  answer:
                    type: string
                    description: Natural language answer
                    example: 'Total PV capacity in Bavaria: 31,604,839.789 kW'
                  data:
                    type: object
                    description: Structured data result
                  sources:
                    type: array
                    items:
                      type: string
                    description: Data sources used
                    example:
                    - mastr_db
                  reasoning:
                    type: array
                    description: Query reasoning steps (if explain=true)
                  metadata:
                    type: object
                    description: Execution metadata
              example:
                success: true
                answer: 'Total PV capacity in Bavaria: 31,604,839.789 kW'
                data:
                  totalCapacityKW: 31604839.789
                  installationCount: 582345
                  region: Bayern
                sources:
                - mastr_db
                metadata:
                  toolUsed: cernion_ask
                  executionTime: 3.2
      description: 'Execute natural language queries against German energy data sources including MaStR (Marktstammdatenregister), ENTSO-E Transparency Platform, and SMARD.de. Supports multi-source data aggregation and complex queries without SQL knowledge.


        **Data Sources**:

        - **MaStR**: German registry of all energy installations (PV, wind, storage, etc.)

        - **ENTSO-E**: European electricity grid transparency data

        - **SMARD**: German electricity market data


        **Use Cases**:

        - Ad-hoc data exploration ("How much PV capacity in Bavaria?")

        - Quick questions without SQL knowledge

        - Multi-source data aggregation

        - Portfolio analysis and market research


        **Response Time**: Typically 2-8 seconds (includes LLM reasoning)'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - query
              properties:
                query:
                  type: string
                  description: Natural language question in German or English
                  minLength: 1
                  example: Wie viele Solaranlagen gibt es in Heidelberg mit mehr als 10 kWp?
                explain:
                  type: boolean
                  description: Include detailed reasoning and data sources used
                  default: false
                token:
                  type: string
                  description: Optional Cernion MCP token for this request. Overrides CERNION_TOKEN when provided.
            examples:
              regionalCapacity:
                summary: Regional PV capacity
                value:
                  query: Wieviel PV-Leistung in Bayern?
              installationCount:
                summary: Installation count by city
                value:
                  query: How many solar installations in Heidelberg with more than 10 kWp?
              yearlyComparison:
                summary: Yearly comparison
                value:
                  query: Vergleiche die Anzahl neuer Windanlagen 2024 vs 2025 in Baden-Württemberg
              multiSource:
                summary: Multi-source aggregation
                value:
                  query: Alle Redispatch-Anlagen bei Stadtwerke München
                  explain: true
  /api/query/ask-learned:
    post:
      summary: Template-based queries using self-learning system (20x faster)
      tags:
      - Query Tools
      operationId: query_askLearned
      parameters:
      - $ref: '#/components/parameters/TokenQuery'
      responses:
        '200':
          description: Successful query execution with template information
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  result:
                    type: object
                    description: Query result data
                  templateUsed:
                    type: boolean
                    description: Whether a template was used
                    example: true
                  confidence:
                    type: number
                    description: Template matching confidence (0.0-1.0)
                    example: 0.85
                  executionTimeMs:
                    type: number
                    description: Execution time in milliseconds
                    example: 45
                  metadata:
                    type: object
                    description: Execution metadata
              example:
                success: true
                result:
                  totalCapacityKW: 5234567.89
                  installationCount: 234567
                  region: Hessen
                templateUsed: true
                confidence: 0.92
                executionTimeMs: 45
                metadata:
                  toolUsed: cernion_ask_learned
                  templateId: regional_capacity_pv_v3
                  executionTime: 0.045
      description: 'Execute queries using learned templates from the Sprint 11 Self-Learning System. Reuses proven query patterns for 20x faster execution compared to cernion_ask. Falls back to LLM generation for new patterns.


        **Performance**:

        - **Template Match**: 50-200ms (20x faster than LLM)

        - **New Pattern**: 2-8 seconds (same as cernion_ask, but learns for future use)

        - **Confidence Threshold**: 0.6 (60%) default - higher = stricter matching


        **Use Cases**:

        - Recurring queries (regional capacity, installation counts)

        - Performance-critical applications

        - Batch processing (analyze multiple regions)

        - Real-time dashboards

        - API integrations requiring fast responses


        **When to Use**:

        - ✅ Recurring query patterns ("PV capacity in {region}")

        - ✅ Performance-critical applications

        - ✅ Batch processing

        - ❌ First-time complex queries → use cernion_ask first

        - ❌ Unstructured exploration → use cernion_ask'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - query
              properties:
                query:
                  type: string
                  description: Natural language query (same format as cernion_ask)
                  minLength: 1
                  example: PV-Leistung in Hessen
                confidence:
                  type: number
                  description: Minimum confidence threshold for template matching (0.0-1.0)
                  minimum: 0
                  maximum: 1
                  default: 0.6
                  example: 0.7
                forceGenerate:
                  type: boolean
                  description: Force LLM generation even if template matches (for testing)
                  default: false
                verbose:
                  type: boolean
                  description: Show detailed reasoning and statistics (template used, confidence score)
                  default: false
                token:
                  type: string
                  description: Optional Cernion MCP token for this request. Overrides CERNION_TOKEN when provided.
            examples:
              regionalCapacity:
                summary: Fast regional capacity query
                value:
                  query: PV-Leistung in Hessen
              strictMatching:
                summary: Strict template matching
                value:
                  query: Wie viele Windanlagen in Bayern?
                  confidence: 0.8
                  verbose: true
              forceNewPattern:
                summary: Force LLM generation
                value:
                  query: Solaranlagen in Heidelberg über 10 kWp
                  forceGenerate: true
              batchProcessing:
                summary: Batch processing (fast)
                value:
                  query: PV-Leistung in Baden-Württemberg
  /api/query/search:
    get:
      summary: Search Cernion energy objects (companies, VDMI, ZNP, grid connections, EDM)
      tags:
      - Query Tools
      operationId: searchCernionData
      parameters:
      - name: q
        in: query
        required: true
        description: Search term. Company/VNB name, VDMI matrix name, ZNP project name, grid operator name, or exact MeLo ID (DE…). German or English.
        schema:
          type: string
          minLength: 1
          maxLength: 200
          example: Stadtwerke Heidelberg
      - name: domain
        in: query
        required: false
        description: Restrict search to a specific data domain. Defaults to "all" which searches all domains in parallel.
        schema:
          type: string
          enum:
          - companies
          - vnb
          - edm
          - vdmi
          - grid_connection
          - znp
          - all
          default: all
          example: vdmi
      - name: limit
        in: query
        required: false
        description: Maximum number of results to return (1–25).
        schema:
          type: integer
          minimum: 1
          maximum: 25
          default: 10
      - $ref: '#/components/parameters/TokenQuery'
      responses:
        '200':
          description: Search results from matched domains
          content:
            application/json:
              schema:
                type: object
                properties:
                  query:
                    type: string
                    description: The original search term
                    example: Stadtwerke Heidelberg
                  domain:
                    type: string
                    enum:
                    - companies
                    - vnb
                    - edm
                    - vdmi
                    - grid_connection
                    - znp
                    - all
                    example: all
                  totalResults:
                    type: integer
                    example: 2
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Unique identifier within the domain
                          example: 550e8400-e29b-41d4-a716-446655440000
                        title:
                          type: string
                          description: Primary display name
                          example: Stadtwerke Heidelberg GmbH & Co. KG
                        excerpt:
                          type: string
                          description: One-line context string with key attributes
                        domain:
                          type: string
                          description: Source domain of this result
                          enum:
                          - companies
                          - edm
                          - vdmi
                          - grid_connection
                          - znp
                        type:
                          type: string
                          description: Object type within the domain
                          example: company
                        status:
                          type:
                          - string
                          - 'null'
                          description: Lifecycle or decision status of the object
                          example: active
                        url:
                          type: string
                          description: API path to retrieve the full record
                          example: /api/companies/550e8400-e29b-41d4-a716-446655440000
                        metadata:
                          type: object
                          description: Domain-specific structured attributes
                      required:
                      - id
                      - title
                      - excerpt
                      - domain
                      - type
                      - status
                      - url
                required:
                - query
                - domain
                - totalResults
                - results
              examples:
                companyHit:
                  summary: Company result
                  value:
                    query: Stadtwerke Heidelberg
                    domain: all
                    totalResults: 1
                    results:
                    - id: 550e8400-e29b-41d4-a716-446655440000
                      title: Stadtwerke Heidelberg
                      excerpt: 'Stadtwerke Heidelberg GmbH & Co. KG · VNB · BDEW 9900277000000 · 2 Marktpartner · Status: active'
                      domain: companies
                      type: company
                      status: active
                      url: /api/companies/550e8400-e29b-41d4-a716-446655440000
                      metadata:
                        memberCount: 2
                        hasVnb: true
                vdmiHit:
                  summary: VDMI matrix result
                  value:
                    query: Netzanschluss
                    domain: vdmi
                    totalResults: 1
                    results:
                    - id: abc123
                      title: Netzanschluss-Genehmigung PV
                      excerpt: 'Prozesstyp: standard · Nominierung: pending'
                      domain: vdmi
                      type: matrix
                      status: active
                      url: /api/vdmi/abc123
                      metadata:
                        processType: standard
                        nominationStatus: pending
                        evidenceCount: 2
                gridConnectionHit:
                  summary: Grid connection validation result
                  value:
                    query: STROMDAO Netze
                    domain: grid_connection
                    totalResults: 1
                    results:
                    - id: a1b2c3d4-1234-5678-90ab-cdef12345678
                      title: Netzanschluss-Validierung · STROMDAO Netze
                      excerpt: 'Entscheidung: GO_CONDITIONAL · 2026-03-30'
                      domain: grid_connection
                      type: validation
                      status: GO_CONDITIONAL
                      url: /api/grid-connection/validations/a1b2c3d4-1234-5678-90ab-cdef12345678
                      metadata:
                        gridOperatorName: STROMDAO Netze
                        findingsCount: 3
                        createdAt: '2026-03-30T10:00:00Z'
                noResults:
                  summary: No results
                  value:
                    query: nonexistent
                    domain: all
                    totalResults: 0
                    results: []
        '400':
          description: Validation error — q is missing or too long, limit out of range
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                    example: ValidationError
                  message:
                    type: string
      description: 'Search across Cernion energy management data for use in Microsoft 365 Copilot, OpenAPI plugins, and connected integrations.


        **Supported domains**:

        - **companies** — Search company entities (Stadtwerke, Konzernverbund) by name. Returns BDEW codes, market roles, member count.

        - **vnb** — Narrow search to companies with a Verteilnetzbetreiber (VNB) market role.

        - **edm** — Look up a Messlokalisation (MeLo) by its exact DE-prefixed ID.

        - **vdmi** — Search VDMI responsibility matrix instances by name, scope, or process type.

        - **grid_connection** — Search past grid connection validation reports by operator name or decision.

        - **znp** — Search Zielnetzplanung projects by name.

        - **all** (default) — Searches all domains in parallel.


        Each result carries **domain**, **type**, **id**, **title**, **excerpt**, **status**, and **url** pointing to the detail endpoint for that object.


        **Performance**: Deterministic, < 300 ms. Does not invoke any external API or LLM.


        **For complex natural-language queries** (e.g. "PV-Kapazität in Bayern") use POST /ask instead.'
    post:
      summary: Search Cernion data with a JSON request body
      tags:
      - Query Tools
      operationId: searchCernionDataBody
      parameters:
      - $ref: '#/components/parameters/TokenQuery'
      responses:
        '200':
          description: Search results from matched domains
          content:
            application/json:
              schema:
                type: object
                properties:
                  query:
                    type: string
                    description: The original search term
                  domain:
                    type: string
                    enum:
                    - companies
                    - vnb
                    - edm
                    - vdmi
                    - grid_connection
                    - znp
                    - all
                  totalResults:
                    type: integer
                  results:
                    type: array
                    items:
                      type: object
                required:
                - query
                - domain
                - totalResults
                - results
        '400':
          description: Validation error
      description: Search Cernion entities from Copilot Studio. Provide q as the search term, optionally domain and limit. Read-only.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                q:
                  type: string
                  minLength: 1
                  maxLength: 200
                  description: Required search term, such as a city, company, VNB, VDMI matrix, ZNP project, grid operator, or MeLo ID.
                  example: Wiesloch
                domain:
                  type: string
                  enum:
                  - companies
                  - vnb
                  - edm
                  - vdmi
                  - grid_connection
                  - znp
                  - all
                  default: all
                  description: Optional search domain. Use vnb to find distribution grid operators.
                  example: vnb
                limit:
                  type: integer
                  minimum: 1
                  maximum: 25
                  default: 10
                  description: Optional maximum number of results.
                  example: 5
                token:
                  type: string
                  description: Optional Cernion MCP token for this request. Overrides CERNION_TOKEN when provided.
              required:
              - q
  /api/query/discover:
    post:
      summary: Schema discovery for databases, tables, columns, and available tools
      tags:
      - Query Tools
      operationId: query_discover
      parameters:
      - $ref: '#/components/parameters/TokenQuery'
      responses:
        '200':
          description: Discovery result with requested information
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  scope:
                    type: string
                    example: databases
                  data:
                    type: object
                    description: Discovery results (structure depends on scope)
                  metadata:
                    type: object
              examples:
                databases:
                  summary: Available databases
                  value:
                    success: true
                    scope: databases
                    databases:
                    - mastr_db
                    - energy_charts_api
                    - deutschlandatlas
                    - ntp_api
                    - corrently_gsi_api
                    metadata:
                      count: 5
                      toolUsed: cernion_discover
                tools:
                  summary: Available MCP tools by category
                  value:
                    success: true
                    scope: tools
                    tools:
                      Query Tools:
                      - cernion_ask
                      - cernion_ask_learned
                      - cernion_discover
                      Energy Market Data:
                      - cernion_energy_prices
                      - cernion_energy_production
                      - cernion_co2_intensity
                      ENTSO-E:
                      - entsoe_day_ahead_prices
                      - entsoe_unavailability
                      - entsoe_physical_flows
                    metadata:
                      totalTools: 50
                      categories: 9
      description: 'Explore available data sources to prevent query errors and build dynamic UIs. Provides schema information about databases, tables, columns, operators, and available MCP tools.


        **Scopes**:

        - **tools**: List all available MCP tools by category

        - **databases**: Available databases (mastr_db, energy_charts_api, etc.)

        - **tables**: Tables in a specific database (requires database parameter)

        - **columns**: Columns in a table (requires database + table parameters)

        - **operators**: Available grid operators and energy suppliers

        - **locations**: Available regions, states, and postal codes (optional region filter)

        - **examples**: Sample queries for common use cases


        **Use Cases**:

        - Prevent query errors (validate parameters before execution)

        - Build dynamic UIs with available options

        - Explore data structure without documentation

        - Auto-complete functionality for query builders

        - Validate grid operator names before queries'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - scope
              properties:
                scope:
                  type: string
                  enum:
                  - tools
                  - databases
                  - tables
                  - columns
                  - operators
                  - locations
                  - examples
                  description: Discovery scope - what to explore
                  example: databases
                database:
                  type: string
                  description: Database name (required for tables/columns scope)
                  example: mastr_db
                table:
                  type: string
                  description: Table name (required for columns scope)
                  example: solar_extended
                region:
                  type: string
                  description: Optional filter for locations scope
                  example: Baden-Württemberg
                token:
                  type: string
                  description: Optional Cernion MCP token for this request. Overrides CERNION_TOKEN when provided.
            examples:
              listDatabases:
                summary: List available databases
                value:
                  scope: databases
              listTables:
                summary: List tables in MaStR database
                value:
                  scope: tables
                  database: mastr_db
              listColumns:
                summary: List columns in solar table
                value:
                  scope: columns
                  database: mastr_db
                  table: solar_extended
              listTools:
                summary: List all available MCP tools
                value:
                  scope: tools
              listOperators:
                summary: List grid operators
                value:
                  scope: operators
              listLocations:
                summary: List locations in Baden-Württemberg
                value:
                  scope: locations
                  region: Baden-Württemberg
              getExamples:
                summary: Get sample queries
                value:
                  scope: examples
components:
  parameters:
    TokenQuery:
      name: token
      in: query
      required: false
      schema:
        type: string
      description: Optional Cernion MCP token as URL query parameter. If provided, it overrides CERNION_TOKEN for this request. Prefer Authorization Bearer header in production to reduce token exposure in URLs/logs.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Optional Cernion MCP token. If not provided, falls back to CERNION_TOKEN from environment. Request token at https://cernion.de/ or by email: dev@stromdao.com.'