{
  "openapi": "3.1.0",
  "info": {
    "title": "Spread-bet.co.uk data",
    "version": "1.0.0",
    "description": "Read-only broker data published by spread-bet.co.uk. Static JSON, no authentication.",
    "contact": {
      "url": "https://www.spread-bet.co.uk/contact/"
    }
  },
  "servers": [
    {
      "url": "https://www.spread-bet.co.uk"
    }
  ],
  "paths": {
    "/api/brokers.json": {
      "get": {
        "operationId": "listBrokers",
        "summary": "Every spread betting provider reviewed on this site.",
        "responses": {
          "200": {
            "description": "The broker dataset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrokerDataset"
                }
              }
            }
          }
        }
      }
    },
    "/api/status.json": {
      "get": {
        "operationId": "getStatus",
        "summary": "Build identifier and dataset size.",
        "responses": {
          "200": {
            "description": "Status document."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BrokerDataset": {
        "type": "object",
        "required": [
          "count",
          "brokers"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "market": {
            "type": "string"
          },
          "regulator": {
            "type": "string"
          },
          "generated": {
            "type": "string",
            "format": "date"
          },
          "count": {
            "type": "integer"
          },
          "brokers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Broker"
            }
          }
        }
      },
      "Broker": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "reviewUrl"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "rank": {
            "type": "integer",
            "description": "The site's own ranking, 1 is highest."
          },
          "legalEntity": {
            "type": [
              "string",
              "null"
            ],
            "description": "FCA authorised entity."
          },
          "fcaFirmReferenceNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "reviewUrl": {
            "type": "string",
            "format": "uri"
          },
          "rating": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "ratingScale": {
            "type": "integer"
          }
        }
      }
    }
  }
}
