{
  "openapi": "3.1.0",
  "info": {
    "title": "TheCannabisInformer Strain API",
    "version": "1.0.0",
    "description": "Read-only JSON snapshots. No credentials or query filters. Unknown data is null; sample chemistry must retain its context. HTML errors may be returned by the static host for unknown paths."
  },
  "servers": [
    {
      "url": "https://thecannabisinformer.com"
    }
  ],
  "paths": {
    "/api/v1/strains.json": {
      "get": {
        "operationId": "listStrains",
        "summary": "All available records",
        "responses": {
          "200": {
            "description": "Versioned dataset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dataset"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/strains/{slug}.json": {
      "get": {
        "operationId": "getStrain",
        "summary": "One record by its exact slug",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Record with version and dataset revision",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "api_version",
                    "dataset_revision",
                    "status",
                    "data"
                  ],
                  "properties": {
                    "api_version": {
                      "type": "string"
                    },
                    "dataset_revision": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Strain"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No public record at that path; response may be HTML."
          }
        }
      }
    },
    "/api/v1/catalogs.json": {
      "get": {
        "operationId": "getCatalogs",
        "summary": "Types, reported effects and aroma labels with strain counts",
        "responses": {
          "200": {
            "description": "Versioned catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Dataset": {
        "type": "object",
        "required": [
          "api_version",
          "dataset_revision",
          "status",
          "total",
          "items"
        ],
        "properties": {
          "api_version": {
            "type": "string"
          },
          "dataset_revision": {
            "type": "string"
          },
          "status": {
            "enum": [
              "preview",
              "beta"
            ]
          },
          "total": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Strain"
            }
          }
        }
      },
      "Strain": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "url",
          "summary",
          "genetics",
          "chemistry",
          "growing",
          "sources"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "summary": {
            "type": "string"
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "type": {
            "type": "string"
          },
          "genetics": {
            "type": "object",
            "description": "Parent names and any identity uncertainty. Unavailable parent pages have null slugs."
          },
          "reported_effects": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "aroma_descriptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reported_terpenes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "chemistry": {
            "type": "object",
            "description": "Source-linked published_descriptions identify each breeder release separately from batch-specific measured panels. They are not combined into a typical strain range. Missing panels are null; not-detected and below-loq are explicit result statuses, never zero substitutes."
          },
          "growing": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Named releases; flowering and seed-to-harvest timings are separate. Available difficulty, indoor/outdoor heights and yield estimates, climate and harvest descriptions retain their source and units; unknown fields are null."
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          }
        }
      }
    }
  }
}