# Open Targets Drug Disease Scraper (`zerobreak/open-targets-drug-disease-scraper`) Actor

Open Targets Drug-Disease Scraper is a Python tool to extract target-disease association scores, drug mechanisms of action, clinical trial phases, and therapeutic evidence metrics from the Open Targets Platform GraphQL API. It exports structured datasets into clean CSV or JSON formats

- **URL**: https://apify.com/zerobreak/open-targets-drug-disease-scraper.md
- **Developed by:** [ZeroBreak](https://apify.com/zerobreak) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Open Targets Drug-Disease Scraper — Collect disease associations and target evidence

![Open Targets Drug-Disease Scraper cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/open-targets-drug-disease-scraper-cover.png)

Open Targets Drug-Disease Scraper collects publicly available information about biological targets, diseases, and their associations from the Open Targets Platform. Search for entities by keyword or retrieve targets associated with a specific disease identifier. Export the collected records as JSON, CSV, Excel, or other supported dataset formats.

### Features

- **Entity search:** Find Open Targets records using keywords such as `diabetes`.
- **Disease-associated targets:** Retrieve targets linked to EFO or MONDO disease identifiers.
- **Association scores:** Collect available scores to help assess target-disease associations.
- **Detailed records:** Capture entity names, descriptions, identifiers, and entity types.
- **Duplicate prevention:** Avoid collecting the same record ID more than once during a run.
- **Flexible exports:** Save results in multiple dataset formats for research and analysis.

### Collection Modes

| Mode | Description |
|---|---|
| `search` | Find Open Targets entities matching a search query. |
| `disease_targets` | Retrieve targets associated with a specified disease identifier, including available association scores. |

### Input Parameters

| Parameter | Description | Example |
|---|---|---|
| `mode` | Selects the collection mode: `search` or `disease_targets`. | `search` |
| `query` | Keyword used to search for Open Targets entities. | `diabetes` |
| `diseaseId` | EFO or MONDO disease identifier used in disease-target mode. | `MONDO_0005015` |
| `maxItems` | Maximum number of records to collect. | `50` |
| `requestDelayMs` | Delay between requests in milliseconds. | `500` |

### Example Input

**Search for entities**

```json
{
  "mode": "search",
  "query": "diabetes",
  "maxItems": 50,
  "requestDelayMs": 500
}
```

**Find targets associated with a disease**

```json
{
  "mode": "disease_targets",
  "diseaseId": "MONDO_0005015",
  "maxItems": 50,
  "requestDelayMs": 500
}
```

### What Data Does This Actor Extract?

The actor collects available entity and association information, including:

| Field | Description |
|---|---|
| `recordId` | Identifier of the collected entity or record. |
| `entity` | Entity category, such as disease or target. |
| `name` | Name of the entity. |
| `entityDescription` | Description of the entity, when available. |
| `associationScore` | Association score, when available. |
| `diseaseId` | Associated disease identifier, when available. |
| `diseaseName` | Associated disease name, when available. |
| `scrapedAt` | Timestamp indicating when the record was collected. |

The available fields depend on the selected collection mode and the information returned for each record.

### Example Output

```json
{
  "recordId": "MONDO_0005015",
  "entity": "disease",
  "name": "diabetes mellitus",
  "entityDescription": "A metabolic disorder characterized by abnormally high blood sugar levels due to diminished production of insulin or insulin resistance/desensitization.",
  "associationScore": null,
  "diseaseId": null,
  "diseaseName": null,
  "scrapedAt": "2026-10-26T00:00:00+00:00"
}
```

### Use Cases

- **Drug discovery research:** Collect disease- and drug-related search results for further investigation.
- **Target prioritization:** Retrieve disease-associated targets and their available association scores.
- **Bioinformatics research:** Build structured datasets of biological entities and disease relationships.
- **Dataset building:** Maintain searchable CSV or Excel collections of relevant Open Targets records.
- **Research workflows:** Prepare target-disease evidence for downstream analysis and visualization.

### Working with Your Dataset

After the actor finishes, open its dataset to review the collected records.

Export the results as JSON, CSV, Excel, or other supported formats for spreadsheet analysis, research workflows, and data visualization.

### FAQ

**Who is this actor for?**

It is designed for researchers, bioinformaticians, drug discovery teams, and analysts working with biological targets and disease associations.

**What collection modes are available?**

You can search for entities using keywords or retrieve targets associated with a specific disease identifier.

**Which disease identifiers are supported?**

Disease-target mode accepts EFO or MONDO identifiers.

**Are association scores included?**

Yes. Disease-target results include association scores when they are available.

**Can I run the actor on a schedule?**

Yes. You can configure recurring runs using Apify schedules to refresh your search or disease-target datasets.

### Disclaimer

This actor is an independent tool and is not affiliated with, endorsed by, sponsored by, or officially associated with Open Targets Platform or its owners. Users are responsible for reviewing and complying with applicable data-use and licensing requirements.

### Is Web Scraping Legal?

Collecting information that is already public is generally legal. There is no single law that bans all forms of web scraping. The limits are the usual ones: do not break into accounts, do not take private or confidential data, and be careful with personal data and copyrighted works. A site's terms can also restrict how you access it. Facts such as a public name, price, or rating are not the same thing as republishing someone's article or photo.

This actor collects information from public pages. It does not log in and it does not bypass access controls.

For a longer explanation, see Apify's article [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

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

What to collect from Open Targets Platform GraphQL.

## `query` (type: `string`):

Search text for search mode (tested value: diabetes).

## `diseaseId` (type: `string`):

EFO or MONDO disease id for disease_targets mode (tested value: MONDO_0005015).

## `entityTypes` (type: `array`):

Optional Open Targets entityNames filter for search (e.g. target, disease, drug).

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

Stop after this many successful rows. Hard max is 1000.

## `requestDelayMs` (type: `integer`):

Milliseconds to wait between GraphQL requests.

## `userAgent` (type: `string`):

User-Agent header sent with each request.

## `timeoutSecs` (type: `integer`):

Overall run budget in seconds.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

## `proxyConfiguration` (type: `object`):

Optional proxy. Leave off unless you need it.

## Actor input object example

```json
{
  "mode": "search",
  "query": "diabetes",
  "diseaseId": "MONDO_0005015",
  "entityTypes": [],
  "maxItems": 100,
  "requestDelayMs": 500,
  "userAgent": "ActorResearch/1.0",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset rows in the overview table.

## `dataset` (type: `string`):

Full dataset for this run.

## `items` (type: `string`):

Dataset items as JSON.

# 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 = {
    "query": "diabetes",
    "diseaseId": "MONDO_0005015"
};

// Run the Actor and wait for it to finish
const run = await client.actor("zerobreak/open-targets-drug-disease-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 = {
    "query": "diabetes",
    "diseaseId": "MONDO_0005015",
}

# Run the Actor and wait for it to finish
run = client.actor("zerobreak/open-targets-drug-disease-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 '{
  "query": "diabetes",
  "diseaseId": "MONDO_0005015"
}' |
apify call zerobreak/open-targets-drug-disease-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zerobreak/open-targets-drug-disease-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/kbU7qgXmdmM3M23oW/builds/9jIcKOtS4mbpoTsuF/openapi.json
