{
  "openapi": "3.1.0",
  "info": {
    "title": "Danny Barker Web Design API",
    "version": "1.0.0",
    "summary": "Read-only JSON API for the content of www.dbwd.co.uk.",
    "description": "Search and read every page of www.dbwd.co.uk - Danny Barker Web Design's services, sectors, case studies and blog - and get its contact details, as JSON over HTTPS GET. No authentication and no API key.\n\n**Rate limits.** 120 requests per 60 seconds per client IP address. Every response carries the IETF `RateLimit-Policy` and `RateLimit` fields (and the older `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`); a `429` adds `Retry-After`.\n\n**Errors.** Every error is an RFC 9457 problem details object (`application/problem+json`) with a stable machine-readable `code` and a `resolution` hint. `type` links to the code's entry in the documentation.\n\n**Pagination.** List endpoints are cursor-based: pass `pagination.next_cursor` back as `cursor` (or follow `pagination.next_url`) until `has_more` is false.\n\n**Versioning and deprecation.** The major version is part of the path (`/api/v1`). Backwards-compatible additions - new fields, endpoints or optional parameters - can arrive within v1 at any time, so ignore fields you do not know. Anything that would break a client ships as a new path (`/api/v2`). A version that is going to be retired is marked deprecated here and its responses carry `Deprecation` (RFC 9745) and `Sunset` (RFC 8594) headers at least six months before the sunset date. Policy: https://www.dbwd.co.uk/developers.html#versioning\n\nEvery page is also available as Markdown (send `Accept: text/markdown` to its URL) and through the MCP server at https://www.dbwd.co.uk/mcp. See https://www.dbwd.co.uk/developers.html.",
    "contact": {
      "name": "Danny Barker Web Design",
      "email": "design@dannybarker.co.uk",
      "url": "https://www.dbwd.co.uk/developers.html"
    }
  },
  "externalDocs": {
    "description": "Developer documentation",
    "url": "https://www.dbwd.co.uk/developers.html"
  },
  "servers": [
    {
      "url": "https://www.dbwd.co.uk/api/v1",
      "description": "Production, version 1"
    }
  ],
  "tags": [
    {
      "name": "Content",
      "description": "Pages, blog articles and search."
    },
    {
      "name": "Organisation",
      "description": "Who DBWD are and how to reach them."
    },
    {
      "name": "API",
      "description": "The API itself."
    }
  ],
  "paths": {
    "/": {
      "get": {
        "operationId": "getApiIndex",
        "tags": [
          "API"
        ],
        "summary": "This version's endpoints and limits",
        "description": "Lists the v1 endpoints, the documentation and OpenAPI URLs, and the rate limit.",
        "responses": {
          "200": {
            "description": "The API index.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiIndex"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/organization": {
      "get": {
        "operationId": "getOrganization",
        "tags": [
          "Organisation"
        ],
        "summary": "Contact details and address",
        "description": "Danny Barker Web Design's name, description, telephone, email, postal address, contact page and project enquiry form.",
        "responses": {
          "200": {
            "description": "Organisation details.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/pages": {
      "get": {
        "operationId": "listPages",
        "tags": [
          "Content"
        ],
        "summary": "List every page",
        "description": "Every page on the site in site order (company, services, sectors, legal, then the blog), as summaries with their HTML, Markdown and API URLs. Cursor-paginated.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Section"
          },
          {
            "$ref": "#/components/parameters/PageLimit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of results.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/pages/{page}": {
      "get": {
        "operationId": "getPage",
        "tags": [
          "Content"
        ],
        "summary": "One site page with its Markdown",
        "description": "A site page (not a blog article) by its key - the file name without .html, or `index` for the homepage.",
        "parameters": [
          {
            "name": "page",
            "in": "path",
            "required": true,
            "description": "Page key, e.g. `website-design`.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]+$"
            },
            "example": "website-design"
          }
        ],
        "responses": {
          "200": {
            "description": "The page.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/blog/{slug}": {
      "get": {
        "operationId": "getBlogArticle",
        "tags": [
          "Content"
        ],
        "summary": "One blog article with its Markdown",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Article slug, e.g. `seo-infographic`.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]+$"
            },
            "example": "seo-infographic"
          }
        ],
        "responses": {
          "200": {
            "description": "The article.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/search": {
      "get": {
        "operationId": "searchSite",
        "tags": [
          "Content"
        ],
        "summary": "Search the whole site",
        "description": "Ranked results for keywords or a natural-language question. Use this instead of crawling pages.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Keywords or a natural-language question.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "website design"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 8
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked results.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResults"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "Section": {
        "name": "section",
        "in": "query",
        "required": false,
        "description": "Only pages in this section.",
        "schema": {
          "type": "string",
          "enum": [
            "all",
            "company",
            "services",
            "sectors",
            "legal",
            "blog"
          ],
          "default": "all"
        }
      },
      "PageLimit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "description": "Page size.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 20
        }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "description": "Opaque cursor from `pagination.next_cursor` of the previous page, used with the same `section`.",
        "schema": {
          "type": "string"
        }
      }
    },
    "headers": {
      "RateLimit": {
        "description": "Quota left in the current window: `\"default\";r=<remaining>;t=<seconds until reset>` (IETF httpapi rate-limit headers).",
        "schema": {
          "type": "string"
        },
        "example": "\"default\";r=119;t=42"
      },
      "RateLimit-Policy": {
        "description": "The quota policy: `\"default\";q=120;w=60`.",
        "schema": {
          "type": "string"
        },
        "example": "\"default\";q=120;w=60"
      },
      "RateLimit-Limit": {
        "description": "Requests allowed per window.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimit-Remaining": {
        "description": "Requests left in the current window.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimit-Reset": {
        "description": "Seconds until the window resets.",
        "schema": {
          "type": "integer"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before retrying.",
        "schema": {
          "type": "integer"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "A parameter is missing or invalid (`missing_parameter`, `invalid_parameter`, `invalid_cursor`).",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "NotFound": {
        "description": "No such page, article or endpoint (`page_not_found`, `not_found`).",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Rate limit exceeded (`rate_limited`). Wait for `Retry-After` seconds.",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          },
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "The site index is being rebuilt (`service_unavailable`). Retry after `Retry-After` seconds.",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          },
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    },
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details, with a machine-readable `code` and a `resolution` hint.",
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "code",
          "resolution"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "description": "Documentation URL for this error code."
          },
          "title": {
            "type": "string",
            "description": "Short, human-readable summary of the problem type."
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status code."
          },
          "detail": {
            "type": "string",
            "description": "What went wrong with this request."
          },
          "instance": {
            "type": "string",
            "description": "The request path."
          },
          "code": {
            "type": "string",
            "enum": [
              "invalid_parameter",
              "missing_parameter",
              "invalid_cursor",
              "not_found",
              "page_not_found",
              "method_not_allowed",
              "rate_limited",
              "service_unavailable",
              "internal_error"
            ],
            "description": "Stable machine-readable error code."
          },
          "resolution": {
            "type": "string",
            "description": "How to fix the request."
          },
          "parameter": {
            "type": "string",
            "description": "The query parameter at fault, for parameter errors."
          }
        }
      },
      "ApiIndex": {
        "type": "object",
        "required": [
          "name",
          "version",
          "documentation",
          "openapi",
          "endpoints"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "current",
              "deprecated"
            ]
          },
          "documentation": {
            "type": "string",
            "format": "uri"
          },
          "openapi": {
            "type": "string",
            "format": "uri"
          },
          "authentication": {
            "type": "string",
            "enum": [
              "none"
            ]
          },
          "rate_limit": {
            "type": "object",
            "properties": {
              "requests": {
                "type": "integer"
              },
              "window_seconds": {
                "type": "integer"
              },
              "per": {
                "type": "string"
              }
            }
          },
          "endpoints": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "method",
                "url"
              ],
              "properties": {
                "method": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Organization": {
        "type": "object",
        "required": [
          "name",
          "url",
          "email",
          "telephone",
          "address"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "alternate_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "telephone": {
            "type": "string"
          },
          "address": {
            "type": "object",
            "properties": {
              "street": {
                "type": "string"
              },
              "locality": {
                "type": "string"
              },
              "region": {
                "type": "string"
              },
              "postal_code": {
                "type": "string"
              },
              "country": {
                "type": "string"
              },
              "formatted": {
                "type": "string"
              }
            }
          },
          "founded": {
            "type": "string"
          },
          "area_served": {
            "type": "string"
          },
          "contact_page": {
            "type": "string",
            "format": "uri"
          },
          "project_enquiry_form": {
            "type": "string",
            "format": "uri"
          },
          "same_as": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          }
        }
      },
      "PageSummary": {
        "type": "object",
        "required": [
          "key",
          "name",
          "title",
          "section",
          "url",
          "markdown_url",
          "api_url"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "`index`, a page key such as `about-us`, or `blog/<slug>`."
          },
          "name": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "section": {
            "type": "string",
            "enum": [
              "company",
              "services",
              "sectors",
              "legal",
              "blog"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "markdown_url": {
            "type": "string",
            "format": "uri"
          },
          "api_url": {
            "type": "string",
            "format": "uri"
          },
          "last_modified": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "tokens": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Approximate size of the Markdown in tokens."
          }
        }
      },
      "Page": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PageSummary"
          },
          {
            "type": "object",
            "required": [
              "markdown"
            ],
            "properties": {
              "h1": {
                "type": "string"
              },
              "headings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "markdown": {
                "type": "string",
                "description": "The page as Markdown with YAML front matter."
              }
            }
          }
        ]
      },
      "PageList": {
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PageSummary"
            }
          },
          "pagination": {
            "type": "object",
            "required": [
              "limit",
              "has_more",
              "next_cursor"
            ],
            "properties": {
              "limit": {
                "type": "integer"
              },
              "has_more": {
                "type": "boolean"
              },
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "next_url": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri"
              }
            }
          }
        }
      },
      "SearchResults": {
        "type": "object",
        "required": [
          "query",
          "count",
          "results"
        ],
        "properties": {
          "query": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "rank",
                "page",
                "excerpt"
              ],
              "properties": {
                "rank": {
                  "type": "integer"
                },
                "score": {
                  "type": "number"
                },
                "page": {
                  "$ref": "#/components/schemas/PageSummary"
                },
                "excerpt": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
