API Documentation

Everything you need to integrate Cannavec into your platform. RESTful JSON API with semantic search across thousands of verified cannabis records.

Authentication

All requests require a Bearer token in the Authorization header.

headers
Authorization: Bearer your_api_key_here
Content-Type: application/json

Base URL

https://cannavec.ai/api/v1

Namespaces

cannabishundreds of records

Core cannabis science: mechanisms, clinical evidence, dosing, drug interactions, safety, regulation.

cannabis_productshundreds of records

UK/EU cannabis products: formulations, terpene profiles, cannabinoid content, consumption methods.

Rate Limits

TierMonthlyPer Minute
EnterpriseUnlimited100
VIP10,00030
Free5/day1

Quick Start

cURL

curl -X POST https://cannavec.ai/api/v1/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "CBD for anxiety", "namespace": "cannabis", "top_k": 3}'

Python

import requests

resp = requests.post(
    "https://cannavec.ai/api/v1/search",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={"query": "THC:CBD ratios for pain", "namespace": "cannabis", "top_k": 5}
)
for r in resp.json()["results"]:
    print(f"[{r['metadata']['evidence_grade']}] {r['metadata']['topic']}")

JavaScript

const res = await fetch("https://cannavec.ai/api/v1/search", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    query: "Terpene profiles for sleep",
    namespace: "cannabis", top_k: 5
  })
});
const { results } = await res.json();

MCP — Connect to Claude

The Cannavec MCP (Model Context Protocol) endpoint lets you connect the Cannabis Knowledge Base directly to Claude. Once connected, you can query the knowledge base from inside Claude conversations and ask Claude to generate reports, summaries, or presentations from the results.

MCP endpoint URL

https://cannavec.ai/api/mcp

Connection methods

Claude.ai (Custom Connector)

Settings → Connections → Add Custom Connector. Enter the MCP URL above. Claude opens a sign-in window — log in with your Cannavec account via Google. No config files needed.

Claude Desktop (config file)

Add to your claude_desktop_config.json using your API key as a Bearer token. Full instructions in your dashboard.

Claude Code (terminal)

Single command using your API key. Full instructions in your dashboard.

MCP access requires a VIP plan or above. Full setup instructions are in your dashboard.

Protocol

The MCP endpoint follows the JSON-RPC 2.0 protocol. It supports initialize, tools/list, and tools/call methods. Authentication is via Bearer token (your API key or an OAuth-issued token).

tools/call — search_cannabis_kb
POST https://cannavec.ai/api/mcp
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "search_cannabis_kb",
    "arguments": {
      "query": "CBD for anxiety",
      "top_k": 5
    }
  }
}