Data Commons · Capability

Data Commons REST API V2 — Observation

Data Commons REST API V2 — Observation. 2 operations. Lead operation: Fetch statistical observations. Self-contained Naftiko capability covering one Data Commons business surface.

Run with Naftiko Data CommonsObservation

What You Can Do

GET
Get — Fetch statistical observations
/v1/observation
POST
Post — Fetch statistical observations
/v1/observation

MCP Tools

fetch-statistical-observations

Fetch statistical observations

read-only idempotent
fetch-statistical-observations-2

Fetch statistical observations

read-only

Capability Spec

data-commons-observation.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Data Commons REST API V2 — Observation
  description: 'Data Commons REST API V2 — Observation. 2 operations. Lead operation: Fetch statistical observations. Self-contained
    Naftiko capability covering one Data Commons business surface.'
  tags:
  - Data Commons
  - Observation
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    DATA_COMMONS_API_KEY: DATA_COMMONS_API_KEY
capability:
  consumes:
  - type: http
    namespace: data-commons-observation
    baseUri: https://api.datacommons.org/v2
    description: Data Commons REST API V2 — Observation business capability. Self-contained, no shared references.
    resources:
    - name: observation
      path: /observation
      operations:
      - name: get
        method: GET
        description: Fetch statistical observations
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: date
          in: query
          type: string
        - name: select
          in: query
          type: array
        - name: entity.dcids
          in: query
          type: array
        - name: entity.expression
          in: query
          type: string
        - name: variable.dcids
          in: query
          type: array
      - name: post
        method: POST
        description: Fetch statistical observations
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    authentication:
      type: apikey
      key: X-API-Key
      value: '{{env.DATA_COMMONS_API_KEY}}'
      placement: header
  exposes:
  - type: rest
    namespace: data-commons-observation-rest
    port: 8080
    description: REST adapter for Data Commons REST API V2 — Observation. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/observation
      name: observation
      description: REST surface for observation.
      operations:
      - method: GET
        name: get
        description: Fetch statistical observations
        call: data-commons-observation.get
        with:
          date: rest.date
          select: rest.select
          entity.dcids: rest.entity.dcids
          entity.expression: rest.entity.expression
          variable.dcids: rest.variable.dcids
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: post
        description: Fetch statistical observations
        call: data-commons-observation.post
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: data-commons-observation-mcp
    port: 9090
    transport: http
    description: MCP adapter for Data Commons REST API V2 — Observation. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: fetch-statistical-observations
      description: Fetch statistical observations
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: data-commons-observation.get
      with:
        date: tools.date
        select: tools.select
        entity.dcids: tools.entity.dcids
        entity.expression: tools.entity.expression
        variable.dcids: tools.variable.dcids
      outputParameters:
      - type: object
        mapping: $.
    - name: fetch-statistical-observations-2
      description: Fetch statistical observations
      hints:
        readOnly: true
        destructive: false
        idempotent: false
      call: data-commons-observation.post
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.