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.
Authorization: Bearer your_api_key_here Content-Type: application/json
Base URL
https://cannavec.ai/api/v1Search Endpoint
/searchRequest
{
"query": "What does the evidence say about CBD for anxiety?",
"namespace": "cannabis",
"top_k": 5,
"include_metadata": true
}Response
{
"results": [
{
"id": "cbd_anxiety_clinical_001",
"score": 0.94,
"metadata": {
"topic": "CBD Anxiolytic Mechanisms",
"finding": "CBD demonstrates anxiolytic effects...",
"evidence_grade": "Level A",
"authority_score": 9,
"clinical_relevance": "Multiple RCTs support doses of 300-600mg...",
"sources": "Zuardi et al. 2017; Blessing et al. 2015"
}
}
],
"meta": {
"response_time_ms": 142,
"namespace": "cannabis"
}
}Namespaces
cannabishundreds of recordsCore cannabis science: mechanisms, clinical evidence, dosing, drug interactions, safety, regulation.
cannabis_productshundreds of recordsUK/EU cannabis products: formulations, terpene profiles, cannabinoid content, consumption methods.
Rate Limits
| Tier | Monthly | Per Minute |
|---|---|---|
| Enterprise | Unlimited | 100 |
| VIP | 10,000 | 30 |
| Free | 5/day | 1 |
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/mcpConnection 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).
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
}
}
}