{
  "openapi": "3.1.0",
  "info": {
    "title": "CentralSource public business facts",
    "version": "1.0",
    "description": "Read-only JSON copies of CentralSource business pages: the same public facts as each page, with the date each fact was last confirmed and whether the business approved it or it was read from the business's own website. No key needed. For a business's full approved knowledge (customer or staff level), use the keyed REST API or MCP server at https://api.centralsource.com.au (see /developers/).",
    "termsOfService": "https://centralsource.com.au/terms/",
    "contact": {
      "name": "CentralSource",
      "email": "hello@centralsource.com.au",
      "url": "https://centralsource.com.au/developers/"
    }
  },
  "servers": [
    {
      "url": "https://centralsource.com.au"
    }
  ],
  "paths": {
    "/b/{slug}/facts.json": {
      "get": {
        "operationId": "getBusinessFacts",
        "summary": "Public facts of one business",
        "description": "Beside the business page /b/{slug}/ (which links to it with rel=\"alternate\" type=\"application/json\"). Present only while the page is public and indexable.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{1,62}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The business's public facts",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "schema": {
                  "type": "string"
                },
                "description": "When the content last changed: the latest confirmation date, or later if the page changed without one."
              },
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string",
                  "const": "*"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessFacts"
                }
              }
            }
          },
          "304": {
            "description": "Not modified (send If-None-Match or If-Modified-Since)."
          },
          "404": {
            "description": "No JSON copy: the business has no public, indexable page (for example a page with too little information to be shown to search engines yet)."
          }
        }
      }
    },
    "/directory/index.json": {
      "get": {
        "operationId": "getDirectoryIndex",
        "summary": "Index of all businesses with a JSON copy (first page)",
        "responses": {
          "200": {
            "description": "First page of the index; follow `next`",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "schema": {
                  "type": "string"
                },
                "description": "When the content last changed: the latest confirmation date, or later if the page changed without one."
              },
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string",
                  "const": "*"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DirectoryIndex"
                }
              }
            }
          },
          "304": {
            "description": "Not modified (send If-None-Match or If-Modified-Since)."
          }
        }
      }
    },
    "/directory/index-{page}.json": {
      "get": {
        "operationId": "getDirectoryIndexPage",
        "summary": "Later pages of the index (5,000 businesses a page)",
        "parameters": [
          {
            "name": "page",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 2
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the index",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "schema": {
                  "type": "string"
                },
                "description": "When the content last changed: the latest confirmation date, or later if the page changed without one."
              },
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string",
                  "const": "*"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DirectoryIndex"
                }
              }
            }
          },
          "304": {
            "description": "Not modified (send If-None-Match or If-Modified-Since)."
          },
          "404": {
            "description": "No such page"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BusinessFacts": {
        "type": "object",
        "description": "schema.org JSON-LD (LocalBusiness or a more specific type, as on the page) with a CentralSource extension under the `cs:` prefix.",
        "required": [
          "@context",
          "@type",
          "name",
          "url",
          "cs:version",
          "cs:verification",
          "cs:facts",
          "cs:generatedAt"
        ],
        "properties": {
          "@context": {},
          "@type": {
            "type": "string"
          },
          "@id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The business page (canonical HTML)"
          },
          "telephone": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "address": {
            "type": "object"
          },
          "openingHours": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "areaServed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "identifier": {
            "type": "object",
            "description": "ABN, when the page shows it"
          },
          "hasOfferCatalog": {
            "type": "object"
          },
          "priceRange": {
            "type": "string"
          },
          "subjectOf": {
            "type": "object",
            "description": "FAQPage"
          },
          "mainEntityOfPage": {
            "type": "object",
            "description": "The business page (schema.org WebPage) with its dateModified: when the page's facts were last approved or confirmed",
            "properties": {
              "@type": {
                "const": "WebPage"
              },
              "@id": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "dateModified": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "cs:version": {
            "type": "string"
          },
          "cs:page": {
            "type": "string"
          },
          "cs:json": {
            "type": "string"
          },
          "cs:verification": {
            "enum": [
              "verified",
              "claimed",
              "unclaimed"
            ],
            "description": "verified: website and ABN checked, the business approves its page. claimed: the business keeps its page itself; it proved it controls its website, or (no website) CentralSource checked it against the ABN register. unclaimed: read from the business's own website, not confirmed by the business."
          },
          "cs:verificationNote": {
            "type": "string"
          },
          "cs:source": {
            "type": "object"
          },
          "cs:lastConfirmed": {
            "type": [
              "string",
              "null"
            ]
          },
          "cs:generatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When this file's content last changed"
          },
          "cs:keyFacts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          },
          "cs:notices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "summary": {
                  "type": "string"
                }
              }
            }
          },
          "cs:pricesNote": {
            "type": "string"
          },
          "cs:facts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Fact"
            }
          },
          "cs:terms": {
            "type": "object"
          }
        }
      },
      "Fact": {
        "type": "object",
        "description": "One fact as the page shows it. Fields appear only when the page shows them.",
        "required": [
          "section",
          "kind",
          "status",
          "lastConfirmed"
        ],
        "properties": {
          "section": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "business",
              "location",
              "service_area",
              "product",
              "service",
              "price",
              "policy",
              "faq",
              "procedure",
              "other"
            ]
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "question": {
            "type": "string"
          },
          "answer": {
            "type": "string"
          },
          "group": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "description": "The business's own category for this product, service or price (a heading on the page)"
          },
          "link": {
            "type": "string",
            "format": "uri",
            "description": "A page on the business's website about this item"
          },
          "price": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "number"
              },
              "currency": {
                "const": "AUD"
              },
              "text": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "from": {
                "type": "boolean"
              },
              "gstIncluded": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "true when the business gave the price including GST; null when not stated (see cs:pricesNote)"
              }
            }
          },
          "details": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          },
          "hours": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "days": {
                  "type": "string"
                },
                "hours": {
                  "type": "string"
                }
              }
            }
          },
          "address": {
            "type": "string"
          },
          "visits": {
            "type": "string"
          },
          "publicHolidays": {
            "type": "string"
          },
          "publicHolidayHours": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "hours": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "areas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "role": {
            "type": "string"
          },
          "day": {
            "type": "string"
          },
          "time": {
            "type": "string"
          },
          "lastConfirmed": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the fact was last approved or confirmed by the business; on an unclaimed page, when it was read from the business's website"
          },
          "status": {
            "enum": [
              "owner_approved",
              "read_from_business_website"
            ]
          }
        }
      },
      "DirectoryIndex": {
        "type": "object",
        "required": [
          "total",
          "page",
          "pages",
          "businesses"
        ],
        "properties": {
          "cs:version": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pages": {
            "type": "integer"
          },
          "next": {
            "type": "string"
          },
          "previous": {
            "type": "string"
          },
          "dateModified": {
            "type": [
              "string",
              "null"
            ]
          },
          "businesses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "category": {
                  "type": "string"
                },
                "place": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "state": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "verification": {
                  "enum": [
                    "verified",
                    "claimed",
                    "unclaimed"
                  ]
                },
                "page": {
                  "type": "string"
                },
                "json": {
                  "type": "string"
                },
                "dateModified": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}
