# ChEMBL Bioactivity and Compounds Data Scraper (`plainkitbin/chembl-bioactivity-compounds`) Actor

Fetch ChEMBL bioactivity measurements and compound records from the public EMBL-EBI ChEMBL REST API as structured JSON rows. Rows stay under CC BY-SA 3.0 with EMBL-EBI attribution. Not affiliated with EMBL-EBI.

- **URL**: https://apify.com/plainkitbin/chembl-bioactivity-compounds.md
- **Developed by:** [PlainKit bin](https://apify.com/plainkitbin) (community)
- **Categories:** Business, AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 chembl bioactivity records

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/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

## ChEMBL Bioactivity and Compounds Data Scraper

### Introduction

Medicinal chemists, bioinformatics teams, biotech analysts and data engineers who need ChEMBL data as clean rows can run this Actor instead of writing their own client. It reads the public ChEMBL REST API of EMBL-EBI and returns one JSON row per record in one of two modes:

- `activity`: bioactivity measurements (for example IC50 or Ki values) of one biological target or one compound, with compound ID, target name and organism, assay ID, relation, value, units, pChEMBL value, canonical SMILES and source document.
- `molecule`: compound records found by a name fragment or a ChEMBL ID, with preferred name and canonical SMILES.

Typical uses:

- Collect the measured IC50 values of a target to build a training set for a screening model.
- Look up all bioactivities recorded for one compound before you plan an experiment.
- Find compounds by name and get their ChEMBL IDs and SMILES for joins with your own tables.
- Give an AI agent a tool that answers questions about compounds and targets with sourced rows.

One run returns up to the row limit you set, at most 500 rows. The Actor reads compound and target facts only; it outputs no personal data.

This Actor is not affiliated with EMBL-EBI. It calls the public ChEMBL REST API (`https://www.ebi.ac.uk/chembl/api/data/`) and shows what that service returns on the day of the run.

### Data licence and attribution

The ChEMBL data is made available by EMBL-EBI under the Creative Commons Attribution-ShareAlike 3.0 (CC BY-SA 3.0) licence, and EMBL-EBI expects attribution when you use it in publications, services or products. Every output row carries `license` = `CC BY-SA 3.0` and `attribution` = `EMBL-EBI ChEMBL Database`. Output rows stay under CC BY-SA 3.0: if you share or publish them or data derived from them, keep the attribution and share them under the same licence. Please also cite ChEMBL as described in the ChEMBL documentation.

### Input and output examples

#### Example input

```json
{
  "resource": "activity",
  "target_chembl_id": "CHEMBL2095173",
  "max_items": 5
}
```

#### Example output

```json
{
  "record_id": "activity:185453",
  "resource": "activity",
  "molecule_chembl_id": "CHEMBL54932",
  "molecule_pref_name": "",
  "target_chembl_id": "CHEMBL2095173",
  "target_pref_name": "Potassium-transporting ATPase",
  "target_organism": "Homo sapiens",
  "assay_chembl_id": "CHEMBL690673",
  "standard_type": "IC50",
  "standard_relation": "=",
  "standard_value": 98000.0,
  "standard_units": "nM",
  "pchembl_value": 4.01,
  "canonical_smiles": "COc1c(C)cnc(CCC2(C)Nc3ccccc3S2)c1C",
  "document_chembl_id": "CHEMBL1130895",
  "source_url": "https://www.ebi.ac.uk/chembl/api/data/activity/185453.json",
  "license": "CC BY-SA 3.0",
  "attribution": "EMBL-EBI ChEMBL Database"
}
```

Text fields the API does not return are empty strings; numbers it does not return are `null`. In `molecule` mode the target, assay, document and measurement text fields are empty strings and the numeric measurement fields are `null`.

### Pricing

The price is **$0.005** per delivered record on the `FREE` tier of Apify Pay-Per-Event (event name: `chembl-bioactivity-record`).

- FREE: $0.005 per row
- BRONZE: $0.0045 per row
- SILVER: $0.004 per row
- GOLD: $0.0035 per row
- PLATINUM: $0.0035 per row
- DIAMOND: $0.003 per row

Each row is pushed to the dataset first and charged right after the push. If a charge is refused, the run stops; that row stays delivered and uncharged. If the spending limit is reached, the run stops after the row that was charged. Failed requests push nothing and charge nothing. If the platform restarts a run, rows already in the dataset are recognised by their `record_id` and are never pushed or charged twice; the run also keeps a `STATUS` record in the key-value store with its progress.

### Tutorial

1. Open the Actor and leave the prefilled input, or enter a target ID such as `CHEMBL2095173` (activity mode) or a name fragment such as `aspirin` (molecule mode).
2. Optionally set `standard_type` (for example `IC50` or `Ki`) to keep one kind of measurement.
3. Set `max_items` to the number of rows you want. Start with 5 to see the shape of the data.
4. Start the run and open the dataset. Export it as JSON, CSV or Excel, or read it through the Apify API.

The Actor asks the API for pages of up to 100 records in a fixed order and stops at the row limit or at the last page. If the API fails after bounded retries, the run fails with a clear message and charges nothing for undelivered rows.

### Actor recommendations

Use `molecule_chembl_id` and `target_chembl_id` as keys when you join these rows with your own tables. Run the Actor on a schedule for a target you follow to pick up newly recorded measurements. For other public datasets, see the other data Actors of the same publisher.

### FAQ and support

**Which records are returned?** In `activity` mode, bioactivity records of the target or compound you name (and of one standard type if you set it). In `molecule` mode, compounds whose preferred name contains your text, or the one compound with your ID.

**Why does activity mode need a target or a compound ID?** So that one run cannot walk the whole database. Molecule mode needs a name fragment or an ID for the same reason.

**How current is the data?** The API answers with the state of the ChEMBL release it serves at the time of the request.

**Is the data guaranteed to be correct?** No. EMBL-EBI provides ChEMBL as is, without a guarantee of accuracy or fitness for a purpose; check important values at the source URL in each row.

**Support.** Open an issue on the Actor page with your input and the run link.

### Configuration

| Field | Type | Description | Default |
| --- | --- | --- | --- |
| `resource` | String | `activity` or `molecule`. | `activity` |
| `target_chembl_id` | String | Target ChEMBL ID, for example `CHEMBL2095173`. | `""` |
| `molecule_chembl_id` | String | Compound ChEMBL ID, for example `CHEMBL25`. | `""` |
| `query` | String | Molecule mode: text in the preferred compound name. | `""` |
| `standard_type` | String | Activity mode: measurement type such as `IC50` or `Ki`. | `""` |
| `max_items` | Integer (1-500) | Maximum number of rows. | `25` |

Activity mode needs `target_chembl_id` or `molecule_chembl_id`; molecule mode needs `query` or `molecule_chembl_id`.

### Use as an MCP Tool (AI Agents)

AI agents and MCP clients (such as Claude Desktop or Cursor) can invoke `plainkitbin/chembl-bioactivity-compounds` directly via `@apify/actors-mcp-server` over `stdio`:

```bash
APIFY_TOKEN=<YOUR_APIFY_TOKEN> npx -y @apify/actors-mcp-server --actors plainkitbin/chembl-bioactivity-compounds
```

Hosted (Streamable HTTP): connect to `https://mcp.apify.com?tools=plainkitbin/chembl-bioactivity-compounds` using OAuth or the header `Authorization: Bearer <YOUR_APIFY_TOKEN>`.

Example MCP client configuration (`mcpServers`):

```json
{
  "mcpServers": {
    "chembl-bioactivity-compounds": {
      "command": "npx",
      "args": [
        "-y",
        "@apify/actors-mcp-server",
        "--actors",
        "plainkitbin/chembl-bioactivity-compounds"
      ],
      "env": {
        "APIFY_TOKEN": "<YOUR_APIFY_TOKEN>"
      }
    }
  }
}
```

Example JSON tool call matching `.actor/input_schema.json`:

```json
{
  "resource": "activity",
  "target_chembl_id": "CHEMBL2095173",
  "max_items": 5
}
```

Catalog and registry: browse all Actors at [PlainKitBin](https://plainkitbin.com/) or discover the multi-Actor server `com.plainkitbin/public-data-actors` in the MCP Registry.

# Actor input Schema

## `resource` (type: `string`):

activity returns bioactivity measurements of a target or molecule; molecule returns compound records found by name or ChEMBL ID.

## `target_chembl_id` (type: `string`):

ChEMBL ID of a biological target, for example CHEMBL2095173. Activity mode needs this or a molecule ID.

## `molecule_chembl_id` (type: `string`):

ChEMBL ID of one compound, for example CHEMBL25 (aspirin). Works in both modes. Leave empty to filter by target or name only.

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

Molecule mode: case-insensitive text searched in the preferred compound name, for example aspirin. Ignored in activity mode.

## `standard_type` (type: `string`):

Activity mode: only measurements of this type, for example IC50 or Ki. Leave empty for all types.

## `max_items` (type: `integer`):

Maximum number of rows to output (default 25, at most 500).

## Actor input object example

```json
{
  "resource": "activity",
  "target_chembl_id": "CHEMBL2095173",
  "molecule_chembl_id": "",
  "query": "aspirin",
  "standard_type": "",
  "max_items": 25
}
```

# Actor output Schema

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

Dataset items produced by this run.

# 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 = {
    "resource": "activity",
    "target_chembl_id": "CHEMBL2095173",
    "molecule_chembl_id": "",
    "query": "aspirin",
    "standard_type": "",
    "max_items": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("plainkitbin/chembl-bioactivity-compounds").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 = {
    "resource": "activity",
    "target_chembl_id": "CHEMBL2095173",
    "molecule_chembl_id": "",
    "query": "aspirin",
    "standard_type": "",
    "max_items": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("plainkitbin/chembl-bioactivity-compounds").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 '{
  "resource": "activity",
  "target_chembl_id": "CHEMBL2095173",
  "molecule_chembl_id": "",
  "query": "aspirin",
  "standard_type": "",
  "max_items": 25
}' |
apify call plainkitbin/chembl-bioactivity-compounds --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,plainkitbin/chembl-bioactivity-compounds"
        }
    }
}
```

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/ybc9nfP2hnhUSMFn6/builds/voRtHBrRcz35ZU2gb/openapi.json
