{
  "openapi": "3.1.0",
  "info": {
    "title": "InPublic.tv public catalog",
    "version": "1.2.0",
    "description": "Read-only discovery; playback and current conditions are unverified."
  },
  "servers": [
    {
      "url": "https://inpublic.tv"
    }
  ],
  "paths": {
    "/api/v1/cameras/search": {
      "get": {
        "operationId": "searchCameras",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog metadata or viewing URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Not found"
          },
          "503": {
            "description": "Catalog unavailable"
          }
        }
      }
    },
    "/api/v1/cameras/nearby": {
      "get": {
        "operationId": "nearbyCameras",
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "lng",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "radiusKm",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog metadata or viewing URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Not found"
          },
          "503": {
            "description": "Catalog unavailable"
          }
        }
      }
    },
    "/api/v1/cameras/{id}": {
      "get": {
        "operationId": "cameraDetails",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog metadata or viewing URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Not found"
          },
          "503": {
            "description": "Catalog unavailable"
          }
        }
      }
    },
    "/api/v1/destinations": {
      "get": {
        "operationId": "searchDestinations",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog metadata or viewing URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Not found"
          },
          "503": {
            "description": "Catalog unavailable"
          }
        }
      }
    },
    "/api/v1/view/build": {
      "get": {
        "operationId": "buildView",
        "parameters": [
          {
            "name": "ids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog metadata or viewing URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Not found"
          },
          "503": {
            "description": "Catalog unavailable"
          }
        }
      }
    },
    "/api/v1/radio/search": {
      "get": {
        "operationId": "radio_search",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Discovery metadata, current availability unverified"
          },
          "400": {
            "description": "Invalid parameters"
          },
          "503": {
            "description": "Catalog unavailable"
          }
        }
      }
    },
    "/api/v1/collections": {
      "get": {
        "operationId": "collections",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Discovery metadata, current availability unverified"
          },
          "400": {
            "description": "Invalid parameters"
          },
          "503": {
            "description": "Catalog unavailable"
          }
        }
      }
    },
    "/api/v1/observations": {
      "get": {
        "operationId": "observations",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Discovery metadata, current availability unverified"
          },
          "400": {
            "description": "Invalid parameters"
          },
          "503": {
            "description": "Catalog unavailable"
          }
        }
      }
    },
    "/api/v1/measurements": {
      "get": {
        "operationId": "getMeasurement",
        "description": "Latest provider-reported observation, not guaranteed current. Optional station applies only to marine; defaults to 44009.",
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "iss",
                "geomagnetic",
                "marine",
                "tide-atlantic",
                "tide-cape-may",
                "river"
              ]
            }
          },
          {
            "name": "station",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9]{3,8}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reported observation or no valid observation"
          },
          "400": {
            "description": "Invalid parameters"
          },
          "502": {
            "description": "Provider unavailable"
          }
        }
      }
    }
  }
}