Agent skill

Ddinter Database

by jaechang-hits in jaechang-hits/SciAgent-Skills

Query DDInter drug-drug interactions via REST API (1.7M+ interactions, 2,400+ drugs).

CC-BY-4.0Auto-check passedResearch & Science

Install Ddinter Database

skills CLI
$ npx skills add jaechang-hits/SciAgent-Skills --skill ddinter-database -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jaechang-hits/SciAgent-Skills ddinter-database --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jaechang-hits/SciAgent-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/structural-biology-drug-discovery/ddinter-database .claude/skills/ddinter-database && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ddinter-database
GitHub stars
370
Used in
1 other repo
Token cost
~7.3k tokens
SKILL.md length
1,123 words
Files
1
Skills in repo
163
Repo updated
First seen
Licence
CC-BY-4.0

At a glance

Query DDInter drug-drug interactions via REST API (1.7M+ interactions, 2,400+ drugs).

  • Works in 6 steps: Always resolve drug names to DDInter IDs… → Handle pagination for complete… → Use check_pair() for targeted queries,… → …
  • Tasks that involve REST APIs
  • SKILL.md covers Overview, When to Use, Prerequisites and Quick Start, plus 9 more sections
  • Calls pip; reaches ddinter.scbdd.com

What it does

Ddinter Database is an agent skill from jaechang-hits/SciAgent-Skills. Query DDInter drug-drug interactions via REST API (1.7M+ interactions, 2,400+ drugs). Search by drug name/ID for severity (major/moderate/minor), mechanisms, and clinical recommendations. No auth. For FDA labeling use dailymed-database; for pharmacogenomics use clinpgx-database.

Its SKILL.md is about 7.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Research & Science, covering REST APIs, Drug discovery and cheminformatics and Protein structure and design. The repository describes itself as: 197 bioinformatics & life science skills for Claude Code and AI agents — BixBench 92.0% accuracy. RNA-seq, single-cell, drug discovery, proteomics, and more. Powers OmicsHorizon. The licence is CC-BY-4.0.

When your agent uses it

  • Tasks that involve REST APIs
  • Tasks that involve Drug discovery and cheminformatics
  • Tasks that involve Protein structure and design

Example prompts

  • “/ddinter-database”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Always resolve drug names to DDInter IDs first: The API does not accept free-text drug names in interaction queries. Use /drug/?drug_name=…
  2. Handle pagination for complete interaction lists: The default page returns at most 10 results. Drugs like warfarin or amiodarone have…
  3. Use check_pair() for targeted queries, get_interactions() for full profiles: The /between/ endpoint is faster when you need one pair. The…
  4. Add time.sleep(0.3) in batch loops: DDInter has no published rate limits, but polite delays prevent server-side throttling on this…
  5. Filter by severity client-side: The API does not support server-side severity filtering on the /interaction/ endpoint. Retrieve all…
  6. Cross-reference with clinical databases for decision support: DDInter provides evidence-based interaction records, but for clinical…

What it can do on your machine

Read from SKILL.md and the folder at commit 82c862c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • ddinter.scbdd.com

    Also links to:

    • doi.org
    • who.int

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Ddinter Database loads about 7.3k tokens when it runs. Until then it costs about 74 tokens; SKILL.md has 1,123 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~74
When it runs · the whole SKILL.md, loaded when a task matches
~7.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jaechang-hits/SciAgent-Skills at commit 82c862c, republished under its CC-BY-4.0 licence (© jaechang-hits). 1,123 words, ~7,325 tokens.

