CFPB Consumer Complaint Database API — Trends

CFPB Consumer Complaint Database API — Trends. 1 operations. Lead operation: Aggregated complaint trends. Self-contained Naftiko capability covering one Consumer Financial Protection Bureau business surface.

Run with Naftiko Consumer Financial Protection BureauTrends

What You Can Do

GET
Gettrends — Aggregated complaint trends
/v1/trends

MCP Tools

aggregated-complaint-trends

Aggregated complaint trends

read-only idempotent

Capability Spec

cfpb-ccdb-trends.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: CFPB Consumer Complaint Database API — Trends
  description: 'CFPB Consumer Complaint Database API — Trends. 1 operations. Lead operation: Aggregated complaint trends.
    Self-contained Naftiko capability covering one Consumer Financial Protection Bureau business surface.'
  tags:
  - Consumer Financial Protection Bureau
  - Trends
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    CONSUMER_FINANCIAL_PROTECTION_BUREAU_API_KEY: CONSUMER_FINANCIAL_PROTECTION_BUREAU_API_KEY
capability:
  consumes:
  - type: http
    namespace: cfpb-ccdb-trends
    baseUri: https://www.consumerfinance.gov/data-research/consumer-complaints/search/api/v1
    description: CFPB Consumer Complaint Database API — Trends business capability. Self-contained, no shared references.
    resources:
    - name: trends
      path: /trends/
      operations:
      - name: gettrends
        method: GET
        description: Aggregated complaint trends
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: lens
          in: query
          type: string
          required: true
        - name: trend_depth
          in: query
          type: integer
        - name: trend_interval
          in: query
          type: string
        - name: date_received_min
          in: query
          type: string
        - name: date_received_max
          in: query
          type: string
  exposes:
  - type: rest
    namespace: cfpb-ccdb-trends-rest
    port: 8080
    description: REST adapter for CFPB Consumer Complaint Database API — Trends. One Spectral-compliant resource per consumed
      operation, prefixed with /v1.
    resources:
    - path: /v1/trends
      name: trends
      description: REST surface for trends.
      operations:
      - method: GET
        name: gettrends
        description: Aggregated complaint trends
        call: cfpb-ccdb-trends.gettrends
        with:
          lens: rest.lens
          trend_depth: rest.trend_depth
          trend_interval: rest.trend_interval
          date_received_min: rest.date_received_min
          date_received_max: rest.date_received_max
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: cfpb-ccdb-trends-mcp
    port: 9090
    transport: http
    description: MCP adapter for CFPB Consumer Complaint Database API — Trends. One tool per consumed operation, routed inline
      through this capability's consumes block.
    tools:
    - name: aggregated-complaint-trends
      description: Aggregated complaint trends
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: cfpb-ccdb-trends.gettrends
      with:
        lens: tools.lens
        trend_depth: tools.trend_depth
        trend_interval: tools.trend_interval
        date_received_min: tools.date_received_min
        date_received_max: tools.date_received_max
      outputParameters:
      - type: object
        mapping: $.