[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73G4MX4MSP2G3R2AJCTYVX6":3,"skill-same:01M73G4MX4MSP2G3R2AJCTYVX6":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M73G4MX4MSP2G3R2AJCTYVX6","clinpgx-database",null,"Query the ClinPGx (formerly PharmGKB) REST API plus the CPIC PostgREST companion API for pharmacogenomic clinical annotations, CPIC\u002FDPWG dosing guidelines, gene-drug pairs, variant-drug associations, FDA\u002FEMA drug labels, and PGx pathways. Two-host architecture: api.clinpgx.org for annotation records, api.cpicpgx.org for genotype→recommendation lookups. No auth. For germline pathogenicity use clinvar-database; for somatic cancer PGx use cosmic-database or opentargets-database; for drug bioactivity use chembl-database-bioactivity.","bg-szy\u002FTOP-SKILLS","bg-szy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F106576190?v=4","01M73A4E8KPV67SFXRY8XZGNBX","ShuZhiyong","01M73A4E96MQ294MHM74TZBVQD",6,"CC-BY-SA-4.0","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fawesome-skills\u002Fclinpgx-database\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: \"clinpgx-database\"\ndescription: \"Query the ClinPGx (formerly PharmGKB) REST API plus the CPIC PostgREST companion API for pharmacogenomic clinical annotations, CPIC\u002FDPWG dosing guidelines, gene-drug pairs, variant-drug associations, FDA\u002FEMA drug labels, and PGx pathways. Two-host architecture: api.clinpgx.org for annotation records, api.cpicpgx.org for genotype→recommendation lookups. No auth. For germline pathogenicity use clinvar-database; for somatic cancer PGx use cosmic-database or opentargets-database; for drug bioactivity use chembl-database-bioactivity.\"\nlicense: \"CC-BY-SA-4.0\"\n---\n\n# ClinPGx (PharmGKB) Pharmacogenomics Database\n\n## Overview\n\nPharmGKB rebranded as **ClinPGx** in 2024 and the API moved from `api.pharmgkb.org` to `api.clinpgx.org`. The old host now returns 404\u002F405; every example here uses the new endpoints. Two complementary APIs are used together:\n\n- **ClinPGx Data API** (`api.clinpgx.org\u002Fv1`) — record-style access to genes, drugs, variants, clinical annotations, guideline annotations, drug labels, and pathways. Responses wrap data as `{\"data\": [...], \"status\": \"success\"}`. Filters use dotted property paths (e.g. `relatedChemicals.name=clopidogrel`, `levelOfEvidence.term=1A`).\n- **CPIC PostgREST API** (`api.cpicpgx.org\u002Fv1`) — relational lookup of genotype → drug recommendation rows. PostgREST filter syntax (`column=eq.value`, JSON `cs.{...}` for jsonb containment). Returns flat JSON arrays.\n\nUse ClinPGx for *what is known* about a gene\u002Fdrug\u002Fvariant; use CPIC for *how to prescribe* given a phenotype. The pattern is `ClinPGx for annotations, CPIC for recommendations`.\n\n## When to Use\n\n- Retrieving CPIC genotype-specific dosing recommendations for a gene-drug pair (e.g., CYP2C19 + clopidogrel) — use CPIC\n- Looking up all pharmacogenomic clinical annotations for a drug or evidence level — use ClinPGx `data\u002FclinicalAnnotation`\n- Finding all CPIC\u002FDPWG guideline annotations for a pharmacogene — use ClinPGx `data\u002FguidelineAnnotation`\n- Resolving a gene symbol, drug name, or rsID to ClinPGx PA identifiers — use `data\u002F{gene,drug,variant}`\n- Free-text search across all ClinPGx record types (genes, drugs, variants, annotations) — use `POST \u002Fsite\u002Fsearch`\n- Retrieving FDA\u002FEMA pharmacogenomic drug label annotations — use ClinPGx `data\u002Flabel`\n- Building precision-medicine prescribing workflows that combine annotation evidence with phenotype-specific recommendations\n- For germline disease pathogenicity (not PGx) use `clinvar-database`\n- For somatic cancer pharmacogenomics use `cosmic-database` or `opentargets-database`\n\n## Prerequisites\n\n- **Python packages**: `requests`, `pandas` — both already in standard environments\n- **Data requirements**: HGNC gene symbols, drug names (lowercase generic), dbSNP rsIDs, or PA identifiers\n- **Environment**: internet connection; no authentication required for either host\n- **Rate limits**: the ClinPGx host occasionally returns HTTP 429; insert `time.sleep(0.3–0.5)` between sequential calls. CPIC is more permissive.\n\nIf you are inside a pixi\u002Fconda environment that already provides `requests` and `pandas`, skip the install — invoke scripts with `pixi run python ...`.\n\n```bash\npip install requests pandas\n```\n\n## Quick Start\n\n```python\nimport requests\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\nCPIC    = \"https:\u002F\u002Fapi.cpicpgx.org\u002Fv1\"\n\n# CPIC genotype → recommendation: clopidogrel + CYP2C19 Poor Metabolizer\ndrug = requests.get(f\"{CPIC}\u002Fdrug\", params={\"name\": \"eq.clopidogrel\"}).json()[0]\nrecs = requests.get(f\"{CPIC}\u002Frecommendation\",\n                    params={\"drugid\": f\"eq.{drug['drugid']}\",\n                            \"phenotypes\": 'cs.{\"CYP2C19\":\"Poor Metabolizer\"}'}).json()\nprint(f\"clopidogrel CYP2C19=PM: {len(recs)} recommendation(s)\")\nfor rec in recs[:2]:\n    print(f\"  [{rec['classification']}] {rec['drugrecommendation'][:80]}…\")\n\n# ClinPGx side: how many CPIC guideline annotations cover CYP2C19?\nglines = requests.get(f\"{CLINPGX}\u002Fdata\u002FguidelineAnnotation\",\n                      params={\"relatedGenes.symbol\": \"CYP2C19\",\n                              \"source\": \"CPIC\", \"view\": \"base\"}).json()[\"data\"]\nprint(f\"CYP2C19 CPIC guidelines: {len(glines)}\")\n```\n\n## Core API\n\n### Module 1: Free-text site search\n\n`POST \u002Fsite\u002Fsearch` with a JSON body `{\"query\": \"\u003Cterm>\"}` is the canonical entry point when you don't know the PA ID. It searches across drugs, genes, variants, clinical annotations, guideline annotations, and labels in one shot.\n\n```python\nimport requests\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\n\nr = requests.post(f\"{CLINPGX}\u002Fsite\u002Fsearch\",\n                  json={\"query\": \"rs4149056\"}, timeout=15)\nr.raise_for_status()\nhits = r.json()[\"data\"][\"hits\"]\nprint(f\"Total hits: {r.json()['data']['total']}\")\nfor h in hits[:5]:\n    print(f\"  id={h.get('id')}  name={h.get('name')[:80]}\")\n```\n\n```python\n# Broader concept search\nr = requests.post(f\"{CLINPGX}\u002Fsite\u002Fsearch\",\n                  json={\"query\": \"TPMT azathioprine\"}, timeout=15)\nhits = r.json()[\"data\"][\"hits\"]\nprint(f\"TPMT+azathioprine hits: {len(hits)}\")\nfor h in hits[:5]:\n    print(f\"  {h.get('id'):>15}  {h.get('name','')[:80]}\")\n```\n\n### Module 2: Gene, drug, and variant record lookup\n\nThe `\u002Fdata\u002F{type}` endpoints accept simple property filters. All return `{\"data\": [...], \"status\": \"success\"}` — use `view=base` for summary, `view=max` for full nested objects.\n\n```python\nimport requests\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\n\n# Gene by HGNC symbol\ngene = requests.get(f\"{CLINPGX}\u002Fdata\u002Fgene\",\n                    params={\"symbol\": \"CYP2D6\", \"view\": \"base\"}).json()[\"data\"][0]\nprint(f\"{gene['symbol']}  id={gene['id']}  {gene['name']}\")\n\n# Drug by name (lowercase generic preferred)\ndrug = requests.get(f\"{CLINPGX}\u002Fdata\u002Fdrug\",\n                    params={\"name\": \"warfarin\", \"view\": \"base\"}).json()[\"data\"][0]\nprint(f\"{drug['name']}  id={drug['id']}\")\n\n# Variant by rsID\nvar = requests.get(f\"{CLINPGX}\u002Fdata\u002Fvariant\",\n                   params={\"name\": \"rs4149056\", \"view\": \"base\"}).json()[\"data\"][0]\nprint(f\"{var['name']}  id={var['id']}  significance={var.get('clinicalSignificance')}\")\n```\n\n```python\n# Direct record fetch when you already have a PA ID\nr = requests.get(f\"{CLINPGX}\u002Fdata\u002Fdrug\u002FPA449088\", params={\"view\": \"max\"}).json()\nd = r[\"data\"]\nprint(f\"PA449088 → {d['name']}  (objCls={d['objCls']})\")\n```\n\n### Module 3: Clinical annotations\n\n`data\u002FclinicalAnnotation` records associate a variant (`location`) with one or more drugs (`relatedChemicals`) and an evidence level (`levelOfEvidence.term`). The two supported filters are `relatedChemicals.name=` and `levelOfEvidence.term=`. There is **no working `gene=` filter on this endpoint** — see Module 4 for gene-driven access.\n\n```python\nimport requests, pandas as pd\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\n\n# All clinical annotations for clopidogrel\ndata = requests.get(f\"{CLINPGX}\u002Fdata\u002FclinicalAnnotation\",\n                    params={\"relatedChemicals.name\": \"clopidogrel\",\n                            \"view\": \"base\"}).json()[\"data\"]\nprint(f\"clopidogrel annotations: {len(data)}\")\n\nrows = []\nfor ann in data[:10]:\n    loc = ann.get(\"location\") or {}\n    drugs = \", \".join(c.get(\"name\", \"\") for c in ann.get(\"relatedChemicals\", []))\n    rows.append({\n        \"id\": ann[\"id\"],\n        \"variant\": loc.get(\"displayName\"),\n        \"gene\": (loc.get(\"genes\") or [{}])[0].get(\"symbol\"),\n        \"drug\": drugs,\n        \"level\": (ann.get(\"levelOfEvidence\") or {}).get(\"term\"),\n        \"score\": ann.get(\"score\"),\n    })\nprint(pd.DataFrame(rows).to_string(index=False))\n```\n\n```python\n# All Level 1A clinical annotations (highest evidence)\ndata = requests.get(f\"{CLINPGX}\u002Fdata\u002FclinicalAnnotation\",\n                    params={\"levelOfEvidence.term\": \"1A\",\n                            \"view\": \"base\"}).json()[\"data\"]\nprint(f\"Level 1A annotations: {len(data)}\")\n\ndrug_to_count = {}\nfor ann in data:\n    for c in ann.get(\"relatedChemicals\") or []:\n        drug_to_count[c[\"name\"]] = drug_to_count.get(c[\"name\"], 0) + 1\ntop = sorted(drug_to_count.items(), key=lambda x: -x[1])[:10]\nfor d, n in top:\n    print(f\"  {n:3}  {d}\")\n```\n\n### Module 4: Guideline annotations (gene-driven access)\n\n`data\u002FguidelineAnnotation` supports both `relatedGenes.symbol=` and `relatedChemicals.name=`, plus `source=` (`CPIC`, `DPWG`, `CPNDS`, `RNPGx`). This is the canonical way to get gene→guideline coverage.\n\n```python\nimport requests\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\n\n# All CPIC guidelines mentioning CYP2C19\ndata = requests.get(f\"{CLINPGX}\u002Fdata\u002FguidelineAnnotation\",\n                    params={\"relatedGenes.symbol\": \"CYP2C19\",\n                            \"source\": \"CPIC\",\n                            \"view\": \"base\"}).json()[\"data\"]\nprint(f\"CYP2C19 CPIC guidelines: {len(data)}\")\nfor g in data[:5]:\n    print(f\"  PA{g['id']}: {g['name'][:80]}\")\n```\n\n```python\n# Guidelines for a specific drug across all bodies (CPIC, DPWG, …)\ndata = requests.get(f\"{CLINPGX}\u002Fdata\u002FguidelineAnnotation\",\n                    params={\"relatedChemicals.name\": \"clopidogrel\",\n                            \"view\": \"base\"}).json()[\"data\"]\nby_source = {}\nfor g in data:\n    for s in (g.get(\"crossReferences\") or []):\n        by_source.setdefault(s.get(\"resource\", \"?\"), 0)\n        by_source[s[\"resource\"]] = by_source.get(s[\"resource\"], 0) + 1\nprint(f\"clopidogrel guidelines: {len(data)} ({list({g.get('source') for g in data})})\")\n```\n\n### Module 5: Regulatory drug labels (FDA \u002F EMA)\n\n`data\u002Flabel` records are PharmGKB-curated annotations of FDA\u002FEMA pharmacogenomic labeling. Filter by `relatedChemicals.name=` and `source=` (`FDA`, `EMA`, `HCSC`, `PMDA`, `Swissmedic`).\n\n```python\nimport requests, pandas as pd\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\n\ndata = requests.get(f\"{CLINPGX}\u002Fdata\u002Flabel\",\n                    params={\"relatedChemicals.name\": \"warfarin\",\n                            \"source\": \"FDA\",\n                            \"view\": \"base\"}).json()[\"data\"]\nprint(f\"warfarin FDA labels: {len(data)}\")\n\nrows = [{\n    \"name\": d[\"name\"][:60],\n    \"biomarker_status\": d.get(\"biomarkerStatus\"),\n    \"testing_required\": d.get(\"testingRequired\"),\n    \"alternate_drug\": d.get(\"alternateDrugAvailable\"),\n} for d in data]\nprint(pd.DataFrame(rows).to_string(index=False))\n```\n\n### Module 6: CPIC genotype → recommendation chain\n\nCPIC's PostgREST API uses `column=eq.value` for equality and `column=cs.{...}` for JSONB containment. The standard lookup chain is `drug → drugid → recommendation`, optionally filtered by phenotype.\n\n```python\nimport requests\n\nCPIC = \"https:\u002F\u002Fapi.cpicpgx.org\u002Fv1\"\n\n# Resolve drug name to drugid (RxNorm-prefixed)\ndrug = requests.get(f\"{CPIC}\u002Fdrug\",\n                    params={\"name\": \"eq.clopidogrel\"}).json()[0]\nprint(f\"clopidogrel drugid: {drug['drugid']}\")\n\n# All phenotype-specific recommendations for clopidogrel\nrecs = requests.get(f\"{CPIC}\u002Frecommendation\",\n                    params={\"drugid\": f\"eq.{drug['drugid']}\"}).json()\nprint(f\"Total recommendations: {len(recs)}\")\nfor rec in recs[:3]:\n    print(f\"  {rec['phenotypes']}  [{rec['classification']}]\")\n    print(f\"    {rec['drugrecommendation'][:90]}…\")\n```\n\n```python\n# Phenotype filter via jsonb containment (cs.{...})\n# The phenotypes column is a jsonb dict; cs. checks that the query is a subset.\nrecs = requests.get(f\"{CPIC}\u002Frecommendation\",\n                    params={\"drugid\": f\"eq.{drug['drugid']}\",\n                            \"phenotypes\": 'cs.{\"CYP2C19\":\"Poor Metabolizer\"}'}\n                    ).json()\nfor rec in recs:\n    print(f\"  [{rec['classification']}] {rec['drugrecommendation'][:90]}…\")\n\n# Gene-driven: list every drug with a CPIC pair for CYP2C19\npairs = requests.get(f\"{CPIC}\u002Fpair\",\n                     params={\"genesymbol\": \"eq.CYP2C19\"}).json()\nprint(f\"\\nCYP2C19 CPIC pairs: {len(pairs)}\")\ndrug_ids = sorted({p[\"drugid\"] for p in pairs})\nprint(f\"Sample drug IDs: {drug_ids[:5]}\")\n```\n\n## Key Concepts\n\n### Two-host architecture\n\n| Question                                        | Use                                 | Why                                                                              |\n| ----------------------------------------------- | ----------------------------------- | -------------------------------------------------------------------------------- |\n| What clinical annotations exist for this drug?  | ClinPGx `data\u002FclinicalAnnotation`   | Annotation-level evidence with curated levelOfEvidence.term                      |\n| What CPIC guidelines cover this gene?           | ClinPGx `data\u002FguidelineAnnotation`  | Filter by `relatedGenes.symbol`; no working `gene=` filter on clinicalAnnotation |\n| Given phenotype X, what should I prescribe?     | CPIC `recommendation` + `phenotypes`| Structured genotype→action rows; CPIC is the prescribing-rule oracle             |\n| What FDA labels mention this drug + gene?       | ClinPGx `data\u002Flabel?source=FDA`     | Curated regulatory PGx labeling                                                  |\n| Free-text \"anything about X\"                    | ClinPGx `POST \u002Fsite\u002Fsearch`         | Cross-record-type fan-out                                                        |\n\n### PharmGKB \u002F ClinPGx evidence levels\n\nLevels 1A → 4 in decreasing evidence quality:\n- **1A** — Annotation of a variant–drug pair in a clinical guideline or FDA label (strongest)\n- **1B** — Significant association replicated in multiple studies\n- **2A** — Variant in a known PGx gene, significant association\n- **2B** — Moderate evidence, often single study\n- **3** — Limited evidence (single study or unreplicated)\n- **4** — Case reports \u002F biological plausibility only\n\nFilter via `levelOfEvidence.term` on `data\u002FclinicalAnnotation`. The term is a *string*, not an enum (`\"1A\"` not `1A`).\n\n### ClinPGx response envelope and view modes\n\nEvery ClinPGx `\u002Fdata\u002F...` response is `{\"data\": [...] | {...}, \"status\": \"success\" | \"fail\"}`. On failure the body is `{\"status\": \"fail\", \"data\": {\"errors\": [{\"message\": \"...\"}]}}` — always read both keys.\n\n- `view=base` (default) — flat summary record; recommended for bulk filters\n- `view=max` — full nested objects (relatedDiseases, allelePhenotypes, scoreDetails, …). Larger payload, slower; use only for single-record details.\n\n## Common Workflows\n\n### Workflow 1: Pharmacogene panel CPIC coverage\n\n**Goal:** Given a patient's pharmacogene panel, count how many CPIC guideline annotations cover each gene.\n\n```python\nimport requests, pandas as pd, time\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\npharmacogenes = [\"CYP2D6\", \"CYP2C19\", \"CYP2C9\", \"DPYD\", \"TPMT\", \"SLCO1B1\"]\n\nrows = []\nfor g in pharmacogenes:\n    data = requests.get(f\"{CLINPGX}\u002Fdata\u002FguidelineAnnotation\",\n                        params={\"relatedGenes.symbol\": g,\n                                \"source\": \"CPIC\", \"view\": \"base\"},\n                        timeout=20).json()[\"data\"]\n    drugs = sorted({c[\"name\"] for guideline in data\n                                for c in (guideline.get(\"relatedChemicals\") or [])})\n    rows.append({\"gene\": g, \"cpic_guidelines\": len(data),\n                 \"n_drugs\": len(drugs), \"sample\": \", \".join(drugs[:3])})\n    time.sleep(0.3)\n\ndf = pd.DataFrame(rows).sort_values(\"cpic_guidelines\", ascending=False)\nprint(df.to_string(index=False))\ndf.to_csv(\"pharmacogene_cpic_coverage.csv\", index=False)\n```\n\n### Workflow 2: Drug panel — CPIC prescribing rule lookup\n\n**Goal:** Given a prescribed drug list, identify which have CPIC genotype-specific recommendations and surface the rule rows.\n\n```python\nimport requests, pandas as pd, time\n\nCPIC = \"https:\u002F\u002Fapi.cpicpgx.org\u002Fv1\"\ndrugs = [\"warfarin\", \"clopidogrel\", \"codeine\", \"simvastatin\",\n         \"metoprolol\", \"omeprazole\", \"azathioprine\", \"tacrolimus\"]\n\nrows = []\nfor name in drugs:\n    drug = requests.get(f\"{CPIC}\u002Fdrug\", params={\"name\": f\"eq.{name}\"}, timeout=15).json()\n    if not drug:\n        rows.append({\"drug\": name, \"in_cpic\": False, \"n_recs\": 0, \"phenotypes\": \"\"}); continue\n    did = drug[0][\"drugid\"]\n    recs = requests.get(f\"{CPIC}\u002Frecommendation\",\n                        params={\"drugid\": f\"eq.{did}\"}, timeout=15).json()\n    phens = sorted({f\"{k}={v}\" for rec in recs\n                                  for k, v in (rec.get(\"phenotypes\") or {}).items()})\n    rows.append({\"drug\": name, \"in_cpic\": True, \"n_recs\": len(recs),\n                 \"phenotypes\": \"; \".join(phens[:3])})\n    time.sleep(0.3)\n\ndf = pd.DataFrame(rows).sort_values([\"in_cpic\", \"n_recs\"], ascending=[False, False])\nprint(df.to_string(index=False))\n```\n\n### Workflow 3: Variant → drug interactions (rsID-driven)\n\n**Goal:** Starting from a single rsID (e.g., SLCO1B1 *5 = rs4149056), find every clinical annotation that involves it.\n\nThe Data API does **not** accept rsID as a filter property. Use `POST \u002Fsite\u002Fsearch` to discover related annotation IDs, then fetch each by ID.\n\n```python\nimport requests\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\nrsid = \"rs4149056\"\n\nhits = requests.post(f\"{CLINPGX}\u002Fsite\u002Fsearch\",\n                     json={\"query\": rsid}, timeout=15).json()[\"data\"][\"hits\"]\nprint(f\"{rsid}: {len(hits)} hits\")\n\n# Filter hits that look like clinical annotations\nann_hits = [h for h in hits if h.get(\"name\", \"\").lower().startswith(\"clinical annotation\")]\nprint(f\"Clinical-annotation hits: {len(ann_hits)}\")\nfor h in ann_hits[:5]:\n    print(f\"  id={h['id']}  {h['name'][:90]}\")\n\n# Dereference one annotation by ID for full detail\nif ann_hits:\n    ann = requests.get(f\"{CLINPGX}\u002Fdata\u002FclinicalAnnotation\u002F{ann_hits[0]['id']}\",\n                       params={\"view\": \"max\"}, timeout=15).json()[\"data\"]\n    drugs = \", \".join(c[\"name\"] for c in (ann.get(\"relatedChemicals\") or []))\n    print(f\"\\nFirst annotation:\")\n    print(f\"  drugs: {drugs}\")\n    print(f\"  level: {(ann.get('levelOfEvidence') or {}).get('term')}\")\n```\n\n## Key Parameters\n\n| Parameter                   | Module \u002F Endpoint                              | Default | Range \u002F Options                                          | Effect                                                                  |\n| --------------------------- | ---------------------------------------------- | ------- | -------------------------------------------------------- | ----------------------------------------------------------------------- |\n| `view`                      | all `\u002Fdata\u002F...`                                | `base`  | `base`, `min`, `max`                                     | Field detail level; `max` includes all nested arrays (slow but complete) |\n| `relatedChemicals.name`     | `clinicalAnnotation`, `variantAnnotation`, `guidelineAnnotation`, `label`, `pathway` | — | lowercase generic drug name                              | Filter records related to a drug                                        |\n| `relatedGenes.symbol`       | `guidelineAnnotation`, `pathway`               | —       | HGNC gene symbol                                         | Filter records related to a gene (not available on `clinicalAnnotation`) |\n| `levelOfEvidence.term`      | `clinicalAnnotation`                           | —       | `\"1A\"`, `\"1B\"`, `\"2A\"`, `\"2B\"`, `\"3\"`, `\"4\"`             | Minimum evidence level                                                  |\n| `source`                    | `guidelineAnnotation`, `label`                 | —       | `CPIC`, `DPWG`, `FDA`, `EMA`, `HCSC`, `PMDA`, `Swissmedic` | Issuing body                                                            |\n| `symbol`                    | `data\u002Fgene`                                    | —       | HGNC gene symbol                                         | Gene record lookup                                                      |\n| `name`                      | `data\u002Fdrug`, `data\u002Fvariant`                    | —       | drug name or rsID                                        | Record lookup by canonical name                                         |\n| CPIC `column=eq.value`      | all `api.cpicpgx.org\u002Fv1\u002F...`                   | —       | PostgREST equality                                       | Filter by exact match                                                   |\n| CPIC `phenotypes=cs.{json}` | `recommendation`                               | —       | JSON-encoded jsonb subset                                | Filter by phenotype containment (must URL-encode if special chars)      |\n\n## Best Practices\n\n1. **Resolve PA identifiers once.** Never hand-construct ClinPGx PA IDs. Call `data\u002F{type}?{symbol|name}=...` (or `site\u002Fsearch`) once and cache the returned `id` for reuse — `gene\u002FPA128` for CYP2D6, `drug\u002FPA449088` for clopidogrel, `variant\u002FPA166154579` for rs4149056.\n\n2. **Pick the right host for the question.** Use ClinPGx for `what is annotated` and CPIC for `what to prescribe`. Trying to derive genotype-specific recommendations from ClinPGx alone misses the structured `recommendation.phenotypes` rows.\n\n3. **Filter by evidence level upfront** when building clinical workflows. `levelOfEvidence.term=1A` returns 312 actionable annotations across all of ClinPGx; Level 3\u002F4 records are exploratory and shouldn't drive prescribing.\n\n4. **Don't filter `clinicalAnnotation` by gene — filter by `guidelineAnnotation`** with `relatedGenes.symbol`. The `clinicalAnnotation` endpoint has no working gene property and returns HTTP 400 for any attempt.\n\n5. **Use `view=base` for bulk filters, `view=max` for single-record drill-downs.** A list query with `view=max` can time out or hit 429; the difference is roughly 5–10× payload size.\n\n6. **Throttle the ClinPGx host.** Insert `time.sleep(0.3)` between sequential queries in loops; the API returns occasional HTTP 429s on tight loops. CPIC tolerates faster iteration.\n\n7. **URL-encode `cs.{...}` jsonb filters** when phenotype values contain spaces or special characters. `requests.get(..., params={\"phenotypes\": 'cs.{\"CYP2C19\":\"Poor Metabolizer\"}'})` works because `requests` does the encoding; a manual URL string needs `urllib.parse.quote`.\n\n## Common Recipes\n\n### Recipe 1 — Free-text discovery via site\u002Fsearch\n\nWhen to use: you have an arbitrary string (rsID, drug name, gene, allele) and want to find related ClinPGx records without knowing which endpoint to hit.\n\n```python\nimport requests\nr = requests.post(\"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\u002Fsite\u002Fsearch\",\n                  json={\"query\": \"VKORC1 warfarin\"}, timeout=15)\nhits = r.json()[\"data\"][\"hits\"]\nfor h in hits[:10]:\n    print(f\"  {h.get('id'):>15}  {h.get('name','')[:80]}\")\n```\n\n### Recipe 2 — Top drugs by Level 1A annotation count\n\nWhen to use: build a leaderboard of the most actionable PGx drugs.\n\n```python\nimport requests, pandas as pd\ndata = requests.get(\"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\u002Fdata\u002FclinicalAnnotation\",\n                    params={\"levelOfEvidence.term\": \"1A\", \"view\": \"base\"},\n                    timeout=30).json()[\"data\"]\ncounts = {}\nfor ann in data:\n    for c in ann.get(\"relatedChemicals\") or []:\n        counts[c[\"name\"]] = counts.get(c[\"name\"], 0) + 1\ndf = pd.DataFrame(sorted(counts.items(), key=lambda x: -x[1]),\n                  columns=[\"drug\", \"n_1A_annotations\"]).head(15)\nprint(df.to_string(index=False))\n```\n\n### Recipe 3 — Patient genotype → drug recommendations\n\nWhen to use: given a phenotype call from a PGx test, surface every CPIC recommendation row.\n\n```python\nimport requests\nCPIC = \"https:\u002F\u002Fapi.cpicpgx.org\u002Fv1\"\n\ngenotype = {\"CYP2C19\": \"Poor Metabolizer\"}\ndrug = \"clopidogrel\"\n\ndid = requests.get(f\"{CPIC}\u002Fdrug\", params={\"name\": f\"eq.{drug}\"}).json()[0][\"drugid\"]\nimport json\nrecs = requests.get(f\"{CPIC}\u002Frecommendation\",\n                    params={\"drugid\": f\"eq.{did}\",\n                            \"phenotypes\": f\"cs.{json.dumps(genotype)}\"}).json()\nfor rec in recs:\n    print(f\"[{rec['classification']}] {rec['drugrecommendation']}\")\n    print(f\"  implications: {rec['implications']}\")\n```\n\n### Recipe 4 — Robust session with retry\n\nWhen to use: long-running loops over many genes \u002F drugs \u002F variants.\n\n```python\nimport requests\nfrom requests.adapters import HTTPAdapter\nfrom urllib3.util.retry import Retry\n\ns = requests.Session()\ns.headers.update({\"Accept\": \"application\u002Fjson\"})\ns.mount(\"https:\u002F\u002F\", HTTPAdapter(max_retries=Retry(\n    total=4, backoff_factor=1.0,\n    status_forcelist=[429, 500, 502, 503, 504],\n    allowed_methods=[\"GET\", \"POST\"])))\n\nr = s.get(\"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\u002Fdata\u002Fgene\",\n          params={\"symbol\": \"CYP2D6\", \"view\": \"base\"}, timeout=20)\nr.raise_for_status()\nprint(r.json()[\"data\"][0][\"name\"])\n```\n\n## Troubleshooting\n\n| Problem                                                                                   | Cause                                                                                              | Solution                                                                                                                            |\n| ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| HTTP 404\u002F405 on `https:\u002F\u002Fapi.pharmgkb.org\u002Fv1\u002F...`                                         | Old PharmGKB host is dead; the service rebranded to ClinPGx in 2024                                | Migrate to `https:\u002F\u002Fapi.clinpgx.org\u002Fv1\u002F...`. Old `\u002FclinicalAnnotation?gene=X` is now `data\u002FclinicalAnnotation` with different filters. |\n| `{\"status\":\"fail\",\"data\":{\"errors\":[{\"message\":\"No such property: 'gene'\"}]}}`            | `data\u002FclinicalAnnotation` does **not** accept `gene=` or `relatedGenes.symbol=`                    | Use `data\u002FguidelineAnnotation?relatedGenes.symbol=X` for gene-driven access, or `?relatedChemicals.name=Y` for drug-driven.        |\n| `{\"status\":\"fail\",\"data\":{\"errors\":[{\"message\":\"Missing criteria.\"}]}}`                   | A `data\u002F{type}` list query has no filter and no ID                                                 | Add at least one filter (`name=`, `symbol=`, `relatedChemicals.name=`, …) or fetch by ID via `data\u002F{type}\u002F{paId}`.                  |\n| HTTP 405 on `GET \u002Fsite\u002Fsearch?query=...`                                                  | `site\u002Fsearch` only accepts POST with a JSON body                                                   | Use `requests.post(url, json={\"query\": \"...\"})`.                                                                                    |\n| HTTP 429 mid-loop                                                                         | Hit ClinPGx rate limit                                                                             | Insert `time.sleep(0.3–0.5)` between calls; use the Retry session in Recipe 4.                                                      |\n| HTTP 400 on `https:\u002F\u002Fapi.cpicpgx.org\u002Fv1\u002Frecommendation?phenotypes=cs.{...}`               | The `cs.` JSON wasn't URL-encoded                                                                  | Pass via `requests` `params={\"phenotypes\": 'cs.{\"CYP2C19\":\"Poor Metabolizer\"}'}` (auto-encoded) or `urllib.parse.quote` manually.    |\n| Empty `data` list for an obviously-real drug                                              | Drug name mismatch (brand vs. generic; capitalization)                                             | Try lowercase generic name; fall back to `POST \u002Fsite\u002Fsearch` to fan out and find the canonical PA ID.                              |\n| `data\u002Fvariant?name=rs...` returns 1 record but `data\u002FclinicalAnnotation?location.name=rs...` returns 404 | rsID is stored under `location.displayName`\u002F`location.rsid`, not exposed as a filterable property | Use `site\u002Fsearch` to discover annotation IDs by rsID, then dereference each with `data\u002FclinicalAnnotation\u002F{id}`. (Workflow 3.)      |\n\n## Related Skills\n\n- `clinvar-database` — germline pathogenicity \u002F clinical significance for variants found in PharmGKB (complementary; ClinVar is disease-focused, ClinPGx is drug-response-focused)\n- `opentargets-database` — drug-target associations and safety signals overlapping ClinPGx pharmacogene targets\n- `chembl-database-bioactivity` — bioactivity and binding data for the drugs annotated in ClinPGx\n- `cosmic-database` — somatic cancer mutations and tumor-specific PGx (orthogonal to germline PGx covered here)\n\n## References\n\n- [ClinPGx (formerly PharmGKB) website](https:\u002F\u002Fwww.clinpgx.org\u002F) — Database front end; web links match the `data\u002F{type}\u002F{paId}` URL shape\n- [ClinPGx REST API documentation](https:\u002F\u002Fwww.clinpgx.org\u002Fpage\u002FwebResources) — Official endpoint reference, `data\u002F...` and `site\u002Fsearch` schemas\n- [CPIC API documentation](https:\u002F\u002Fapi.cpicpgx.org\u002F) — Swagger UI for the PostgREST companion API\n- [CPIC guidelines](https:\u002F\u002Fcpicpgx.org\u002Fguidelines\u002F) — Source of `recommendation` rows; canonical genotype-prescribing oracle\n- [Relling & Klein (2011) Nature Reviews Drug Discovery — PharmGKB foundational paper](https:\u002F\u002Fdoi.org\u002F10.1038\u002Fnrd3499)\n- [Whirl-Carrillo et al. (2021) Clin Pharmacol Ther — PharmGKB data architecture update](https:\u002F\u002Fdoi.org\u002F10.1002\u002Fcpt.2350)\n","# ClinPGx (PharmGKB) Pharmacogenomics Database\n\n## Overview\n\nPharmGKB rebranded as **ClinPGx** in 2024 and the API moved from `api.pharmgkb.org` to `api.clinpgx.org`. The old host now returns 404\u002F405; every example here uses the new endpoints. Two complementary APIs are used together:\n\n- **ClinPGx Data API** (`api.clinpgx.org\u002Fv1`) — record-style access to genes, drugs, variants, clinical annotations, guideline annotations, drug labels, and pathways. Responses wrap data as `{\"data\": [...], \"status\": \"success\"}`. Filters use dotted property paths (e.g. `relatedChemicals.name=clopidogrel`, `levelOfEvidence.term=1A`).\n- **CPIC PostgREST API** (`api.cpicpgx.org\u002Fv1`) — relational lookup of genotype → drug recommendation rows. PostgREST filter syntax (`column=eq.value`, JSON `cs.{...}` for jsonb containment). Returns flat JSON arrays.\n\nUse ClinPGx for *what is known* about a gene\u002Fdrug\u002Fvariant; use CPIC for *how to prescribe* given a phenotype. The pattern is `ClinPGx for annotations, CPIC for recommendations`.\n\n## When to Use\n\n- Retrieving CPIC genotype-specific dosing recommendations for a gene-drug pair (e.g., CYP2C19 + clopidogrel) — use CPIC\n- Looking up all pharmacogenomic clinical annotations for a drug or evidence level — use ClinPGx `data\u002FclinicalAnnotation`\n- Finding all CPIC\u002FDPWG guideline annotations for a pharmacogene — use ClinPGx `data\u002FguidelineAnnotation`\n- Resolving a gene symbol, drug name, or rsID to ClinPGx PA identifiers — use `data\u002F{gene,drug,variant}`\n- Free-text search across all ClinPGx record types (genes, drugs, variants, annotations) — use `POST \u002Fsite\u002Fsearch`\n- Retrieving FDA\u002FEMA pharmacogenomic drug label annotations — use ClinPGx `data\u002Flabel`\n- Building precision-medicine prescribing workflows that combine annotation evidence with phenotype-specific recommendations\n- For germline disease pathogenicity (not PGx) use `clinvar-database`\n- For somatic cancer pharmacogenomics use `cosmic-database` or `opentargets-database`\n\n## Prerequisites\n\n- **Python packages**: `requests`, `pandas` — both already in standard environments\n- **Data requirements**: HGNC gene symbols, drug names (lowercase generic), dbSNP rsIDs, or PA identifiers\n- **Environment**: internet connection; no authentication required for either host\n- **Rate limits**: the ClinPGx host occasionally returns HTTP 429; insert `time.sleep(0.3–0.5)` between sequential calls. CPIC is more permissive.\n\nIf you are inside a pixi\u002Fconda environment that already provides `requests` and `pandas`, skip the install — invoke scripts with `pixi run python ...`.\n\n```bash\npip install requests pandas\n```\n\n## Quick Start\n\n```python\nimport requests\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\nCPIC    = \"https:\u002F\u002Fapi.cpicpgx.org\u002Fv1\"\n\n# CPIC genotype → recommendation: clopidogrel + CYP2C19 Poor Metabolizer\ndrug = requests.get(f\"{CPIC}\u002Fdrug\", params={\"name\": \"eq.clopidogrel\"}).json()[0]\nrecs = requests.get(f\"{CPIC}\u002Frecommendation\",\n                    params={\"drugid\": f\"eq.{drug['drugid']}\",\n                            \"phenotypes\": 'cs.{\"CYP2C19\":\"Poor Metabolizer\"}'}).json()\nprint(f\"clopidogrel CYP2C19=PM: {len(recs)} recommendation(s)\")\nfor rec in recs[:2]:\n    print(f\"  [{rec['classification']}] {rec['drugrecommendation'][:80]}…\")\n\n# ClinPGx side: how many CPIC guideline annotations cover CYP2C19?\nglines = requests.get(f\"{CLINPGX}\u002Fdata\u002FguidelineAnnotation\",\n                      params={\"relatedGenes.symbol\": \"CYP2C19\",\n                              \"source\": \"CPIC\", \"view\": \"base\"}).json()[\"data\"]\nprint(f\"CYP2C19 CPIC guidelines: {len(glines)}\")\n```\n\n## Core API\n\n### Module 1: Free-text site search\n\n`POST \u002Fsite\u002Fsearch` with a JSON body `{\"query\": \"\u003Cterm>\"}` is the canonical entry point when you don't know the PA ID. It searches across drugs, genes, variants, clinical annotations, guideline annotations, and labels in one shot.\n\n```python\nimport requests\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\n\nr = requests.post(f\"{CLINPGX}\u002Fsite\u002Fsearch\",\n                  json={\"query\": \"rs4149056\"}, timeout=15)\nr.raise_for_status()\nhits = r.json()[\"data\"][\"hits\"]\nprint(f\"Total hits: {r.json()['data']['total']}\")\nfor h in hits[:5]:\n    print(f\"  id={h.get('id')}  name={h.get('name')[:80]}\")\n```\n\n```python\n# Broader concept search\nr = requests.post(f\"{CLINPGX}\u002Fsite\u002Fsearch\",\n                  json={\"query\": \"TPMT azathioprine\"}, timeout=15)\nhits = r.json()[\"data\"][\"hits\"]\nprint(f\"TPMT+azathioprine hits: {len(hits)}\")\nfor h in hits[:5]:\n    print(f\"  {h.get('id'):>15}  {h.get('name','')[:80]}\")\n```\n\n### Module 2: Gene, drug, and variant record lookup\n\nThe `\u002Fdata\u002F{type}` endpoints accept simple property filters. All return `{\"data\": [...], \"status\": \"success\"}` — use `view=base` for summary, `view=max` for full nested objects.\n\n```python\nimport requests\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\n\n# Gene by HGNC symbol\ngene = requests.get(f\"{CLINPGX}\u002Fdata\u002Fgene\",\n                    params={\"symbol\": \"CYP2D6\", \"view\": \"base\"}).json()[\"data\"][0]\nprint(f\"{gene['symbol']}  id={gene['id']}  {gene['name']}\")\n\n# Drug by name (lowercase generic preferred)\ndrug = requests.get(f\"{CLINPGX}\u002Fdata\u002Fdrug\",\n                    params={\"name\": \"warfarin\", \"view\": \"base\"}).json()[\"data\"][0]\nprint(f\"{drug['name']}  id={drug['id']}\")\n\n# Variant by rsID\nvar = requests.get(f\"{CLINPGX}\u002Fdata\u002Fvariant\",\n                   params={\"name\": \"rs4149056\", \"view\": \"base\"}).json()[\"data\"][0]\nprint(f\"{var['name']}  id={var['id']}  significance={var.get('clinicalSignificance')}\")\n```\n\n```python\n# Direct record fetch when you already have a PA ID\nr = requests.get(f\"{CLINPGX}\u002Fdata\u002Fdrug\u002FPA449088\", params={\"view\": \"max\"}).json()\nd = r[\"data\"]\nprint(f\"PA449088 → {d['name']}  (objCls={d['objCls']})\")\n```\n\n### Module 3: Clinical annotations\n\n`data\u002FclinicalAnnotation` records associate a variant (`location`) with one or more drugs (`relatedChemicals`) and an evidence level (`levelOfEvidence.term`). The two supported filters are `relatedChemicals.name=` and `levelOfEvidence.term=`. There is **no working `gene=` filter on this endpoint** — see Module 4 for gene-driven access.\n\n```python\nimport requests, pandas as pd\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\n\n# All clinical annotations for clopidogrel\ndata = requests.get(f\"{CLINPGX}\u002Fdata\u002FclinicalAnnotation\",\n                    params={\"relatedChemicals.name\": \"clopidogrel\",\n                            \"view\": \"base\"}).json()[\"data\"]\nprint(f\"clopidogrel annotations: {len(data)}\")\n\nrows = []\nfor ann in data[:10]:\n    loc = ann.get(\"location\") or {}\n    drugs = \", \".join(c.get(\"name\", \"\") for c in ann.get(\"relatedChemicals\", []))\n    rows.append({\n        \"id\": ann[\"id\"],\n        \"variant\": loc.get(\"displayName\"),\n        \"gene\": (loc.get(\"genes\") or [{}])[0].get(\"symbol\"),\n        \"drug\": drugs,\n        \"level\": (ann.get(\"levelOfEvidence\") or {}).get(\"term\"),\n        \"score\": ann.get(\"score\"),\n    })\nprint(pd.DataFrame(rows).to_string(index=False))\n```\n\n```python\n# All Level 1A clinical annotations (highest evidence)\ndata = requests.get(f\"{CLINPGX}\u002Fdata\u002FclinicalAnnotation\",\n                    params={\"levelOfEvidence.term\": \"1A\",\n                            \"view\": \"base\"}).json()[\"data\"]\nprint(f\"Level 1A annotations: {len(data)}\")\n\ndrug_to_count = {}\nfor ann in data:\n    for c in ann.get(\"relatedChemicals\") or []:\n        drug_to_count[c[\"name\"]] = drug_to_count.get(c[\"name\"], 0) + 1\ntop = sorted(drug_to_count.items(), key=lambda x: -x[1])[:10]\nfor d, n in top:\n    print(f\"  {n:3}  {d}\")\n```\n\n### Module 4: Guideline annotations (gene-driven access)\n\n`data\u002FguidelineAnnotation` supports both `relatedGenes.symbol=` and `relatedChemicals.name=`, plus `source=` (`CPIC`, `DPWG`, `CPNDS`, `RNPGx`). This is the canonical way to get gene→guideline coverage.\n\n```python\nimport requests\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\n\n# All CPIC guidelines mentioning CYP2C19\ndata = requests.get(f\"{CLINPGX}\u002Fdata\u002FguidelineAnnotation\",\n                    params={\"relatedGenes.symbol\": \"CYP2C19\",\n                            \"source\": \"CPIC\",\n                            \"view\": \"base\"}).json()[\"data\"]\nprint(f\"CYP2C19 CPIC guidelines: {len(data)}\")\nfor g in data[:5]:\n    print(f\"  PA{g['id']}: {g['name'][:80]}\")\n```\n\n```python\n# Guidelines for a specific drug across all bodies (CPIC, DPWG, …)\ndata = requests.get(f\"{CLINPGX}\u002Fdata\u002FguidelineAnnotation\",\n                    params={\"relatedChemicals.name\": \"clopidogrel\",\n                            \"view\": \"base\"}).json()[\"data\"]\nby_source = {}\nfor g in data:\n    for s in (g.get(\"crossReferences\") or []):\n        by_source.setdefault(s.get(\"resource\", \"?\"), 0)\n        by_source[s[\"resource\"]] = by_source.get(s[\"resource\"], 0) + 1\nprint(f\"clopidogrel guidelines: {len(data)} ({list({g.get('source') for g in data})})\")\n```\n\n### Module 5: Regulatory drug labels (FDA \u002F EMA)\n\n`data\u002Flabel` records are PharmGKB-curated annotations of FDA\u002FEMA pharmacogenomic labeling. Filter by `relatedChemicals.name=` and `source=` (`FDA`, `EMA`, `HCSC`, `PMDA`, `Swissmedic`).\n\n```python\nimport requests, pandas as pd\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\n\ndata = requests.get(f\"{CLINPGX}\u002Fdata\u002Flabel\",\n                    params={\"relatedChemicals.name\": \"warfarin\",\n                            \"source\": \"FDA\",\n                            \"view\": \"base\"}).json()[\"data\"]\nprint(f\"warfarin FDA labels: {len(data)}\")\n\nrows = [{\n    \"name\": d[\"name\"][:60],\n    \"biomarker_status\": d.get(\"biomarkerStatus\"),\n    \"testing_required\": d.get(\"testingRequired\"),\n    \"alternate_drug\": d.get(\"alternateDrugAvailable\"),\n} for d in data]\nprint(pd.DataFrame(rows).to_string(index=False))\n```\n\n### Module 6: CPIC genotype → recommendation chain\n\nCPIC's PostgREST API uses `column=eq.value` for equality and `column=cs.{...}` for JSONB containment. The standard lookup chain is `drug → drugid → recommendation`, optionally filtered by phenotype.\n\n```python\nimport requests\n\nCPIC = \"https:\u002F\u002Fapi.cpicpgx.org\u002Fv1\"\n\n# Resolve drug name to drugid (RxNorm-prefixed)\ndrug = requests.get(f\"{CPIC}\u002Fdrug\",\n                    params={\"name\": \"eq.clopidogrel\"}).json()[0]\nprint(f\"clopidogrel drugid: {drug['drugid']}\")\n\n# All phenotype-specific recommendations for clopidogrel\nrecs = requests.get(f\"{CPIC}\u002Frecommendation\",\n                    params={\"drugid\": f\"eq.{drug['drugid']}\"}).json()\nprint(f\"Total recommendations: {len(recs)}\")\nfor rec in recs[:3]:\n    print(f\"  {rec['phenotypes']}  [{rec['classification']}]\")\n    print(f\"    {rec['drugrecommendation'][:90]}…\")\n```\n\n```python\n# Phenotype filter via jsonb containment (cs.{...})\n# The phenotypes column is a jsonb dict; cs. checks that the query is a subset.\nrecs = requests.get(f\"{CPIC}\u002Frecommendation\",\n                    params={\"drugid\": f\"eq.{drug['drugid']}\",\n                            \"phenotypes\": 'cs.{\"CYP2C19\":\"Poor Metabolizer\"}'}\n                    ).json()\nfor rec in recs:\n    print(f\"  [{rec['classification']}] {rec['drugrecommendation'][:90]}…\")\n\n# Gene-driven: list every drug with a CPIC pair for CYP2C19\npairs = requests.get(f\"{CPIC}\u002Fpair\",\n                     params={\"genesymbol\": \"eq.CYP2C19\"}).json()\nprint(f\"\\nCYP2C19 CPIC pairs: {len(pairs)}\")\ndrug_ids = sorted({p[\"drugid\"] for p in pairs})\nprint(f\"Sample drug IDs: {drug_ids[:5]}\")\n```\n\n## Key Concepts\n\n### Two-host architecture\n\n| Question                                        | Use                                 | Why                                                                              |\n| ----------------------------------------------- | ----------------------------------- | -------------------------------------------------------------------------------- |\n| What clinical annotations exist for this drug?  | ClinPGx `data\u002FclinicalAnnotation`   | Annotation-level evidence with curated levelOfEvidence.term                      |\n| What CPIC guidelines cover this gene?           | ClinPGx `data\u002FguidelineAnnotation`  | Filter by `relatedGenes.symbol`; no working `gene=` filter on clinicalAnnotation |\n| Given phenotype X, what should I prescribe?     | CPIC `recommendation` + `phenotypes`| Structured genotype→action rows; CPIC is the prescribing-rule oracle             |\n| What FDA labels mention this drug + gene?       | ClinPGx `data\u002Flabel?source=FDA`     | Curated regulatory PGx labeling                                                  |\n| Free-text \"anything about X\"                    | ClinPGx `POST \u002Fsite\u002Fsearch`         | Cross-record-type fan-out                                                        |\n\n### PharmGKB \u002F ClinPGx evidence levels\n\nLevels 1A → 4 in decreasing evidence quality:\n- **1A** — Annotation of a variant–drug pair in a clinical guideline or FDA label (strongest)\n- **1B** — Significant association replicated in multiple studies\n- **2A** — Variant in a known PGx gene, significant association\n- **2B** — Moderate evidence, often single study\n- **3** — Limited evidence (single study or unreplicated)\n- **4** — Case reports \u002F biological plausibility only\n\nFilter via `levelOfEvidence.term` on `data\u002FclinicalAnnotation`. The term is a *string*, not an enum (`\"1A\"` not `1A`).\n\n### ClinPGx response envelope and view modes\n\nEvery ClinPGx `\u002Fdata\u002F...` response is `{\"data\": [...] | {...}, \"status\": \"success\" | \"fail\"}`. On failure the body is `{\"status\": \"fail\", \"data\": {\"errors\": [{\"message\": \"...\"}]}}` — always read both keys.\n\n- `view=base` (default) — flat summary record; recommended for bulk filters\n- `view=max` — full nested objects (relatedDiseases, allelePhenotypes, scoreDetails, …). Larger payload, slower; use only for single-record details.\n\n## Common Workflows\n\n### Workflow 1: Pharmacogene panel CPIC coverage\n\n**Goal:** Given a patient's pharmacogene panel, count how many CPIC guideline annotations cover each gene.\n\n```python\nimport requests, pandas as pd, time\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\npharmacogenes = [\"CYP2D6\", \"CYP2C19\", \"CYP2C9\", \"DPYD\", \"TPMT\", \"SLCO1B1\"]\n\nrows = []\nfor g in pharmacogenes:\n    data = requests.get(f\"{CLINPGX}\u002Fdata\u002FguidelineAnnotation\",\n                        params={\"relatedGenes.symbol\": g,\n                                \"source\": \"CPIC\", \"view\": \"base\"},\n                        timeout=20).json()[\"data\"]\n    drugs = sorted({c[\"name\"] for guideline in data\n                                for c in (guideline.get(\"relatedChemicals\") or [])})\n    rows.append({\"gene\": g, \"cpic_guidelines\": len(data),\n                 \"n_drugs\": len(drugs), \"sample\": \", \".join(drugs[:3])})\n    time.sleep(0.3)\n\ndf = pd.DataFrame(rows).sort_values(\"cpic_guidelines\", ascending=False)\nprint(df.to_string(index=False))\ndf.to_csv(\"pharmacogene_cpic_coverage.csv\", index=False)\n```\n\n### Workflow 2: Drug panel — CPIC prescribing rule lookup\n\n**Goal:** Given a prescribed drug list, identify which have CPIC genotype-specific recommendations and surface the rule rows.\n\n```python\nimport requests, pandas as pd, time\n\nCPIC = \"https:\u002F\u002Fapi.cpicpgx.org\u002Fv1\"\ndrugs = [\"warfarin\", \"clopidogrel\", \"codeine\", \"simvastatin\",\n         \"metoprolol\", \"omeprazole\", \"azathioprine\", \"tacrolimus\"]\n\nrows = []\nfor name in drugs:\n    drug = requests.get(f\"{CPIC}\u002Fdrug\", params={\"name\": f\"eq.{name}\"}, timeout=15).json()\n    if not drug:\n        rows.append({\"drug\": name, \"in_cpic\": False, \"n_recs\": 0, \"phenotypes\": \"\"}); continue\n    did = drug[0][\"drugid\"]\n    recs = requests.get(f\"{CPIC}\u002Frecommendation\",\n                        params={\"drugid\": f\"eq.{did}\"}, timeout=15).json()\n    phens = sorted({f\"{k}={v}\" for rec in recs\n                                  for k, v in (rec.get(\"phenotypes\") or {}).items()})\n    rows.append({\"drug\": name, \"in_cpic\": True, \"n_recs\": len(recs),\n                 \"phenotypes\": \"; \".join(phens[:3])})\n    time.sleep(0.3)\n\ndf = pd.DataFrame(rows).sort_values([\"in_cpic\", \"n_recs\"], ascending=[False, False])\nprint(df.to_string(index=False))\n```\n\n### Workflow 3: Variant → drug interactions (rsID-driven)\n\n**Goal:** Starting from a single rsID (e.g., SLCO1B1 *5 = rs4149056), find every clinical annotation that involves it.\n\nThe Data API does **not** accept rsID as a filter property. Use `POST \u002Fsite\u002Fsearch` to discover related annotation IDs, then fetch each by ID.\n\n```python\nimport requests\n\nCLINPGX = \"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\"\nrsid = \"rs4149056\"\n\nhits = requests.post(f\"{CLINPGX}\u002Fsite\u002Fsearch\",\n                     json={\"query\": rsid}, timeout=15).json()[\"data\"][\"hits\"]\nprint(f\"{rsid}: {len(hits)} hits\")\n\n# Filter hits that look like clinical annotations\nann_hits = [h for h in hits if h.get(\"name\", \"\").lower().startswith(\"clinical annotation\")]\nprint(f\"Clinical-annotation hits: {len(ann_hits)}\")\nfor h in ann_hits[:5]:\n    print(f\"  id={h['id']}  {h['name'][:90]}\")\n\n# Dereference one annotation by ID for full detail\nif ann_hits:\n    ann = requests.get(f\"{CLINPGX}\u002Fdata\u002FclinicalAnnotation\u002F{ann_hits[0]['id']}\",\n                       params={\"view\": \"max\"}, timeout=15).json()[\"data\"]\n    drugs = \", \".join(c[\"name\"] for c in (ann.get(\"relatedChemicals\") or []))\n    print(f\"\\nFirst annotation:\")\n    print(f\"  drugs: {drugs}\")\n    print(f\"  level: {(ann.get('levelOfEvidence') or {}).get('term')}\")\n```\n\n## Key Parameters\n\n| Parameter                   | Module \u002F Endpoint                              | Default | Range \u002F Options                                          | Effect                                                                  |\n| --------------------------- | ---------------------------------------------- | ------- | -------------------------------------------------------- | ----------------------------------------------------------------------- |\n| `view`                      | all `\u002Fdata\u002F...`                                | `base`  | `base`, `min`, `max`                                     | Field detail level; `max` includes all nested arrays (slow but complete) |\n| `relatedChemicals.name`     | `clinicalAnnotation`, `variantAnnotation`, `guidelineAnnotation`, `label`, `pathway` | — | lowercase generic drug name                              | Filter records related to a drug                                        |\n| `relatedGenes.symbol`       | `guidelineAnnotation`, `pathway`               | —       | HGNC gene symbol                                         | Filter records related to a gene (not available on `clinicalAnnotation`) |\n| `levelOfEvidence.term`      | `clinicalAnnotation`                           | —       | `\"1A\"`, `\"1B\"`, `\"2A\"`, `\"2B\"`, `\"3\"`, `\"4\"`             | Minimum evidence level                                                  |\n| `source`                    | `guidelineAnnotation`, `label`                 | —       | `CPIC`, `DPWG`, `FDA`, `EMA`, `HCSC`, `PMDA`, `Swissmedic` | Issuing body                                                            |\n| `symbol`                    | `data\u002Fgene`                                    | —       | HGNC gene symbol                                         | Gene record lookup                                                      |\n| `name`                      | `data\u002Fdrug`, `data\u002Fvariant`                    | —       | drug name or rsID                                        | Record lookup by canonical name                                         |\n| CPIC `column=eq.value`      | all `api.cpicpgx.org\u002Fv1\u002F...`                   | —       | PostgREST equality                                       | Filter by exact match                                                   |\n| CPIC `phenotypes=cs.{json}` | `recommendation`                               | —       | JSON-encoded jsonb subset                                | Filter by phenotype containment (must URL-encode if special chars)      |\n\n## Best Practices\n\n1. **Resolve PA identifiers once.** Never hand-construct ClinPGx PA IDs. Call `data\u002F{type}?{symbol|name}=...` (or `site\u002Fsearch`) once and cache the returned `id` for reuse — `gene\u002FPA128` for CYP2D6, `drug\u002FPA449088` for clopidogrel, `variant\u002FPA166154579` for rs4149056.\n\n2. **Pick the right host for the question.** Use ClinPGx for `what is annotated` and CPIC for `what to prescribe`. Trying to derive genotype-specific recommendations from ClinPGx alone misses the structured `recommendation.phenotypes` rows.\n\n3. **Filter by evidence level upfront** when building clinical workflows. `levelOfEvidence.term=1A` returns 312 actionable annotations across all of ClinPGx; Level 3\u002F4 records are exploratory and shouldn't drive prescribing.\n\n4. **Don't filter `clinicalAnnotation` by gene — filter by `guidelineAnnotation`** with `relatedGenes.symbol`. The `clinicalAnnotation` endpoint has no working gene property and returns HTTP 400 for any attempt.\n\n5. **Use `view=base` for bulk filters, `view=max` for single-record drill-downs.** A list query with `view=max` can time out or hit 429; the difference is roughly 5–10× payload size.\n\n6. **Throttle the ClinPGx host.** Insert `time.sleep(0.3)` between sequential queries in loops; the API returns occasional HTTP 429s on tight loops. CPIC tolerates faster iteration.\n\n7. **URL-encode `cs.{...}` jsonb filters** when phenotype values contain spaces or special characters. `requests.get(..., params={\"phenotypes\": 'cs.{\"CYP2C19\":\"Poor Metabolizer\"}'})` works because `requests` does the encoding; a manual URL string needs `urllib.parse.quote`.\n\n## Common Recipes\n\n### Recipe 1 — Free-text discovery via site\u002Fsearch\n\nWhen to use: you have an arbitrary string (rsID, drug name, gene, allele) and want to find related ClinPGx records without knowing which endpoint to hit.\n\n```python\nimport requests\nr = requests.post(\"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\u002Fsite\u002Fsearch\",\n                  json={\"query\": \"VKORC1 warfarin\"}, timeout=15)\nhits = r.json()[\"data\"][\"hits\"]\nfor h in hits[:10]:\n    print(f\"  {h.get('id'):>15}  {h.get('name','')[:80]}\")\n```\n\n### Recipe 2 — Top drugs by Level 1A annotation count\n\nWhen to use: build a leaderboard of the most actionable PGx drugs.\n\n```python\nimport requests, pandas as pd\ndata = requests.get(\"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\u002Fdata\u002FclinicalAnnotation\",\n                    params={\"levelOfEvidence.term\": \"1A\", \"view\": \"base\"},\n                    timeout=30).json()[\"data\"]\ncounts = {}\nfor ann in data:\n    for c in ann.get(\"relatedChemicals\") or []:\n        counts[c[\"name\"]] = counts.get(c[\"name\"], 0) + 1\ndf = pd.DataFrame(sorted(counts.items(), key=lambda x: -x[1]),\n                  columns=[\"drug\", \"n_1A_annotations\"]).head(15)\nprint(df.to_string(index=False))\n```\n\n### Recipe 3 — Patient genotype → drug recommendations\n\nWhen to use: given a phenotype call from a PGx test, surface every CPIC recommendation row.\n\n```python\nimport requests\nCPIC = \"https:\u002F\u002Fapi.cpicpgx.org\u002Fv1\"\n\ngenotype = {\"CYP2C19\": \"Poor Metabolizer\"}\ndrug = \"clopidogrel\"\n\ndid = requests.get(f\"{CPIC}\u002Fdrug\", params={\"name\": f\"eq.{drug}\"}).json()[0][\"drugid\"]\nimport json\nrecs = requests.get(f\"{CPIC}\u002Frecommendation\",\n                    params={\"drugid\": f\"eq.{did}\",\n                            \"phenotypes\": f\"cs.{json.dumps(genotype)}\"}).json()\nfor rec in recs:\n    print(f\"[{rec['classification']}] {rec['drugrecommendation']}\")\n    print(f\"  implications: {rec['implications']}\")\n```\n\n### Recipe 4 — Robust session with retry\n\nWhen to use: long-running loops over many genes \u002F drugs \u002F variants.\n\n```python\nimport requests\nfrom requests.adapters import HTTPAdapter\nfrom urllib3.util.retry import Retry\n\ns = requests.Session()\ns.headers.update({\"Accept\": \"application\u002Fjson\"})\ns.mount(\"https:\u002F\u002F\", HTTPAdapter(max_retries=Retry(\n    total=4, backoff_factor=1.0,\n    status_forcelist=[429, 500, 502, 503, 504],\n    allowed_methods=[\"GET\", \"POST\"])))\n\nr = s.get(\"https:\u002F\u002Fapi.clinpgx.org\u002Fv1\u002Fdata\u002Fgene\",\n          params={\"symbol\": \"CYP2D6\", \"view\": \"base\"}, timeout=20)\nr.raise_for_status()\nprint(r.json()[\"data\"][0][\"name\"])\n```\n\n## Troubleshooting\n\n| Problem                                                                                   | Cause                                                                                              | Solution                                                                                                                            |\n| ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| HTTP 404\u002F405 on `https:\u002F\u002Fapi.pharmgkb.org\u002Fv1\u002F...`                                         | Old PharmGKB host is dead; the service rebranded to ClinPGx in 2024                                | Migrate to `https:\u002F\u002Fapi.clinpgx.org\u002Fv1\u002F...`. Old `\u002FclinicalAnnotation?gene=X` is now `data\u002FclinicalAnnotation` with different filters. |\n| `{\"status\":\"fail\",\"data\":{\"errors\":[{\"message\":\"No such property: 'gene'\"}]}}`            | `data\u002FclinicalAnnotation` does **not** accept `gene=` or `relatedGenes.symbol=`                    | Use `data\u002FguidelineAnnotation?relatedGenes.symbol=X` for gene-driven access, or `?relatedChemicals.name=Y` for drug-driven.        |\n| `{\"status\":\"fail\",\"data\":{\"errors\":[{\"message\":\"Missing criteria.\"}]}}`                   | A `data\u002F{type}` list query has no filter and no ID                                                 | Add at least one filter (`name=`, `symbol=`, `relatedChemicals.name=`, …) or fetch by ID via `data\u002F{type}\u002F{paId}`.                  |\n| HTTP 405 on `GET \u002Fsite\u002Fsearch?query=...`                                                  | `site\u002Fsearch` only accepts POST with a JSON body                                                   | Use `requests.post(url, json={\"query\": \"...\"})`.                                                                                    |\n| HTTP 429 mid-loop                                                                         | Hit ClinPGx rate limit                                                                             | Insert `time.sleep(0.3–0.5)` between calls; use the Retry session in Recipe 4.                                                      |\n| HTTP 400 on `https:\u002F\u002Fapi.cpicpgx.org\u002Fv1\u002Frecommendation?phenotypes=cs.{...}`               | The `cs.` JSON wasn't URL-encoded                                                                  | Pass via `requests` `params={\"phenotypes\": 'cs.{\"CYP2C19\":\"Poor Metabolizer\"}'}` (auto-encoded) or `urllib.parse.quote` manually.    |\n| Empty `data` list for an obviously-real drug                                              | Drug name mismatch (brand vs. generic; capitalization)                                             | Try lowercase generic name; fall back to `POST \u002Fsite\u002Fsearch` to fan out and find the canonical PA ID.                              |\n| `data\u002Fvariant?name=rs...` returns 1 record but `data\u002FclinicalAnnotation?location.name=rs...` returns 404 | rsID is stored under `location.displayName`\u002F`location.rsid`, not exposed as a filterable property | Use `site\u002Fsearch` to discover annotation IDs by rsID, then dereference each with `data\u002FclinicalAnnotation\u002F{id}`. (Workflow 3.)      |\n\n## Related Skills\n\n- `clinvar-database` — germline pathogenicity \u002F clinical significance for variants found in PharmGKB (complementary; ClinVar is disease-focused, ClinPGx is drug-response-focused)\n- `opentargets-database` — drug-target associations and safety signals overlapping ClinPGx pharmacogene targets\n- `chembl-database-bioactivity` — bioactivity and binding data for the drugs annotated in ClinPGx\n- `cosmic-database` — somatic cancer mutations and tumor-specific PGx (orthogonal to germline PGx covered here)\n\n## References\n\n- [ClinPGx (formerly PharmGKB) website](https:\u002F\u002Fwww.clinpgx.org\u002F) — Database front end; web links match the `data\u002F{type}\u002F{paId}` URL shape\n- [ClinPGx REST API documentation](https:\u002F\u002Fwww.clinpgx.org\u002Fpage\u002FwebResources) — Official endpoint reference, `data\u002F...` and `site\u002Fsearch` schemas\n- [CPIC API documentation](https:\u002F\u002Fapi.cpicpgx.org\u002F) — Swagger UI for the PostgREST companion API\n- [CPIC guidelines](https:\u002F\u002Fcpicpgx.org\u002Fguidelines\u002F) — Source of `recommendation` rows; canonical genotype-prescribing oracle\n- [Relling & Klein (2011) Nature Reviews Drug Discovery — PharmGKB foundational paper](https:\u002F\u002Fdoi.org\u002F10.1038\u002Fnrd3499)\n- [Whirl-Carrillo et al. (2021) Clin Pharmacol Ther — PharmGKB data architecture update](https:\u002F\u002Fdoi.org\u002F10.1002\u002Fcpt.2350)\n",{"name":5,"license":15,"description":7},"master","63f17866001c5ca854bf2fa0b678ce277133de5b","skills\u002Fawesome-skills\u002Fclinpgx-database",0,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS","https:\u002F\u002Fbg-szy.github.io\u002FTOP-SKILLS\u002F","https:\u002F\u002Fgithub.com\u002Fbg-szy","https:\u002F\u002Fwww.ecust.edu.cn\u002F","a student of East China University of Science and Technology","2026-11-15 03:38:02",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add bg-szy\u002FTOP-SKILLS --skill clinpgx-database",{"tool":40,"command":41},"bunx","bunx skills add bg-szy\u002FTOP-SKILLS --skill clinpgx-database",{"tool":43,"command":44},"pnpm","pnpm dlx skills add bg-szy\u002FTOP-SKILLS --skill clinpgx-database","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fawesome-skills\u002Fclinpgx-database\u002FSKILL.md",true,[],[49,58,65,72,79,86],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":57},"01M7DXW9N826PKXK174PVW3038","serpmaven","Scrape Google search results (SERP) to JSON with SERP Maven (serpmaven) - a real Chrome browser on a residential proxy with sticky sessions. Run it as a CLI, a Python library, a local HTTP search API (`serve`), an MCP server or a Docker image; set the proxy login, workers, pages and cost tracking. Use when the user wants Google results, rank tracking, a self-hosted SERP API, or live Google search for an AI agent.","MIT","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fserpmaven\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":57},"01M7DXVHSTWDV65475QEQ915M7","revnu-landing-page-audit","Find out why a landing page isn't turning visitors into signups, demos or sales. Audits one page against what the ad, post or search that sends people there promised, then checks the first screen, proof, call to action, friction and mobile. Returns at most 7 prioritized fixes, plus what is fine and what could not be checked; rewrites specific lines and fixes the page in the repo when asked. Never promises a conversion lift. Works without a Revnu account. Use when the user says or asks: \"audit my landing page\", \"why isn't this page converting\", \"review my homepage\", \"my ads get clicks but no signups\", \"people bounce from the pricing page\", \"CRO review\", \"improve conversion rate\", \"is my hero section clear\", \"roast my landing page\", \"rewrite my headline\", \"what's wrong with this page\", \"landing page feedback\", \"make the signup page convert better\". Not for SEO or AI-search audits, page speed engineering on its own, or building a new page from scratch.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-landing-page-audit\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":57},"01M7DXV8X2D7B3VTD4HHYYHTGR","revnu-growth-context","Write down once who buys, what they're stuck on, what it costs, what proof you have and what you've already tried, so every growth task starts from facts instead of a questionnaire. Creates or updates .agents\u002Frevnu-growth.md from the repo, the live site and the user, and imports an existing product-marketing.md. Use when the user says \"set up our marketing context\", \"who is our ideal customer\", \"write our ICP\", \"describe the product for marketing\", \"positioning doc\", \"what's our brand voice\", \"remember this about our customers\", \"log what we tried\", \"what have we learned from marketing\", \"we changed pricing, update the context\", \"update our growth notes\", \"summarize the business for the agent\", \"import my product-marketing.md\", \"start a growth doc\", or before a first marketing, SEO, outreach or launch task when no context file exists. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-growth-context\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":57},"01M7DXV0DGJ1G0A60PAHC6J3C5","revnu-get-listed","Get onto the third-party pages AI answers and search cite when buyers ask for the best tool in your category: \"best X\" roundups, directories, review sites, GitHub awesome lists, community threads and comparison pages. Finds which ones are cited, ranks them by fit and effort, and drafts each submission, PR or pitch by the target's own rules. Use when the user says \"get us listed\", \"which directories should we submit to\", \"how do we get into best-of lists\", \"why does ChatGPT recommend competitors and not us\", \"get mentioned in AI answers\", \"submit to awesome lists\", \"get on G2\", \"where are our competitors listed\", \"pitch listicle authors\", \"find backlink opportunities\", \"launch directories\", \"get into roundups\", \"Product Hunt alternatives\", \"where should we be listed\", \"get cited by Perplexity\". Never submits, pays or posts without a yes. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-get-listed\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":57},"01M7DXTSPMGT9D6DSS0HP9BSTA","revnu-ai-readiness-audit","Audit whether your website gives ChatGPT, Perplexity, Claude, Gemini and Google's AI Overviews something worth quoting, and fix the pages that don't. Use when the user says or asks \"is my site ready for AI search\", \"audit my site for AI answers\", \"AEO audit\", \"GEO audit\", \"why doesn't ChatGPT quote our pricing\", \"make our pages citable by AI\", \"do I need llms.txt\", \"does schema help with ChatGPT\", \"check our structured data\", \"is our content visible without JavaScript\", \"AI SEO audit\", \"optimize our homepage for AI answers\", \"LLM SEO check\", \"why does AI get our product wrong\", \"fix our site for AI Overviews\". Checks fetchability and indexability, answers in the raw HTML, entity facts, schema (including JS-injected markup), headings, dates and llms.txt, then gives at most 10 prioritised fixes and edits the repo when asked. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-ai-readiness-audit\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":57},"01M7DXSZHCVTRS620GC3S97JZV","proxy-troubleshooting","Diagnose residential proxy failures, with NodeMaven's gateway as the reference - 407 with correct credentials, 406, 410, 500, a connection that hangs, ERR_TUNNEL_CONNECTION_FAILED in a browser, Playwright or Puppeteer ignoring proxy credentials, a sticky session that changes IP, geo-targeting that is silently ignored, passwords with special characters, and unexpected traffic from headless Chrome. Use when a proxy connection fails, returns the wrong location, or costs more traffic than expected.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fproxy-troubleshooting\u002FSKILL.md",[],[]]