{
  "openapi": "3.1.0",
  "info": {
    "title": "PiggyBank money guides API",
    "version": "1.0.0",
    "description": "Read-only, static JSON: sourced guides to UK credit reports, borrowing costs, debt help and consumer rights, published by PB Loans Limited (FCA FRN 704303). No authentication. An MCP server with the same data is at /mcp. General information, not advice."
  },
  "servers": [
    {
      "url": "https://www.piggybankloans.co.uk"
    }
  ],
  "paths": {
    "/api/index.json": {
      "get": {
        "summary": "Overview, topics and links",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Overview"
                }
              }
            }
          }
        }
      }
    },
    "/api/guides.json": {
      "get": {
        "summary": "Every guide in full",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Guides"
                }
              }
            }
          }
        }
      }
    },
    "/api/guides/{slug}.json": {
      "get": {
        "summary": "One guide",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "apr-and-total-repayable",
                "how-to-check-your-credit-report",
                "cant-afford-your-loan-repayments",
                "where-to-get-free-debt-advice",
                "which-bills-to-pay-first"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Guide"
                }
              }
            }
          },
          "404": {
            "description": "Unknown slug"
          }
        }
      }
    },
    "/api/answers.json": {
      "get": {
        "summary": "Every quick answer",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answers"
                }
              }
            }
          }
        }
      }
    },
    "/api/news.json": {
      "get": {
        "summary": "Every news story, newest first",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/News"
                }
              }
            }
          }
        }
      }
    },
    "/api/debt-help.json": {
      "get": {
        "summary": "Free UK debt advice organisations",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/loan-facts.json": {
      "get": {
        "summary": "PiggyBank’s own loan as published",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Source": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "publisher": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Section": {
        "type": "object",
        "properties": {
          "heading": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "table": {
            "type": "object"
          }
        }
      },
      "Guide": {
        "type": "object",
        "required": [
          "slug",
          "title",
          "url"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "topic": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "summary": {
            "type": "string"
          },
          "key_points": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Section"
            }
          },
          "faq": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source"
            }
          },
          "last_reviewed": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "Guides": {
        "type": "object",
        "properties": {
          "generated": {
            "type": "string",
            "format": "date"
          },
          "guides": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Guide"
            }
          }
        }
      },
      "Answers": {
        "type": "object",
        "properties": {
          "generated": {
            "type": "string",
            "format": "date"
          },
          "answers": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "News": {
        "type": "object",
        "properties": {
          "generated": {
            "type": "string",
            "format": "date"
          },
          "news": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "Overview": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "topics": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "mcp": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}