Download SKILL.mdSave it as .claude/skills/ddinter-database/SKILL.md (or your agent's skills folder).
name
ddinter-database
description
Query DDInter drug-drug interactions via REST API (1.7M+ interactions, 2,400+ drugs). Search by drug name/ID for severity (major/moderate/minor), mechanisms, and clinical recommendations. No auth. For FDA labeling use dailymed-database; for pharmacogenomics use clinpgx-database.
license
CC-BY-4.0

DDInter Drug-Drug Interaction Database

Overview

DDInter is an open, curated database of drug-drug interactions (DDIs) covering 2,400+ drugs and 1.7M+ pairwise interactions with structured severity levels (major, moderate, minor), mechanistic annotations, and clinical management recommendations. Access is provided via a JSON REST API at https://ddinter.scbdd.com/api/ — no authentication or registration required.

When to Use

  • Checking whether two co-administered drugs have a known interaction and its severity (major/moderate/minor)
  • Retrieving all known interactions for a given drug to support polypharmacy risk assessment
  • Identifying the mechanistic basis (pharmacokinetic vs. pharmacodynamic) of a drug-drug interaction
  • Screening a drug combination list for potential major interactions before clinical decision support
  • Building automated DDI checking pipelines for medication review or drug repurposing workflows
  • Analyzing the DDI network for a drug class (e.g., all major interactions for CYP3A4 substrates)
  • For FDA-approved drug labeling text (indications, dosage, contraindications) use dailymed-database
  • For pharmacogenomics interactions (CYP genotype-drug associations) use clinpgx-database; DDInter covers drug-drug not gene-drug pairs
  • For drug adverse event reports from FAERS use fda-database

Prerequisites

  • Python packages: requests, pandas, matplotlib, networkx
  • Data requirements: drug names or DDInter drug IDs
  • Environment: internet connection; no API key required
  • Rate limits: no officially published rate limit; use time.sleep(0.3) between requests in batch loops for polite access
bash
pip install requests pandas matplotlib networkx

Quick Start

python
import requests

BASE = "https://ddinter.scbdd.com/api"

# Search for a drug by name
r = requests.get(f"{BASE}/drug/", params={"drug_name": "warfarin", "format": "json"}, timeout=15)
r.raise_for_status()
data = r.json()
print(f"Results for 'warfarin': {data['count']} drugs found")
for drug in data["results"][:3]:
    print(f"  ID={drug['ddinter_id']}  Name={drug['drug_name']}")
# Results for 'warfarin': 1 drugs found
#   ID=DDInter_D00001  Name=Warfarin

Core API

Query 1: Search Drug by Name

Find a drug's DDInter ID by searching its name. The DDInter ID is required for all interaction queries.

python
import requests
import pandas as pd

BASE = "https://ddinter.scbdd.com/api"

def search_drug(drug_name):
    """Search DDInter for a drug by name. Returns list of matching drug records."""
    r = requests.get(f"{BASE}/drug/",
                     params={"drug_name": drug_name, "format": "json"},
                     timeout=15)
    r.raise_for_status()
    return r.json()

# Search for warfarin
result = search_drug("warfarin")
print(f"Matches: {result['count']}")
if result["results"]:
    drug = result["results"][0]
    print(f"DDInter ID: {drug['ddinter_id']}")
    print(f"Drug name: {drug['drug_name']}")
    # Store DDInter ID for interaction queries
    warfarin_id = drug["ddinter_id"]
    print(f"\nWarfarin DDInter ID: {warfarin_id}")

# Batch name lookup
drugs_to_find = ["warfarin", "aspirin", "atorvastatin", "metformin", "amiodarone"]
id_map = {}
for name in drugs_to_find:
    res = search_drug(name)
    if res["results"]:
        id_map[name] = res["results"][0]["ddinter_id"]
        print(f"  {name:20s} → {res['results'][0]['ddinter_id']}")
Query 2: Get All Interactions for a Drug

Retrieve all known DDIs for a drug by its DDInter ID. Returns interaction partners, severity, and clinical information.

python
import requests
import pandas as pd

BASE = "https://ddinter.scbdd.com/api"

def get_drug_interactions(drug_id, page_size=100):
    """Get all DDIs for a drug by DDInter ID. Handles pagination automatically."""
    all_interactions = []
    url = f"{BASE}/interaction/"
    params = {"drug_id": drug_id, "format": "json", "page_size": page_size}

    while url:
        r = requests.get(url, params=params, timeout=20)
        r.raise_for_status()
        data = r.json()
        all_interactions.extend(data.get("results", []))
        url = data.get("next")   # None when last page
        params = {}              # next URL already includes params

    return all_interactions

# Get all interactions for warfarin (DDInter_D00001)
interactions = get_drug_interactions("DDInter_D00001")
print(f"Warfarin total interactions: {len(interactions)}")

# Summarize by severity
df = pd.DataFrame(interactions)
if not df.empty and "level" in df.columns:
    severity_counts = df["level"].value_counts()
    print("\nInteractions by severity:")
    for level, count in severity_counts.items():
        print(f"  {level:15s}: {count:4d}")
    # Major: 45
    # Moderate: 312
    # Minor: 198
Query 3: Get Interaction Details by Interaction ID

Retrieve full details for a specific drug-drug interaction, including mechanism and clinical recommendation.

python
import requests

BASE = "https://ddinter.scbdd.com/api"

def get_interaction_detail(interaction_id):
    """Get full details for a specific interaction by its DDInter interaction ID."""
    r = requests.get(f"{BASE}/interaction/{interaction_id}/",
                     params={"format": "json"},
                     timeout=15)
    r.raise_for_status()
    return r.json()

# Example interaction ID (format: DDInter_I_XXXXXX)
interaction_id = "DDInter_I_000001"   # example
try:
    detail = get_interaction_detail(interaction_id)
    print(f"Interaction: {detail.get('interaction_id')}")
    print(f"Drug A: {detail.get('drug_a')}")
    print(f"Drug B: {detail.get('drug_b')}")
    print(f"Severity: {detail.get('level')}")
    print(f"Mechanism: {detail.get('mechanism', 'Not specified')[:200]}")
    print(f"Recommendation: {detail.get('recommendation', 'Not specified')[:200]}")
    print(f"PK type: {detail.get('pharmacokinetic_type', 'N/A')}")
    print(f"PD type: {detail.get('pharmacodynamic_type', 'N/A')}")
except Exception as e:
    print(f"Note: Use a valid interaction ID from get_drug_interactions() results. Error: {e}")
Query 4: Check Interaction Between Two Specific Drugs

Query interactions between exactly two drugs using their DDInter IDs.

python
import requests

BASE = "https://ddinter.scbdd.com/api"

def check_drug_pair(drug_id_1, drug_id_2):
    """Check interactions between two specific drugs by their DDInter IDs."""
    r = requests.get(f"{BASE}/between/",
                     params={"drug1": drug_id_1, "drug2": drug_id_2, "format": "json"},
                     timeout=15)
    r.raise_for_status()
    return r.json()

def find_drug_id(drug_name):
    """Helper: resolve drug name to DDInter ID."""
    r = requests.get(f"{BASE}/drug/",
                     params={"drug_name": drug_name, "format": "json"},
                     timeout=15)
    r.raise_for_status()
    results = r.json()["results"]
    return results[0]["ddinter_id"] if results else None

# Check warfarin + aspirin interaction
warfarin_id = find_drug_id("warfarin")
aspirin_id = find_drug_id("aspirin")

if warfarin_id and aspirin_id:
    interactions = check_drug_pair(warfarin_id, aspirin_id)
    count = interactions.get("count", 0)
    print(f"Warfarin + Aspirin: {count} interaction(s) found")
    for ix in interactions.get("results", []):
        print(f"  Severity: {ix.get('level')}")
        print(f"  Mechanism: {ix.get('mechanism', 'N/A')[:200]}")
        print(f"  Recommendation: {ix.get('recommendation', 'N/A')[:200]}")
else:
    print(f"Could not resolve drug IDs: warfarin={warfarin_id}, aspirin={aspirin_id}")
Query 5: Filter Interactions by Severity Level

Retrieve only high-severity (major) interactions for a drug — essential for rapid clinical risk screening.

python
import requests
import pandas as pd

BASE = "https://ddinter.scbdd.com/api"

def get_major_interactions(drug_id):
    """Get only major-severity interactions for a drug."""
    all_interactions = []
    r = requests.get(f"{BASE}/interaction/",
                     params={"drug_id": drug_id, "format": "json", "page_size": 200},
                     timeout=20)
    r.raise_for_status()
    data = r.json()
    all_interactions.extend(data.get("results", []))

    # Filter to major severity
    major = [ix for ix in all_interactions
             if ix.get("level", "").lower() == "major"]
    return major

# Get major interactions for amiodarone (known high-interaction drug)
drug_id = "DDInter_D00023"   # example amiodarone ID; resolve with search_drug()
major_ixs = get_major_interactions(drug_id)
print(f"Major interactions: {len(major_ixs)}")

if major_ixs:
    df = pd.DataFrame(major_ixs)
    # Show drug partners and mechanism type
    for col in ["drug_a", "drug_b", "level", "pharmacokinetic_type"]:
        if col in df.columns:
            print(f"  {col}: {df[col].value_counts().head(3).to_dict()}")
    df.to_csv("amiodarone_major_interactions.csv", index=False)
    print("Saved: amiodarone_major_interactions.csv")
Query 6: Polypharmacy Screening for a Drug List

Screen a medication list for all pairwise major and moderate interactions.

python
import requests
import time
import itertools
import pandas as pd

BASE = "https://ddinter.scbdd.com/api"

def find_drug_id(drug_name):
    r = requests.get(f"{BASE}/drug/",
                     params={"drug_name": drug_name, "format": "json"},
                     timeout=15)
    r.raise_for_status()
    results = r.json()["results"]
    return (results[0]["ddinter_id"], results[0]["drug_name"]) if results else (None, None)

def check_pair(id1, id2):
    r = requests.get(f"{BASE}/between/",
                     params={"drug1": id1, "drug2": id2, "format": "json"},
                     timeout=15)
    r.raise_for_status()
    return r.json().get("results", [])

# Medication list to screen
medication_names = ["warfarin", "aspirin", "atorvastatin", "metformin", "amiodarone"]

# Resolve to DDInter IDs
id_map = {}
for name in medication_names:
    ddid, resolved_name = find_drug_id(name)
    if ddid:
        id_map[name] = (ddid, resolved_name)
        print(f"  {name:20s} → {ddid}")
    time.sleep(0.3)

# Check all pairs
flagged = []
for (n1, (id1, rn1)), (n2, (id2, rn2)) in itertools.combinations(id_map.items(), 2):
    ixs = check_pair(id1, id2)
    for ix in ixs:
        level = ix.get("level", "unknown")
        if level.lower() in ("major", "moderate"):
            flagged.append({
                "drug_1": rn1,
                "drug_2": rn2,
                "severity": level,
                "mechanism": ix.get("mechanism", "")[:100],
            })
    time.sleep(0.3)

df = pd.DataFrame(flagged)
print(f"\nFlagged interactions: {len(df)}")
if not df.empty:
    print(df.to_string(index=False))
    df.to_csv("polypharmacy_screening.csv", index=False)
    print("Saved: polypharmacy_screening.csv")
Query 7: Visualize Interaction Network

Build and visualize a drug-drug interaction network for a set of drugs, with edges colored by severity.

python
import requests
import time
import itertools
import pandas as pd
import networkx as nx
import matplotlib.pyplot as plt

BASE = "https://ddinter.scbdd.com/api"

def find_drug_id(drug_name):
    r = requests.get(f"{BASE}/drug/",
                     params={"drug_name": drug_name, "format": "json"},
                     timeout=15)
    r.raise_for_status()
    results = r.json()["results"]
    return (results[0]["ddinter_id"], results[0]["drug_name"]) if results else (None, None)

def check_pair(id1, id2):
    r = requests.get(f"{BASE}/between/",
                     params={"drug1": id1, "drug2": id2, "format": "json"},
                     timeout=15)
    r.raise_for_status()
    return r.json().get("results", [])

SEVERITY_COLORS = {"major": "#D32F2F", "moderate": "#F57C00", "minor": "#388E3C"}

# Drug list
drugs = ["warfarin", "aspirin", "atorvastatin", "fluconazole", "amiodarone"]
id_map = {}
for name in drugs:
    ddid, rname = find_drug_id(name)
    if ddid:
        id_map[name] = (ddid, rname)
    time.sleep(0.3)

# Build network
G = nx.Graph()
for name, (ddid, rname) in id_map.items():
    G.add_node(rname)

edge_colors = []
for (n1, (id1, rn1)), (n2, (id2, rn2)) in itertools.combinations(id_map.items(), 2):
    ixs = check_pair(id1, id2)
    for ix in ixs:
        level = ix.get("level", "minor").lower()
        G.add_edge(rn1, rn2, severity=level, weight=3 if level == "major" else 1)
    time.sleep(0.3)

# Visualize
fig, ax = plt.subplots(figsize=(9, 7))
pos = nx.spring_layout(G, seed=42, k=2)

for level, color in SEVERITY_COLORS.items():
    edges = [(u, v) for u, v, d in G.edges(data=True) if d.get("severity") == level]
    if edges:
        width = 4 if level == "major" else 2
        nx.draw_networkx_edges(G, pos, edgelist=edges, edge_color=color, width=width, alpha=0.8, ax=ax)

nx.draw_networkx_nodes(G, pos, node_color="#1565C0", node_size=1200, alpha=0.9, ax=ax)
nx.draw_networkx_labels(G, pos, font_color="white", font_size=8, font_weight="bold", ax=ax)

# Legend
from matplotlib.patches import Patch
legend = [Patch(color=c, label=l.capitalize()) for l, c in SEVERITY_COLORS.items()]
ax.legend(handles=legend, title="Severity", loc="upper right")
ax.set_title("Drug-Drug Interaction Network\n(DDInter)")
ax.axis("off")
plt.tight_layout()
plt.savefig("ddi_network.png", dpi=150, bbox_inches="tight")
print(f"Saved: ddi_network.png  ({G.number_of_nodes()} drugs, {G.number_of_edges()} interactions)")

Key Concepts

Severity Classification

DDInter classifies interactions into three severity levels, following established clinical pharmacology standards:

SeverityCodeClinical MeaningAction
MajormajorPotentially life-threatening or causing permanent damageAvoid combination; use alternative
ModeratemoderateMay cause clinical deterioration; increased monitoring requiredUse with caution; monitor closely
MinorminorLimited clinical effects; interaction is documented but rarely significantGenerally safe; monitor if symptomatic
Mechanism Types

Interactions are classified by mechanism:

  • Pharmacokinetic (PK): One drug affects the absorption, distribution, metabolism, or excretion (ADME) of the other (e.g., CYP enzyme inhibition)
  • Pharmacodynamic (PD): Drugs have additive, synergistic, or antagonistic effects at the pharmacological target level (e.g., additive bleeding risk)
  • Mixed: Both PK and PD mechanisms contribute
Drug Identification

DDInter uses its own sequential identifier scheme (e.g., DDInter_D00001 for Warfarin). There is no direct mapping to ChEMBL IDs, PubChem CIDs, or RxCUI without a prior name search. Always resolve drug names to DDInter IDs using the /drug/ endpoint before querying interactions.

Common Workflows

Workflow 1: Comprehensive DDI Profile for a Drug

Goal: Retrieve all interactions for a drug, stratify by severity, and export a structured report.

python
import requests
import time
import pandas as pd

BASE = "https://ddinter.scbdd.com/api"

def find_drug_id(name):
    r = requests.get(f"{BASE}/drug/",
                     params={"drug_name": name, "format": "json"},
                     timeout=15)
    r.raise_for_status()
    res = r.json()["results"]
    return (res[0]["ddinter_id"], res[0]["drug_name"]) if res else (None, None)

def get_all_interactions(drug_id, page_size=200):
    all_results = []
    url = f"{BASE}/interaction/"
    params = {"drug_id": drug_id, "format": "json", "page_size": page_size}
    while url:
        r = requests.get(url, params=params, timeout=30)
        r.raise_for_status()
        data = r.json()
        all_results.extend(data.get("results", []))
        url = data.get("next")
        params = {}
    return all_results

# Build DDI profile for clopidogrel
drug_name = "clopidogrel"
drug_id, resolved_name = find_drug_id(drug_name)

if drug_id:
    print(f"Drug: {resolved_name} ({drug_id})")
    ixs = get_all_interactions(drug_id)
    df = pd.DataFrame(ixs)

    print(f"Total interactions: {len(df)}")
    if "level" in df.columns:
        print("\nSeverity breakdown:")
        for level, grp in df.groupby("level"):
            print(f"  {level:15s}: {len(grp):4d} interactions")

        # Major interactions table
        major = df[df["level"].str.lower() == "major"].copy()
        print(f"\nMajor interactions ({len(major)}):")
        for _, row in major.head(10).iterrows():
            partner = row.get("drug_b") if row.get("drug_a") == resolved_name else row.get("drug_a")
            mech = str(row.get("mechanism", ""))[:80]
            print(f"  + {partner}: {mech}")

    df.to_csv(f"{drug_name}_ddi_profile.csv", index=False)
    print(f"\nSaved: {drug_name}_ddi_profile.csv")
Workflow 2: Pairwise Interaction Matrix for a Drug Panel

Goal: Build a severity matrix showing all pairwise interactions between a curated drug panel — useful for clinical pharmacology and formulary review.

python
import requests
import time
import itertools
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

BASE = "https://ddinter.scbdd.com/api"

SEVERITY_SCORE = {"major": 3, "moderate": 2, "minor": 1, "none": 0}

def find_drug_id(name):
    r = requests.get(f"{BASE}/drug/",
                     params={"drug_name": name, "format": "json"},
                     timeout=15)
    r.raise_for_status()
    res = r.json()["results"]
    return (res[0]["ddinter_id"], res[0]["drug_name"]) if res else (None, None)

def check_pair(id1, id2):
    r = requests.get(f"{BASE}/between/",
                     params={"drug1": id1, "drug2": id2, "format": "json"},
                     timeout=15)
    r.raise_for_status()
    return r.json().get("results", [])

# Drug panel
drug_names = ["warfarin", "aspirin", "atorvastatin", "fluconazole", "metformin"]
id_map = {}
for name in drug_names:
    ddid, rname = find_drug_id(name)
    if ddid:
        id_map[name] = (ddid, rname)
    time.sleep(0.3)

resolved = {name: rname for name, (ddid, rname) in id_map.items()}
n = len(id_map)
names = list(id_map.keys())
rnames = [resolved[n] for n in names]

# Build matrix
matrix = np.zeros((n, n), dtype=int)
for i, (n1, (id1, _)) in enumerate(id_map.items()):
    for j, (n2, (id2, _)) in enumerate(id_map.items()):
        if i < j:
            ixs = check_pair(id1, id2)
            if ixs:
                worst = max(SEVERITY_SCORE.get(ix.get("level", "none").lower(), 0) for ix in ixs)
                matrix[i, j] = matrix[j, i] = worst
            time.sleep(0.3)

# Heatmap
fig, ax = plt.subplots(figsize=(7, 6))
im = ax.imshow(matrix, cmap="RdYlGn_r", vmin=0, vmax=3)
ax.set_xticks(range(n))
ax.set_yticks(range(n))
ax.set_xticklabels(rnames, rotation=30, ha="right", fontsize=9)
ax.set_yticklabels(rnames, fontsize=9)
for i in range(n):
    for j in range(n):
        text = ["None", "Minor", "Mod", "Major"][matrix[i, j]]
        ax.text(j, i, text, ha="center", va="center", fontsize=7)
plt.colorbar(im, ax=ax, label="Severity (0=None, 3=Major)")
ax.set_title("Drug-Drug Interaction Severity Matrix\n(DDInter)")
plt.tight_layout()
plt.savefig("ddi_severity_matrix.png", dpi=150, bbox_inches="tight")
print("Saved: ddi_severity_matrix.png")

Key Parameters

ParameterEndpointDefaultRange / OptionsEffect
drug_name/drug/—any drug name stringSearch term for drug name lookup
drug_id/interaction/—DDInter_DXXXXX stringDDInter drug ID for interaction queries
drug1, drug2/between/—DDInter_DXXXXX stringsBoth required to check a specific drug pair
formatall endpointsjsonjsonResponse format; JSON only via API
page_size/interaction/, /drug/10positive integerResults per page; use 200 for bulk retrieval
levelresponse field—major, moderate, minorInteraction severity; filter client-side
pharmacokinetic_typeresponse field—PK, PD, mixedMechanism category
Show full SKILL.md (488 more words)Show less

Best Practices

  1. Always resolve drug names to DDInter IDs first: The API does not accept free-text drug names in interaction queries. Use /drug/?drug_name= to obtain the ddinter_id, then pass it to /interaction/ or /between/.

  2. Handle pagination for complete interaction lists: The default page returns at most 10 results. Drugs like warfarin or amiodarone have hundreds of interactions — iterate next URLs until null:

    python
    while url:
        data = requests.get(url, params=params).json()
        results.extend(data["results"])
        url = data.get("next")
        params = {}   # clear params after first request
  3. Use check_pair() for targeted queries, get_interactions() for full profiles: The /between/ endpoint is faster when you need one pair. The /interaction/ endpoint is needed for comprehensive DDI profiling.

  4. Add time.sleep(0.3) in batch loops: DDInter has no published rate limits, but polite delays prevent server-side throttling on this publicly hosted research database.

  5. Filter by severity client-side: The API does not support server-side severity filtering on the /interaction/ endpoint. Retrieve all interactions and filter in pandas:

    python
    df = pd.DataFrame(interactions)
    major_only = df[df["level"].str.lower() == "major"]
  6. Cross-reference with clinical databases for decision support: DDInter provides evidence-based interaction records, but for clinical decisions always verify against current prescribing information in dailymed-database and institutional drug interaction tools.

Common Recipes

Recipe: Quick Safety Check for a Drug Pair

When to use: Rapid single-pair interaction lookup before combining two drugs.

python
import requests

BASE = "https://ddinter.scbdd.com/api"

def quick_check(drug1_name, drug2_name):
    """Check interaction between two drugs by name. Returns severity or 'No interaction found'."""
    def get_id(name):
        r = requests.get(f"{BASE}/drug/",
                         params={"drug_name": name, "format": "json"},
                         timeout=15)
        r.raise_for_status()
        results = r.json()["results"]
        return (results[0]["ddinter_id"], results[0]["drug_name"]) if results else (None, name)

    id1, rn1 = get_id(drug1_name)
    id2, rn2 = get_id(drug2_name)

    if not id1 or not id2:
        return f"Drug not found: {drug1_name if not id1 else drug2_name}"

    r = requests.get(f"{BASE}/between/",
                     params={"drug1": id1, "drug2": id2, "format": "json"},
                     timeout=15)
    r.raise_for_status()
    ixs = r.json().get("results", [])

    if not ixs:
        return f"{rn1} + {rn2}: No interaction found in DDInter"

    worst = max(ixs, key=lambda x: {"major": 3, "moderate": 2, "minor": 1}.get(x.get("level", "minor").lower(), 0))
    return f"{rn1} + {rn2}: {worst.get('level', 'unknown').upper()} — {worst.get('mechanism', 'N/A')[:120]}"

print(quick_check("warfarin", "aspirin"))
print(quick_check("metformin", "atorvastatin"))
print(quick_check("warfarin", "fluconazole"))
Recipe: Count Interactions by Severity for Multiple Drugs

When to use: Generate a summary table comparing DDI burden across multiple drugs.

python
import requests
import time
import pandas as pd

BASE = "https://ddinter.scbdd.com/api"

def get_severity_summary(drug_name):
    """Return severity counts (major/moderate/minor) for a drug."""
    r = requests.get(f"{BASE}/drug/",
                     params={"drug_name": drug_name, "format": "json"},
                     timeout=15)
    r.raise_for_status()
    results = r.json()["results"]
    if not results:
        return None
    drug_id = results[0]["ddinter_id"]

    # Get all interactions
    all_ixs = []
    url = f"{BASE}/interaction/"
    params = {"drug_id": drug_id, "format": "json", "page_size": 200}
    while url:
        r2 = requests.get(url, params=params, timeout=20)
        r2.raise_for_status()
        data = r2.json()
        all_ixs.extend(data.get("results", []))
        url = data.get("next")
        params = {}

    from collections import Counter
    counts = Counter(ix.get("level", "unknown").lower() for ix in all_ixs)
    return {
        "drug": results[0]["drug_name"],
        "total": len(all_ixs),
        "major": counts.get("major", 0),
        "moderate": counts.get("moderate", 0),
        "minor": counts.get("minor", 0),
    }

drugs = ["warfarin", "amiodarone", "metformin", "atorvastatin"]
records = []
for name in drugs:
    summary = get_severity_summary(name)
    if summary:
        records.append(summary)
        print(f"  {name:20s} total={summary['total']:4d}  major={summary['major']:3d}  mod={summary['moderate']:3d}  minor={summary['minor']:3d}")
    time.sleep(0.5)

df = pd.DataFrame(records)
df = df.sort_values("major", ascending=False)
df.to_csv("ddi_severity_summary.csv", index=False)
print(f"\nSaved: ddi_severity_summary.csv")
Recipe: Export All Major Interactions Across a Drug List

When to use: Build a prioritized interaction alert list for formulary review or clinical decision support.

python
import requests
import time
import pandas as pd

BASE = "https://ddinter.scbdd.com/api"

drug_list = ["warfarin", "aspirin", "clopidogrel", "amiodarone", "fluconazole"]
all_major = []

for drug_name in drug_list:
    r = requests.get(f"{BASE}/drug/",
                     params={"drug_name": drug_name, "format": "json"}, timeout=15)
    r.raise_for_status()
    res = r.json()["results"]
    if not res:
        continue
    drug_id, resolved = res[0]["ddinter_id"], res[0]["drug_name"]

    r2 = requests.get(f"{BASE}/interaction/",
                      params={"drug_id": drug_id, "format": "json", "page_size": 200}, timeout=30)
    r2.raise_for_status()
    for ix in r2.json().get("results", []):
        if ix.get("level", "").lower() == "major":
            all_major.append({
                "query_drug": resolved,
                "interaction_partner": ix.get("drug_a") if ix.get("drug_b") == resolved else ix.get("drug_b"),
                "severity": "major",
                "mechanism": str(ix.get("mechanism", ""))[:200],
                "recommendation": str(ix.get("recommendation", ""))[:200],
            })
    time.sleep(0.5)

df = pd.DataFrame(all_major).drop_duplicates()
print(f"Total major interactions across {len(drug_list)} drugs: {len(df)}")
df.to_csv("major_interactions_alert_list.csv", index=False)
print("Saved: major_interactions_alert_list.csv")

Troubleshooting

ProblemCauseSolution
404 Not Found on /interaction/Invalid or malformed DDInter drug IDRe-query /drug/?drug_name= to get a valid ID; format must be DDInter_DXXXXX
count: 0 from /drug/ searchDrug name not matching DDInter nomenclatureTry INN name (e.g., "acetylsalicylic acid" not "aspirin"); try partial name
Interaction list is incompleteDefault page_size=10 truncates resultsSet page_size=200 and iterate next URLs until null
/between/ returns empty resultsDrug pair has no curated interaction in DDInterAbsence does not mean no interaction — check dailymed-database label text
ConnectionError or timeoutServer temporarily unavailableRetry with timeout=30; use exponential backoff for bulk requests
Duplicate interactions in bulk exportSame interaction appears from both drug perspectivesDeduplicate by (drug_a, drug_b) pair after sorting drug IDs alphabetically
JSONDecodeErrorServer returned non-JSON error pageCheck HTTP status code; r.raise_for_status() before parsing
  • dailymed-database — FDA-approved drug label text including drug interaction sections (unstructured)
  • fda-database — openFDA for adverse event reports and drug recall data
  • drugbank-database-access — DrugBank local XML with structured DDI and target data
  • clinpgx-database — PharmGKB for drug-gene (pharmacogenomics) interaction data
  • pytdc-therapeutics-data-commons — TDC DDI benchmark datasets for ML model training

References

© jaechang-hits, CC-BY-4.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/structural-biology-drug-discovery/ddinter-database of jaechang-hits/SciAgent-Skills.

Open the folder on GitHubat commit 82c862c

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in jaechang-hits/SciAgent-Skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Ddinter Database next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Ddinter Database compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ddinter Database this skilljaechang-hits/SciAgent-Skills3701 repos~7.3kAutomated safety check: PassCC-BY-4.0
Pubchem Databasedavila7/claude-code-templates32k12 repos~4.1kAutomated safety check: PassMIT
DiffDock Molecular DockingK-Dense-AI/scientific-agent-skills48k1 repos~3kAutomated safety check: NotesMIT
Biopipelineslocbp-uzh/biopipelines109—~2.4kAutomated safety check: PassMIT
Tooluniverseynulihao/AgentSkillOS6173 repos~2.5kAutomated safety check: PassNone
Pdb Databasedavila7/claude-code-templates32k9 repos~2.3kAutomated safety check: PassMIT

Similar skills

  • Pubchem Database

    davila7/claude-code-templates

    Query PubChem via PUG-REST API/PubChemPy (110M+ compounds). An agent skill from davila7/claude-code-templates.

    32k GitHub starsUsed in 12 repos~4.1k tokens
    Research & ScienceAuto-check passed
  • DiffDock Molecular Docking

    K-Dense-AI/scientific-agent-skills

    Predicts how small molecules bind to a protein with DiffDock, covering batch docking, pose ranking by confidence and checks on the results; not for binding affinity.

    48k GitHub starsUsed in 1 repo~3k tokens
    Research & ScienceAuto-check: notes
  • Biopipelines

    locbp-uzh/biopipelines

    Design and run computational protein and ligand workflows on a GPU: binder and enzyme design, de novo backbone generation, inverse folding and sequence redesign, structure prediction, protein-ligand…

    109 GitHub stars~2.4k tokensUpdated 8 days ago
    Research & ScienceAuto-check passed
  • Tooluniverse

    ynulihao/AgentSkillOS

    A skill your agent uses when working with scientific research tools and workflows across bioinformatics, cheminformatics, genomics, structural biology, proteomics, and drug discovery.

    617 GitHub starsUsed in 3 repos~2.5k tokens
    Research & ScienceAuto-check passed
  • Pdb Database

    davila7/claude-code-templates

    Access RCSB PDB for 3D protein/nucleic acid structures. An agent skill from davila7/claude-code-templates.

    32k GitHub starsUsed in 9 repos~2.3k tokens
    Research & ScienceAuto-check passed
  • Chai1

    JimLiu/science-skills

    Structure prediction for protein, nucleic-acid, and small-molecule complexes with the Chai-1 foundation model (Chai Discovery 2024, github.com/chaidiscovery/chai-lab).

    227 GitHub starsUsed in 4 repos~1.2k tokens
    Research & ScienceAuto-check passed

More from jaechang-hits/SciAgent-Skills

All 163 skills in this repo
  • Molecular Visualization 3dmol

    jaechang-hits/SciAgent-Skills

    3Dmol.js WebGL molecular visualization emitted as self-contained HTML.

    370 GitHub stars~3.2k tokensUpdated 9 days ago
    Auto-check passed
  • Cobrapy Metabolic Modeling

    jaechang-hits/SciAgent-Skills

    Constraint-based (COBRA) analysis of genome-scale metabolic models: FBA, FVA, knockouts, flux sampling, production envelopes, gapfilling, media optimization.

    370 GitHub starsUsed in 1 repo~4.9k tokens
    Auto-check passed
  • Rdkit Chemdraw Cdxml

    jaechang-hits/SciAgent-Skills

    Read, write, and edit ChemDraw CDX/CDXML files with RDKit's rdkit.Chem.rdChemDraw plus direct XML editing, always paired with a rendered PNG.

    370 GitHub stars~6.9k tokensUpdated 9 days ago
    Auto-check passed
  • Pubmed Database

    jaechang-hits/SciAgent-Skills

    Programmatic PubMed access via NCBI E-utilities REST API. An agent skill from jaechang-hits/SciAgent-Skills.

    370 GitHub starsUsed in 1 repo~4.4k tokens
    Auto-check passed
  • Sciagent Skill Creator

    jaechang-hits/SciAgent-Skills

    Scaffold a new SciAgent-Skills entry. An agent skill from jaechang-hits/SciAgent-Skills.

    370 GitHub stars~2.3k tokensUpdated 9 days ago
    Auto-check passed
  • Anndata Data Structure

    jaechang-hits/SciAgent-Skills

    Annotated matrices for single-cell genomics. An agent skill from jaechang-hits/SciAgent-Skills.

    370 GitHub starsUsed in 2 repos~5.8k tokens
    Auto-check passed

Questions about Ddinter Database

What does Ddinter Database do?

Query DDInter drug-drug interactions via REST API (1.7M+ interactions, 2,400+ drugs). Ddinter Database is an agent skill from jaechang-hits/SciAgent-Skills.7M+ interactions, 2,400+ drugs).

