Supplement Safety API

Structured, evidence-based supplement-drug interaction intelligence for AI agents and health applications. FDA FAERS signals, CYP450 pathway analysis, and fuzzy compound resolution.

Base URL
https://api.truthstack.co
Auth: X-API-Key header
POST /api/interactions/check

Check Stack Safety

The primary endpoint. Submit a list of supplements and medications, get a structured risk assessment with FDA adverse event signals, CYP450 pathway conflicts, and severity ratings.

Request Body (JSON)

supplements string[] required Supplement names. Handles brands, abbreviations, misspellings.
medications string[] required Medication names (generic or brand).
curl -X POST https://api.truthstack.co/api/interactions/check \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
  -d '{
  "supplements": ["ashwagandha", "fish oil", "magnesium"],
  "medications": ["sertraline"]
}'

Response MODERATE

{
  "risk_level": "MODERATE",
  "resolved_supplements": [
    { "input": "ashwagandha", "compound_id": "ashwagandha" },
    { "input": "fish oil", "compound_id": "omega3" },
    { "input": "magnesium", "compound_id": "magnesium" }
  ],
  "drug_interactions": [{
    "source_name": "ashwagandha",
    "target_name": "sertraline",
    "severity": "MODERATE",
    "interaction_type": "BLEEDING_RISK",
    "mechanism_category": "PHARMACODYNAMIC",
    "recommendation": "Monitor closely. 25 serious adverse events reported...",
    "source_origin": "OPENFDA"
  }],
  "cyp_pathway_conflicts": [],
  "summary": { "total_flags": 1, "critical": 0, "moderate": 1 }
}
GET /api/compounds/search?q={query}&limit={n}

Search Compounds

Fuzzy search across 584 aliases covering 95 compounds. Resolves misspellings ("ashwaganda"), brand names ("KSM-66"), abbreviations ("mag glycinate"), and product forms.

Query Parameters

q string required Search query (min 2 chars)
limit number Max results (default 10, max 25)
curl https://api.truthstack.co/api/compounds/search?q=mag+gly \
  -H "X-API-Key: YOUR_KEY"

# Returns: magnesium (matched via "mag glycinate" alias)
GET /api/compounds/{id}

Get Compound Detail

Full compound profile including category, data JSONB, all known aliases, interaction count, and research finding count.

curl https://api.truthstack.co/api/compounds/ashwagandha \
  -H "X-API-Key: YOUR_KEY"
GET /api/compounds/{id}/interactions

Get Compound Interactions

All known interactions for a compound — FAERS signals, research-based, FDA label warnings. Sorted by severity (CRITICAL first).

curl https://api.truthstack.co/api/compounds/st_johns_wort/interactions \
  -H "X-API-Key: YOUR_KEY"
GET /api/drugs/{id}

Get Drug Profile

Drug pharmacology profile: CYP450 pathways (metabolized_by, inhibits, induces), transporters, mechanism, contraindications, warnings, and known botanical interactions.

curl https://api.truthstack.co/api/drugs/warfarin \
  -H "X-API-Key: YOUR_KEY"

# Returns: CYP pathways, botanical interactions, population guidance
GET /api/stats

Vault Statistics

Current database statistics — compound count, interaction count, alias count, drug profile count.

curl https://api.truthstack.co/api/stats \
  -H "X-API-Key: YOUR_KEY"
GET /api/health

Health Check

Server and database connection status.

curl https://api.truthstack.co/api/health \
  -H "X-API-Key: YOUR_KEY"

# {"status":"ok","db":"connected","uptime":72171}

MCP Server

TruthStack is also available as a Model Context Protocol server for AI agents. Claude Desktop, LangChain, CrewAI, and other MCP-compatible frameworks can discover and use the safety tools automatically.

REST API

Direct HTTPS endpoints. Best for backend services, pipelines, analytics, and any HTTP-capable environment. Simple curl or SDK integration.

MCP Server

Structured tool discovery for AI agents. Best for interactive agents, IDE tools, and MCP-native frameworks. Zero glue code — agents discover tools automatically.

# Claude Desktop config (~/.claude/claude_desktop_config.json)
{
  "mcpServers": {
    "truthstack": {
      "command": "node",
      "args": ["/path/to/truthstack-mcp/server.js"],
      "env": {
        "VAULT_API_URL": "https://api.truthstack.co",
        "VAULT_API_KEY": "your-api-key"
      }
    }
  }
}

GitHub: truthstack-mcp →

Python SDK Example

Quick integration in any Python project.

import requests

API_URL = "https://api.truthstack.co"
API_KEY = "your-api-key"
headers = {"X-API-Key": API_KEY}

# Check if a supplement stack is safe with medications
response = requests.post(
    f"{API_URL}/api/interactions/check",
    headers=headers,
    json={
        "supplements": ["ashwagandha", "fish oil", "magnesium"],
        "medications": ["sertraline"]
    }
)

data = response.json()
print(f"Risk Level: {data['risk_level']}")
print(f"Flags: {data['summary']['total_flags']}")

for interaction in data["drug_interactions"]:
    print(f"  {interaction['source_name']} + {interaction['target_name']}: {interaction['severity']}")
    print(f"  → {interaction['recommendation']}")

# Search for a compound by name (fuzzy)
search = requests.get(
    f"{API_URL}/api/compounds/search",
    headers=headers,
    params={"q": "mag gly"}
)
print(search.json())  # → magnesium

Disclaimer: TruthStack provides informational data for software integration purposes only. It is not medical advice and should not be used as a substitute for professional medical judgment. Interaction data may be incomplete or not reflect the latest research. Developers integrating TruthStack are responsible for appropriate disclaimers in their own applications. Always consult a qualified healthcare provider for medical decisions.