{
  "openapi": "3.1.0",
  "info": {
    "title": "Canada Live Music \u2014 public read-only city feed",
    "version": "1.1.0",
    "description": "Public read-only API information for Canada Live Music. Uses public listings only; no API key, account access, write actions, booking, or ticket purchases. Supports optional inclusive date_from/date_to filtering in the city timezone. Genre, act type, artist, and venue filtering are performed by the consuming app after retrieval. This is a researched selection, not a complete event inventory."
  },
  "servers": [
    {
      "url": "https://canadalivemusic.ca"
    }
  ],
  "security": [],
  "paths": {
    "/api/cities/{city}/events": {
      "get": {
        "operationId": "getPublicCityMusicListings",
        "summary": "Read the current public event collection for one supported city",
        "description": "Read-only public GET. The response contains event details, statuses, evidence, sources, and source check times. Exclude cancelled/postponed and unverified events from recommendations; clearly label sold_out. Check notice for outages or cached data and never equate an outage with no shows. Guelph/Oshawa are mirrored from their original public guides. No side effects.",
        "parameters": [
          {
            "name": "city",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "toronto",
                "ottawa",
                "hamilton",
                "london",
                "kitchener",
                "guelph",
                "kingston",
                "waterloo",
                "oshawa",
                "windsor",
                "st-catharines",
                "peterborough",
                "barrie",
                "burlington",
                "mississauga",
                "niagara-falls",
                "greater-sudbury",
                "thunder-bay",
                "oakville",
                "brantford"
              ]
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Inclusive local lower date bound, YYYY-MM-DD. Omit for no lower bound. Invalid/repeated/reversed bounds return 400."
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Inclusive local upper date bound, YYYY-MM-DD. Omit for no upper bound. No date parameters preserves the full published feed, including cancellation records."
          }
        ],
        "responses": {
          "200": {
            "description": "Current public city feed. Inspect notice even when HTTP is 200.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "city",
                    "name",
                    "timezone",
                    "today",
                    "events"
                  ],
                  "properties": {
                    "schemaVersion": {
                      "type": "integer"
                    },
                    "city": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "timezone": {
                      "type": "string"
                    },
                    "today": {
                      "type": "string",
                      "format": "date"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PublicEvent"
                      }
                    },
                    "notice": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "timezoneExplanation": {
                      "type": "string",
                      "description": "The city-configured timezone; current 20-city Ontario coverage uses America/Toronto, not a timezone assumption for all of Canada."
                    },
                    "filters": {
                      "type": "object",
                      "properties": {
                        "date_from": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date"
                        },
                        "date_to": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date"
                        },
                        "inclusive": {
                          "type": "boolean",
                          "const": true
                        },
                        "timezone": {
                          "type": "string"
                        }
                      }
                    },
                    "coverage": {
                      "type": "object",
                      "properties": {
                        "fullFeedEventCount": {
                          "type": "integer"
                        },
                        "returnedEventCount": {
                          "type": "integer"
                        },
                        "fullFeedDateRange": {
                          "type": "object",
                          "properties": {
                            "from": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "format": "date"
                            },
                            "to": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "format": "date"
                            }
                          }
                        },
                        "returnedDateRange": {
                          "type": "object",
                          "properties": {
                            "from": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "format": "date"
                            },
                            "to": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "format": "date"
                            }
                          }
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "description": "Separate summaries for every published event and for the returned date-filtered subset. Includes all statuses. Oldest/newest cover only known valid source-check times. A recent newest check does not make the whole city fresh.",
                      "properties": {
                        "generatedAt": {
                          "type": "string",
                          "format": "date-time",
                          "description": "When this response was generated, not when event sources were checked."
                        },
                        "meaning": {
                          "type": "string"
                        },
                        "fullFeed": {
                          "$ref": "#/components/schemas/SourceCheckSummary"
                        },
                        "returnedEvents": {
                          "$ref": "#/components/schemas/SourceCheckSummary"
                        }
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid, repeated, nonexistent or reversed date bounds. Error includes a human-readable message."
          },
          "404": {
            "description": "Unknown or unpublished city"
          },
          "500": {
            "description": "Server failure; no availability claim is valid"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PublicEvent": {
        "type": "object",
        "required": [
          "id",
          "title",
          "date",
          "venue",
          "sourceUrl",
          "status",
          "verification",
          "lastCheckedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "startTime": {
            "type": [
              "string",
              "null"
            ],
            "description": "Local HH:MM. Null or absent means unknown; do not infer midnight."
          },
          "doorsTime": {
            "type": [
              "string",
              "null"
            ]
          },
          "start": {
            "type": [
              "string",
              "null"
            ]
          },
          "end": {
            "type": [
              "string",
              "null"
            ]
          },
          "timezone": {
            "type": "string",
            "enum": [
              "America/Toronto"
            ]
          },
          "venue": {
            "type": "string"
          },
          "venueAddress": {
            "type": "string"
          },
          "genres": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Event-level genre labels. Empty/absent means unknown."
          },
          "actType": {
            "type": "string",
            "enum": [
              "original",
              "cover",
              "tribute",
              "mixed",
              "unknown"
            ],
            "description": "May be absent in original city feeds; absent means unknown. Do not substitute performer classification."
          },
          "artists": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "performers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "actType": {
                  "type": "string"
                },
                "genres": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "evidence": {
                  "type": "string"
                }
              }
            }
          },
          "description": {
            "type": "string"
          },
          "taxonomyEvidence": {
            "type": "string"
          },
          "sourceUrl": {
            "type": "string",
            "format": "uri"
          },
          "ticketUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "sourceLabel": {
            "type": "string"
          },
          "priceText": {
            "type": [
              "string",
              "null"
            ],
            "description": "Preserve verbatim. Null/absent does not mean free; do not infer all-in price."
          },
          "ageRestriction": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "cancelled",
              "postponed",
              "sold_out"
            ]
          },
          "verification": {
            "type": "string",
            "enum": [
              "verified",
              "uncertain"
            ]
          },
          "lastCheckedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the guide last checked this event source, not when this feed is fetched."
          },
          "editorNote": {
            "type": [
              "string",
              "null"
            ]
          },
          "background": {
            "type": "object",
            "properties": {
              "summary": {
                "type": "string"
              },
              "sources": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          }
        },
        "additionalProperties": true
      },
      "SourceCheckSummary": {
        "type": "object",
        "required": [
          "eventCount",
          "knownCheckCount",
          "unknownCheckCount",
          "invalidCheckCount",
          "oldestCheckedAt",
          "newestCheckedAt"
        ],
        "properties": {
          "eventCount": {
            "type": "integer",
            "minimum": 0
          },
          "knownCheckCount": {
            "type": "integer",
            "minimum": 0
          },
          "unknownCheckCount": {
            "type": "integer",
            "minimum": 0
          },
          "invalidCheckCount": {
            "type": "integer",
            "minimum": 0,
            "description": "Malformed or future timestamps, excluded from oldest/newest."
          },
          "oldestCheckedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "newestCheckedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      }
    }
  }
}