When should I use Ddinter Database?

Ddinter Database fits situations like: tasks that involve REST APIs; tasks that involve Drug discovery and cheminformatics; tasks that involve Protein structure and design.

How do I install Ddinter Database in Claude Code?

Run `npx skills add jaechang-hits/SciAgent-Skills --skill ddinter-database -a claude-code`. Or copy the skill folder (skills/structural-biology-drug-discovery/ddinter-database in jaechang-hits/SciAgent-Skills) into .claude/skills/ddinter-database in your project. Claude Code loads it when a task matches its description.

How do I install Ddinter Database in Codex?

Run `npx skills add jaechang-hits/SciAgent-Skills --skill ddinter-database -a codex`. Or copy the skill folder (skills/structural-biology-drug-discovery/ddinter-database in jaechang-hits/SciAgent-Skills) into .agents/skills/ddinter-database in your project. Codex loads it when a task matches its description.

Can I use Ddinter Database in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jaechang-hits/SciAgent-Skills --skill ddinter-database -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ddinter-database, .gemini/skills/ddinter-database, .github/skills/ddinter-database and .opencode/skills/ddinter-database in your project.

What does Ddinter Database need to run?

Going by SKILL.md and its folder, Ddinter Database needs the command-line tools its instructions call (pip). Our summary lists: Python 3.

Does Ddinter Database access the network?

SKILL.md names 3 domains. In commands or code: ddinter.scbdd.com; the agent is likely to contact it when it follows the instructions. As links in the text: doi.org and who.int. This is read from the text; nothing was executed.

Is Ddinter Database safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Ddinter Database use?

Ddinter Database is published under the CC-BY-4.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Ddinter Database use?

About 7.3k tokens (SKILL.md is roughly 29k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Ddinter Database?

Skills that share tags, products or a category with Ddinter Database: Pubchem Database (davila7/claude-code-templates, 32k stars), DiffDock Molecular Docking (K-Dense-AI/scientific-agent-skills, 48k stars), Biopipelines (locbp-uzh/biopipelines, 109 stars) and Tooluniverse (ynulihao/AgentSkillOS, 617 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ddinter Database?

jaechang-hits (a GitHub user) maintains it in jaechang-hits/SciAgent-Skills, which has 370 GitHub stars. The repository holds 163 skills in this directory. The repository was last updated on September 29, 2026.

Source: jaechang-hits/SciAgent-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.