{
  "openapi": "3.1.0",
  "info": {
    "title": "DAP Bellwether API",
    "version": "1.0.0",
    "summary": "Publications from financial regulators in Canada, the US, the UK and the EU, as JSON.",
    "description": "The records behind the DAP Bellwether connector, for agents and systems that call HTTP rather than MCP. The same records are free for people through the connector at https://bellwether.dap.solutions/mcp. Priced from the first call at $0.01 in USDC on Base, paid per call with x402 v2 (exact scheme) through DAP Agent Payments: call without payment, read the price from the PAYMENT-REQUIRED header of the 402, and call again with a signed payment in PAYMENT-SIGNATURE. The answer is released after the payment settles, with the settlement record in PAYMENT-RESPONSE. A request refused before or after payment is never charged. A licensed institution sends its DAP licence key instead and is invoiced for what it used. This is a public information service. It is not legal or compliance advice.",
    "termsOfService": "https://dap.solutions/terms/api/",
    "contact": {
      "name": "Dartmouth Advisory Partners",
      "email": "bsibeth@dap.solutions",
      "url": "https://bellwether.dap.solutions"
    }
  },
  "servers": [
    {
      "url": "https://bellwether.dap.solutions"
    }
  ],
  "externalDocs": {
    "description": "DAP Agent Payments",
    "url": "https://dap.solutions/solutions/systems/agent-payments/"
  },
  "security": [
    {},
    {
      "licenceKey": []
    },
    {
      "licenceKeyHeader": []
    }
  ],
  "paths": {
    "/api/search": {
      "get": {
        "operationId": "searchRegulatoryChanges",
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          }
        },
        "summary": "Search publications by keyword, jurisdiction, regulator, category or date.",
        "description": "Most recent first. Dated records rank above undated ones. $0.01 per call.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Keywords matched against title and summary.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "jurisdiction",
            "in": "query",
            "required": false,
            "description": "Restrict to one jurisdiction.",
            "schema": {
              "type": "string",
              "enum": [
                "CA",
                "US",
                "UK",
                "EU"
              ]
            }
          },
          {
            "name": "regulator",
            "in": "query",
            "required": false,
            "description": "Short name, for example OSFI, SEC, FCA, ESMA.",
            "schema": {
              "type": "string",
              "maxLength": 20
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Publication type.",
            "schema": {
              "type": "string",
              "enum": [
                "rules",
                "enforcement",
                "guidance",
                "news"
              ]
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "ISO 8601 date or timestamp, inclusive. A year, month or date alone starts at the beginning of that period in UTC. A time without a zone is UTC.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "ISO 8601 date or timestamp, inclusive. A year, month or date alone runs to the end of that period in UTC. A time without a zone is UTC.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum records to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching records.",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "The x402 settlement record, base64 JSON. Present on a paid answer.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count",
                    "records"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Record"
                      }
                    },
                    "coverage_note": {
                      "type": "string"
                    },
                    "notice": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was refused before any payment. Never charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "A DAP licence key was sent and is not recognized or has been revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The x402 v2 price is in the PAYMENT-REQUIRED header (base64 JSON) and repeated in the body.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "description": "The payment service or licence check is unavailable. Nothing was charged. Retry shortly."
          }
        }
      }
    },
    "/api/recent": {
      "get": {
        "operationId": "recentRegulatoryChanges",
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          }
        },
        "summary": "The newest publications across every covered regulator.",
        "description": "Newest first. $0.01 per call.",
        "parameters": [
          {
            "name": "jurisdiction",
            "in": "query",
            "required": false,
            "description": "Restrict to one jurisdiction.",
            "schema": {
              "type": "string",
              "enum": [
                "CA",
                "US",
                "UK",
                "EU"
              ]
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Look back this many days.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 365,
              "default": 14
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum records to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recent records.",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "The x402 settlement record, base64 JSON. Present on a paid answer.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count",
                    "records"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Record"
                      }
                    },
                    "coverage_note": {
                      "type": "string"
                    },
                    "notice": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was refused before any payment. Never charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "A DAP licence key was sent and is not recognized or has been revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The x402 v2 price is in the PAYMENT-REQUIRED header (base64 JSON) and repeated in the body.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "description": "The payment service or licence check is unavailable. Nothing was charged. Retry shortly."
          }
        }
      }
    },
    "/api/change": {
      "get": {
        "operationId": "getRegulatoryChange",
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          }
        },
        "summary": "One record in full, with every revision observed since first collection.",
        "description": "$0.01 per call. A record that does not exist answers 404 and is never charged.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Record id from a search or recent result.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The record and its revisions, oldest first.",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "The x402 settlement record, base64 JSON. Present on a paid answer.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "record",
                    "revisions"
                  ],
                  "properties": {
                    "record": {
                      "$ref": "#/components/schemas/Record"
                    },
                    "revisions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "revision": {
                            "type": "integer"
                          },
                          "observed_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "title": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "summary": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "notice": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was refused before any payment. Never charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "A DAP licence key was sent and is not recognized or has been revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The x402 v2 price is in the PAYMENT-REQUIRED header (base64 JSON) and repeated in the body.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "No record with that id. Never charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The payment service or licence check is unavailable. Nothing was charged. Retry shortly."
          }
        }
      }
    },
    "/api/coverage": {
      "get": {
        "operationId": "listCoverage",
        "summary": "Every regulator and feed monitored, and how fresh each one is. Free.",
        "security": [
          {}
        ],
        "responses": {
          "200": {
            "description": "Coverage.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Record": {
        "type": "object",
        "required": [
          "id",
          "regulator",
          "jurisdiction",
          "category",
          "title",
          "published_at",
          "first_collected_at",
          "revision"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{32}$"
          },
          "regulator": {
            "type": "string"
          },
          "jurisdiction": {
            "type": "string",
            "enum": [
              "CA",
              "US",
              "UK",
              "EU"
            ]
          },
          "category": {
            "type": "string",
            "enum": [
              "rules",
              "enforcement",
              "guidance",
              "news"
            ]
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "published_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "The publication date the regulator gave. Null when the source publishes none: collection time is never put in its place."
          },
          "first_collected_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_confirmed_at": {
            "type": "string",
            "format": "date-time"
          },
          "revision": {
            "type": "integer",
            "minimum": 1,
            "description": "Above 1 when the record was amended after first collection."
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "licenceKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A DAP licence key (dapk_...), issued to an institution under a licence and invoiced by usage. Contact bsibeth@dap.solutions."
      },
      "licenceKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "The same DAP licence key, for platforms that set an API key header."
      }
    }
  }
}