# Pharma and Biotech Pipeline Intelligence (`perceptive_city_af7/pharma-biotech-pipeline-intelligence`) Actor

Cross-link ClinicalTrials.gov, openFDA, ChEMBL, and Europe PMC into drug dossiers or normalized pipeline events. Official public APIs only, no browser, login, API key, personal contacts, or investigator PII.

- **URL**: https://apify.com/perceptive_city_af7/pharma-biotech-pipeline-intelligence.md
- **Developed by:** [fall Rainy](https://apify.com/perceptive_city_af7) (community)
- **Categories:** AI, Automation, 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 $10.00 / 1,000 pipeline intelligence records

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

## Pharma and Biotech Pipeline Intelligence

Turn a drug, molecule, or disease query into decision-ready pipeline intelligence from four official biomedical APIs in one run.

This Apify Actor cross-links clinical development, U.S. regulatory history, molecular identity, and peer-reviewed literature. It uses direct asynchronous HTTP requests only: no browser, no Playwright, no login, and no API key.

### What you get

Choose either output mode:

- `drug_dossier` creates one rich, cross-linked record per requested drug name or query.
- `pipeline_feed` creates normalized, date-sorted events from every available source.

Each source has its own timeout and error boundary. If Europe PMC is slow, for example, ClinicalTrials.gov, openFDA, and ChEMBL can still produce a usable record. The `sourceStatus` object shows exactly which sources succeeded, timed out, or failed.

### Four official sources, one workflow

| Intelligence layer | Official API | Dossier value |
|---|---|---|
| Clinical development | ClinicalTrials.gov API v2 | Active trial total, latest trials, phase distribution, and top sponsors |
| U.S. regulatory activity | openFDA Drugs@FDA and Drug Enforcement APIs | Approval and recall totals plus latest FDA events |
| Molecular profile | EMBL-EBI ChEMBL REST API | ChEMBL ID, maximum phase, molecule type, canonical SMILES, molecular weight, and ATC codes |
| Scientific evidence | Europe PMC REST API | PubMed paper total and top-cited papers |

Useful queries include `imatinib`, `semaglutide`, `pembrolizumab`, and `non-small cell lung cancer`.

### Fast start

The default run is deliberately health-check friendly: it builds up to 10 records for `semaglutide`, with five records requested from each source and a 12-second per-source boundary.

```json
{
  "mode": "drug_dossier",
  "query": "semaglutide",
  "maxItems": 10
}
```

Build several drug dossiers in one run:

```json
{
  "mode": "drug_dossier",
  "drugNames": [
    "imatinib",
    "semaglutide",
    "pembrolizumab"
  ],
  "maxItems": 3,
  "sourceItemsPerQuery": 5
}
```

Create an indication-centered event feed:

```json
{
  "mode": "pipeline_feed",
  "query": "non-small cell lung cancer",
  "maxItems": 10,
  "sourceItemsPerQuery": 5
}
```

### Input

| Field | Type | Default | Meaning |
|---|---|---:|---|
| `mode` | string | `drug_dossier` | `drug_dossier` or `pipeline_feed` |
| `query` | string | `semaglutide` | Drug, molecule, or disease/indication query used when `drugNames` is empty |
| `drugNames` | string list | empty | Optional list; takes precedence over `query` |
| `maxItems` | integer | `10` | Maximum dataset records across the run |
| `sourceItemsPerQuery` | integer | `5` | Maximum latest records requested from each source |
| `sourceTimeoutSeconds` | integer | `12` | Independent timeout for each source |
| `requestDelayMs` | integer | `150` | Minimum delay between requests to the same API |

### Drug dossier output

A dossier includes these core intelligence fields:

```json
{
  "recordType": "drug_dossier",
  "query": "semaglutide",
  "activeTrialsCount": 127,
  "phaseDistribution": {
    "PHASE3": 2,
    "PHASE4": 3
  },
  "topSponsors": [
    {
      "name": "Example sponsor",
      "trialCount": 2
    }
  ],
  "latestTrials": [],
  "fdaApprovalsCount": 4,
  "fdaRecallsCount": 1,
  "latestFdaEvents": [],
  "chemblId": "CHEMBL000000",
  "maxClinicalPhase": 4.0,
  "moleculeType": "Small molecule",
  "canonicalSmiles": "...",
  "molecularWeight": 411.0,
  "atcCodes": ["A10BJ06"],
  "pubmedPapersCount": 2500,
  "topCitedPapers": [],
  "sourceStatus": {
    "clinicalTrials": {"ok": true, "error": null},
    "openFda": {"ok": true, "error": null},
    "chembl": {"ok": true, "error": null},
    "europePmc": {"ok": true, "error": null}
  }
}
```

`activeTrialsCount`, FDA totals, and `pubmedPapersCount` use the total counts returned by their official APIs. `phaseDistribution` and `topSponsors` summarize the latest-trial window selected by `sourceItemsPerQuery`; they are not claimed as full-corpus aggregations.

### Pipeline feed output

Every source is mapped to a stable event envelope:

- `source`, `sourceRecordId`, and `eventType`
- `title`, `eventDate`, `status`, and `phase`
- `organization`, official `url`, and source-specific `details`
- the complete per-query `sourceStatus`

Event types are `clinical_trial`, `fda_approval`, `fda_recall`, `molecule_profile`, and `literature`. Records are sorted by the best available source date and capped by `maxItems` before they are written.

### Privacy and data boundaries

The Actor reads public, non-paywalled records only. It never requests ClinicalTrials.gov contacts, responsible parties, investigators, or location contacts. Extracted text is scrubbed for email addresses and phone-like contact strings before output. Literature author names are not returned. No personal account or API credential is used.

This is an intelligence assembly tool, not medical advice. Name-based cross-linking can produce ambiguous matches for short names, synonyms, combinations, or disease-only queries. Review official-source links before making scientific, regulatory, investment, or clinical decisions.

### Reuse and attribution

- ClinicalTrials.gov is an official U.S. National Library of Medicine service. See its [API documentation](https://clinicaltrials.gov/data-api/api).
- openFDA provides U.S. government public data under its [data license](https://open.fda.gov/license/).
- ChEMBL data is provided by EMBL-EBI under [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/).
- Europe PMC exposes open bibliographic metadata through its [REST service](https://europepmc.org/RestfulWebService).

Each dossier carries source attribution and an access date. Preserve the ChEMBL attribution when redistributing ChEMBL-derived fields.

### Pricing and budget safety

| Event | Price |
|---|---:|
| Actor start | `$0.00005` |
| Saved dossier or pipeline event | `$0.01` |

The Actor streams records one by one. It checks Apify's dataset-item spending limit before work and after each write, then exits cleanly as soon as the limit is reached. It also handles the Apify abort event for graceful shutdown.

### Local verification

The included verifier makes zero external network calls. It uses `httpx.MockTransport` for all four sources, validates dossier and feed cross-linking, tests independent HTTP-error and timeout isolation, checks PII removal, audits Apify schemas and PPE prices, checks abort and spending-limit hooks, and writes `evidence.json`.

```bash
python verify.py
```

# Actor input Schema

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

Choose one rich dossier per query or a date-sorted feed of normalized source events.

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

Used when Drug names is empty. Examples: semaglutide, pembrolizumab, or non-small cell lung cancer.

## `drugNames` (type: `array`):

Optional list of drug names. When provided, this list takes precedence over Query.

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

Maximum number of dossiers or feed events saved to the default dataset.

## `sourceItemsPerQuery` (type: `integer`):

Maximum latest trials, FDA records, ChEMBL matches, and top-cited papers fetched per query.

## `sourceTimeoutSeconds` (type: `integer`):

Maximum seconds allowed for each source before the other sources continue without it.

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

Minimum delay in milliseconds between requests to the same official API.

## Actor input object example

```json
{
  "mode": "drug_dossier",
  "query": "semaglutide",
  "drugNames": [],
  "maxItems": 10,
  "sourceItemsPerQuery": 5,
  "sourceTimeoutSeconds": 25,
  "requestDelayMs": 150
}
```

# Actor output Schema

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

URL of the default dataset containing unified drug dossiers or pipeline events.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("perceptive_city_af7/pharma-biotech-pipeline-intelligence").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("perceptive_city_af7/pharma-biotech-pipeline-intelligence").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 '{}' |
apify call perceptive_city_af7/pharma-biotech-pipeline-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,perceptive_city_af7/pharma-biotech-pipeline-intelligence"
        }
    }
}
```

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/re8aRvtqBonP5HMuY/builds/EVztaMI9yYd2hXoR6/openapi.json
