# Monarch Gene-Disease-Phenotype Associations Scraper (`ninhothedev/monarch-associations-scraper`) Actor

$0.5/1K 🔥 Monarch Associations! Map gene-disease-phenotype associations across species. No key. JSON, CSV, Excel or API in seconds. Accelerate translational biology research ⚡

- **URL**: https://apify.com/ninhothedev/monarch-associations-scraper.md
- **Developed by:** [ninhothedev](https://apify.com/ninhothedev) (community)
- **Categories:** Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Monarch Gene-Disease-Phenotype Associations Scraper

Extract **genes, diseases, phenotypes and the associations between them** from the
[Monarch Initiative](https://monarchinitiative.org/) knowledge graph - the
cross-resource, cross-species association layer that integrates OMIM, Orphanet,
ClinGen, HPO, MGI, ZFIN and dozens of other sources into one graph. **No API key,
no login.**

Runs against the free Monarch v3 API (`api.monarchinitiative.org`). Roughly
**~$0.50 per 1,000 records** on the Apify platform.

### What it does

Two modes:

| Mode | Input | Output |
|------|-------|--------|
| `search` | free-text `queries` (disease / gene / phenotype) | matching **entities** with ids, categories, synonyms, taxa, descriptions |
| `associations` | `entityIds` (biolink CURIEs like `MONDO:0007947`) | **association edges** - subject, predicate, object, evidence, publications, knowledge source |

In `associations` mode both directions are queried (subject **and** object), so a
disease id returns its gene-to-disease edges (disease as object) **and** its
disease-to-phenotype edges (disease as subject).

#### Example (verified live)

`search` for `Marfan syndrome` -> `MONDO:0007947`. Feed that into
`associations` (category `gene to disease`) and you get:

```
FBN1  causes  Marfan syndrome   (source: OMIM)
FBN1  causes  Marfan syndrome   (source: ClinGen)
```

...plus 180+ disease-to-phenotype edges (Mitral regurgitation, Emphysema, ...).

### How is this different from the HPO Phenotype Scraper?

- **[HPO Phenotype Scraper](https://apify.com/ninhothedev/hpo-phenotype-scraper)**
  scrapes the **Human Phenotype Ontology** itself - the controlled vocabulary of
  phenotypic abnormalities (HP terms, definitions, ontology hierarchy). It is a
  single ontology.
- **This Monarch scraper** is the **cross-resource association layer**: it does not
  own an ontology, it *connects* them - linking genes (HGNC) to diseases (MONDO) to
  phenotypes (HP) across species, with evidence and provenance. Use HPO to browse
  the phenotype vocabulary; use Monarch to ask "which genes cause this disease and
  what phenotypes does it present?"

### Input

| Field | Type | Notes |
|-------|------|-------|
| `mode` | select | `search` (default) or `associations` |
| `queries` | array | search mode; prefilled `["diabetes","Marfan syndrome"]` |
| `entityIds` | array | associations mode; e.g. `["MONDO:0007947"]` |
| `associationCategory` | select | `any` / `gene_to_disease` / `gene_to_phenotype` / `disease_to_phenotype` |
| `searchCategory` | select | `any` / `Disease` / `Gene` / `PhenotypicFeature` |
| `maxItems` | integer | default 200, max 3000 |

### Output

**Entity** (`search`): `entity_id`, `name`, `category`, `description`, `symbol`,
`taxon`, `synonyms`, `url`, `source`, `scraped_at`.

**Association** (`associations`): `association_id`, `subject_id`, `subject_label`,
`predicate`, `object_id`, `object_label`, `association_category`, `evidence_count`,
`publication_count`, `publications`, `knowledge_source`, `source`, `scraped_at`.

The `biolink:` prefix is stripped from categories and predicates.

### Use cases

- **Rare disease research** - resolve a disease to its causal genes and full
  phenotype profile in one run.
- **Gene prioritisation** - rank candidate genes by disease/phenotype associations
  and evidence counts.
- **Knowledge graphs** - bulk-export subject-predicate-object triples with
  provenance to seed your own graph.
- **Translational medicine** - bridge model-organism findings to human disease via
  cross-species associations.

### Related actors

- [HPO Phenotype Scraper](https://apify.com/ninhothedev/hpo-phenotype-scraper) - the phenotype ontology
- [NCBI E-utilities Scraper](https://apify.com/ninhothedev/ncbi-eutils-scraper) - PubMed / gene / nucleotide records
- [Clinical Trials Scraper](https://apify.com/ninhothedev/clinical-trials-scraper) - ClinicalTrials.gov studies
- [Reactome Pathways Scraper](https://apify.com/ninhothedev/reactome-pathways-scraper) - biological pathways

### Notes

Data belongs to the Monarch Initiative and its source resources; respect their
licences. This actor is an unofficial convenience wrapper and is not affiliated
with Monarch.

# Actor input Schema

## `mode` (type: `string`):

What to fetch. 'search' resolves free-text queries to Monarch entities (genes, diseases, phenotypes). 'associations' pulls association edges for the entity ids you supply.

## `queries` (type: `array`):

Used in 'search' mode. Free-text terms (disease, gene symbol or phenotype) to look up in the Monarch knowledge graph.

## `entityIds` (type: `array`):

Used in 'associations' mode. Monarch/biolink CURIEs such as MONDO:0007947 (Marfan syndrome), HGNC:3603 (FBN1) or HP:0001653 (a phenotype). Edges are fetched for both subject and object directions.

## `associationCategory` (type: `string`):

Used in 'associations' mode. Filter edges by biolink association type. 'any' returns every association direction and type.

## `searchCategory` (type: `string`):

Used in 'search' mode. Restrict search results to a single biolink node type, or 'any' for all types.

## `maxItems` (type: `integer`):

Maximum number of records (entities or associations) to push to the dataset across all queries / entity ids.

## Actor input object example

```json
{
  "mode": "search",
  "queries": [
    "diabetes",
    "Marfan syndrome"
  ],
  "entityIds": [
    "MONDO:0007947"
  ],
  "associationCategory": "any",
  "searchCategory": "any",
  "maxItems": 200
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "queries": [
        "diabetes",
        "Marfan syndrome"
    ],
    "entityIds": [
        "MONDO:0007947"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/monarch-associations-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "queries": [
        "diabetes",
        "Marfan syndrome",
    ],
    "entityIds": ["MONDO:0007947"],
}

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/monarch-associations-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": [
    "diabetes",
    "Marfan syndrome"
  ],
  "entityIds": [
    "MONDO:0007947"
  ]
}' |
apify call ninhothedev/monarch-associations-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ninhothedev/monarch-associations-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/pqARX9OgYLrwvUOU1/builds/aWIuFRTOYSWXefgdN/openapi.json
