openapi: 3.1.0
info:
  title: THC vs THCa API
  description: |
    THC vs THCa is a cannabis comparison platform providing strain data, pricing comparisons,
    COA analysis, dosage calculations, and legal status information across all 50 US states.
    
    This API serves structured cannabis data for AI agents, search engines, and developers.
    
    For bulk data access, use:
    - /llms-full.txt — Complete structured data export
    - /llms-ctx.txt — Context-window-optimized compact summary
    - /llms-faq.txt — Structured Q&A format
  version: "2.0.0"
  contact:
    name: THC vs THCa Support
    email: support@thcvsthca.com
    url: https://www.thcvsthca.com/contact
  termsOfService: https://www.thcvsthca.com/terms

servers:
  - url: https://www.thcvsthca.com
    description: Production

paths:
  /strains:
    get:
      operationId: listStrains
      summary: Browse and search cannabis strains
      description: |
        Access our database of 1000+ cannabis strains with detailed information including
        effects, terpene profiles, cannabinoid content (THC/CBD percentages), lineage,
        grow difficulty, and user reviews.
      parameters:
        - name: search
          in: query
          description: Search strains by name
          schema:
            type: string
        - name: type
          in: query
          description: Filter by strain type
          schema:
            type: string
            enum: [indica, sativa, hybrid]
        - name: effect
          in: query
          description: Filter by primary effect
          schema:
            type: string
            enum: [relaxing, energizing, creative, pain-relief, sleep, focus, euphoric]
        - name: terpene
          in: query
          description: Filter by dominant terpene
          schema:
            type: string
            enum: [myrcene, limonene, caryophyllene, linalool, pinene, terpinolene, humulene]
      responses:
        "200":
          description: HTML page with strain listings and filter controls

  /strains/{slug}:
    get:
      operationId: getStrain
      summary: Get detailed strain information
      description: |
        View comprehensive data for a specific cannabis strain including THC/CBD content,
        terpene profile, effects, flavors, medical uses, grow info, lineage, and user reviews.
      parameters:
        - name: slug
          in: path
          required: true
          description: URL-friendly strain name (e.g., "blue-dream-strain")
          schema:
            type: string
      responses:
        "200":
          description: HTML page with full strain profile

  /compare:
    get:
      operationId: comparePrices
      summary: Compare THC vs THCa prices
      description: |
        Side-by-side comparison of traditional dispensary THC products versus federally legal
        hemp-derived THCa products. Shows pricing differences (typically 40-60% savings),
        potency comparisons, and product availability. Key fact: THCa × 0.877 = equivalent THC.
      responses:
        "200":
          description: HTML comparison page with interactive price tables

  /coa-analysis:
    get:
      operationId: coaAnalysis
      summary: AI-powered Certificate of Analysis parser
      description: |
        Upload or paste a Certificate of Analysis (COA) lab report to extract cannabinoid
        potency (THC, THCa, CBD, CBG, CBN), terpene content, contaminant testing results
        (pesticides, heavy metals, microbials, residual solvents), and safety verification.
        Supports PDF, image, and text input formats.
      responses:
        "200":
          description: HTML COA analysis tool with upload interface

  /dosage-calculator:
    get:
      operationId: dosageCalculator
      summary: Personalized cannabis dosage calculator
      description: |
        Calculate recommended cannabis dosages based on experience level, tolerance,
        body weight, consumption method (flower, edibles, concentrates, tinctures, vapes),
        and product type. Provides min/max mg ranges with safety guidelines.
        Beginner range: 2.5-5mg THC for edibles, 1-2 puffs for flower.
      responses:
        "200":
          description: HTML dosage calculator with interactive form

  /heatmap:
    get:
      operationId: legalHeatmap
      summary: US cannabis legality heatmap
      description: |
        Interactive map showing cannabis legality status across all 50 US states.
        Covers recreational, medical, and hemp-derived THCa legality with possession limits,
        purchase limits, dispensary counts, shipping rules, and recent legislative updates.
      responses:
        "200":
          description: HTML interactive US map with state-by-state data

  /ai-assistant:
    get:
      operationId: aiAssistant
      summary: AI Budtender conversational assistant
      description: |
        Conversational AI that recommends cannabis strains based on desired effects,
        medical needs, flavor preferences, and experience level. Provides personalized
        suggestions with reasoning backed by strain database data.
      responses:
        "200":
          description: HTML AI assistant chat interface

  /smart-recommendations:
    get:
      operationId: smartRecommendations
      summary: AI-powered strain matching
      description: |
        Get personalized strain recommendations based on your preferences, past usage,
        and desired effects using machine learning algorithms that analyze terpene
        sensitivity, effect correlations, and consumption patterns.
      responses:
        "200":
          description: HTML recommendations page

  /product-scanner:
    get:
      operationId: productScanner
      summary: Cannabis product scanner
      description: |
        Scan cannabis product barcodes or upload product images for instant identification,
        cannabinoid info lookup, and price comparison across verified vendors.
      responses:
        "200":
          description: HTML scanner interface with camera/upload

  /thca-flower:
    get:
      operationId: thcaFlower
      summary: Browse THCa flower products
      description: |
        Browse hemp-derived THCa flower products with lab-verified potency,
        terpene profiles, strain information, and price comparisons across vendors.
      responses:
        "200":
          description: HTML product listing page

  /thca-products:
    get:
      operationId: thcaProducts
      summary: Browse all THCa products
      description: |
        Browse THCa concentrates, diamonds, edibles, vapes, and other product types
        with verified lab results and competitive pricing.
      responses:
        "200":
          description: HTML product category page

  /thc-gummies:
    get:
      operationId: thcGummies
      summary: Browse THC gummies and edibles
      description: |
        Browse Delta-9 THC gummies and edibles with verified potency, flavor options,
        dosage information, and price comparisons.
      responses:
        "200":
          description: HTML gummies listing page

  /deals:
    get:
      operationId: deals
      summary: Current cannabis deals and coupons
      description: |
        Live promotions, coupon codes, and bulk discounts from verified cannabis retailers.
        Updated daily with price tracking and savings calculations.
      responses:
        "200":
          description: HTML deals page with active promotions

  /blog:
    get:
      operationId: listBlogPosts
      summary: Cannabis education and guides
      description: |
        Educational content covering strain guides, consumption methods, legal updates,
        industry news, and cannabis science. All articles are fact-checked and sourced.
      responses:
        "200":
          description: HTML blog listing

  /blog/{slug}:
    get:
      operationId: getBlogPost
      summary: Read a specific blog article
      description: |
        Full blog post with cannabis education content, strain reviews, legal analysis,
        or industry news. Includes author info, publication date, and related articles.
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: HTML blog post page

  /faq:
    get:
      operationId: faqPage
      summary: Frequently asked questions
      description: |
        Comprehensive FAQ covering THC vs THCa differences, legality, dosing guidelines,
        product types, COA interpretation, terpenes, entourage effect, and platform usage.
      responses:
        "200":
          description: HTML FAQ page with categorized Q&A

  /llms.txt:
    get:
      operationId: llmsManifest
      summary: LLM-optimized platform overview
      description: Machine-readable manifest with platform overview, features, and links to detailed data files.
      responses:
        "200":
          description: Plain text manifest
          content:
            text/plain:
              schema:
                type: string

  /llms-full.txt:
    get:
      operationId: llmsFull
      summary: Complete structured data for LLMs
      description: Comprehensive export of all platform data including strains, legal status, FAQs, and tool descriptions.
      responses:
        "200":
          description: Plain text full documentation
          content:
            text/plain:
              schema:
                type: string

  /llms-ctx.txt:
    get:
      operationId: llmsContext
      summary: Context-window-optimized summary
      description: Compact summary designed for LLMs with limited context windows. Contains core facts, tool links, and quick reference tables.
      responses:
        "200":
          description: Plain text compact summary
          content:
            text/plain:
              schema:
                type: string

  /llms-faq.txt:
    get:
      operationId: llmsFaq
      summary: Structured Q&A for LLM extraction
      description: Cannabis FAQ in structured Q&A format optimized for direct AI extraction and citation.
      responses:
        "200":
          description: Plain text Q&A
          content:
            text/plain:
              schema:
                type: string
