{
  "openapi": "3.1.0",
  "info": {
    "title": "BodyHackGuide Open API",
    "summary": "Peptide & nootropic research data from BodyHackGuide",
    "description": "Read-only JSON endpoints exposing BodyHackGuide's compound database, vendor catalog, and listing prices. Regenerated on every site build. No auth, no rate limit. Shape stable across versions.",
    "version": "1.0.0",
    "contact": {
      "name": "BodyHackGuide",
      "url": "https://www.bodyhackguide.co"
    },
    "license": {
      "name": "CC-BY-4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    }
  },
  "servers": [
    {
      "url": "https://www.bodyhackguide.co",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/v1/compounds.json": {
      "get": {
        "summary": "List all tracked compounds",
        "description": "Every research peptide / nootropic / supplement profile with PMID-backed metadata, dose ranges, half-life, and chemical identifiers (CAS, PubChem CID, IUPAC).",
        "responses": {
          "200": {
            "description": "Array of compound objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Compound"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/vendors.json": {
      "get": {
        "summary": "List all active vendors",
        "description": "Every research-compound supplier tracked on BodyHackGuide.",
        "responses": {
          "200": {
            "description": "Array of vendor objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Vendor"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/listings.json": {
      "get": {
        "summary": "List all active product listings",
        "description": "Every active vendor listing with its last recorded price, compound + vendor names joined inline, and computed price-per-mg.",
        "responses": {
          "200": {
            "description": "Array of listing objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Listing"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Compound": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "name",
          "url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string",
            "example": "bpc-157"
          },
          "name": {
            "type": "string",
            "example": "BPC-157"
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "category": {
            "type": "string",
            "example": "Recovery"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "half_life": {
            "type": "string",
            "nullable": true
          },
          "molecular_weight": {
            "type": "number",
            "nullable": true
          },
          "amino_acid_sequence": {
            "type": "string",
            "nullable": true
          },
          "administration_routes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dose_range_mcg": {
            "type": "string",
            "nullable": true
          },
          "research_stage": {
            "type": "string",
            "nullable": true
          },
          "cas_number": {
            "type": "string",
            "nullable": true
          },
          "pubchem_cid": {
            "type": "integer",
            "nullable": true
          },
          "pubmed_count": {
            "type": "integer",
            "nullable": true
          },
          "url": {
            "type": "string",
            "format": "uri",
            "example": "https://www.bodyhackguide.co/compound/bpc-157"
          }
        }
      },
      "Vendor": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "name",
          "url",
          "active"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "short_name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "brand_color": {
            "type": "string",
            "example": "#10b981"
          },
          "rating": {
            "type": "number",
            "nullable": true,
            "minimum": 0,
            "maximum": 5
          },
          "active": {
            "type": "boolean"
          },
          "priority": {
            "type": "integer"
          },
          "payment_methods": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "shipping_regions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "default_coupon": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Listing": {
        "type": "object",
        "required": [
          "id",
          "compound_id",
          "vendor_id",
          "price"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "compound_id": {
            "type": "string",
            "format": "uuid"
          },
          "compound_slug": {
            "type": "string"
          },
          "compound_name": {
            "type": "string"
          },
          "vendor_id": {
            "type": "string",
            "format": "uuid"
          },
          "vendor_slug": {
            "type": "string"
          },
          "vendor_name": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "form_type": {
            "type": "string",
            "example": "vial"
          },
          "total_mg": {
            "type": "number"
          },
          "concentration": {
            "type": "string",
            "nullable": true
          },
          "price": {
            "type": "number",
            "example": 49.99
          },
          "price_per_mg": {
            "type": "number",
            "nullable": true
          },
          "stock_status": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}
