# KEGG Pathways Scraper (`parseforge/kegg-pathways-scraper`) Actor

Scrapes KEGG pathways, modules, and orthology entries by list, keyword search, or specific ID. Returns each entry as a flat row with genes, compounds, and reactions.

- **URL**: https://apify.com/parseforge/kegg-pathways-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Education, Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 89.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $18.00 / 1,000 result items

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?

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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### KEGG Pathways Scraper

**Scrape KEGG pathways, modules, and orthology entries from any organism, up to a million per run.** Each entry returns its full detail, including genes, compounds, and reactions. No API key or registration required. Export to CSV, JSON, Excel, or XML.

KEGG is a foundational knowledge base for systems biology, but its REST API returns flat text that is hard to parse and requires manual pagination. This actor queries the KEGG API directly, retrieves structured pathway, module, and orthology data, and returns each entry in one consistent schema. You can list all entries in a database, search by keyword, or fetch full detail for specific IDs.

| Who uses it | What they scrape KEGG for |
|---|---|
| Bioinformaticians | Fetching full pathway maps with gene and compound lists for enrichment analysis. |
| Systems biologists | Comparing metabolic modules across different organisms for evolutionary studies. |
| Pharma researchers | Extracting drug-target pathway associations for candidate screening. |
| Academic labs | Building local databases of KEGG Orthology assignments for newly sequenced genomes. |

### What it does

This Actor collects KEGG pathway, module, and orthology entries by list, keyword search, or specific ID, and returns each one as a flat row.

- 📋 **List mode:** enumerate all entries in a chosen KEGG database, optionally filtered by organism code.
- 🔍 **Find mode:** search any KEGG database by free-text keyword and retrieve matching entries.
- 🎯 **Get mode:** fetch full detail records for up to 10 specific KEGG IDs in a single run.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with KEGG data

**🧬 Build a metabolic model.**

A systems biologist lists all human pathways, then fetches full detail for glycolysis and TCA cycle to extract gene and reaction lists for constraint-based modeling.

**🔬 Compare pathway conservation.**

A researcher lists KEGG modules for E. coli and yeast, then compares the presence and absence of specific metabolic modules across the two organisms.

**💊 Screen drug targets.**

A pharma scientist searches the Drug database for a candidate compound, then retrieves its associated pathways to identify potential off-target effects.

**📊 Annotate a new genome.**

A bioinformatician lists all KO entries for a newly sequenced bacterial organism to build a first-pass functional annotation of its predicted genes.

### Why choose this scraper

|  | What you get |
|---|---|
| **No API key** | Queries the public KEGG REST API with no registration or authentication. |
| **Structured output** | Parses flat text into a clean, flat schema ready for analysis. |
| **Organism filtering** | Restrict list queries to a single organism using standard KEGG codes. |
| **Multi-ID fetch** | Retrieve up to 10 full detail records in one run using the Get mode. |

### How it compares

This actor scrapes full KEGG pathway detail including genes, compounds, and reactions, while the KEGG Genes Scraper focuses on gene identifiers and descriptions.

| Feature | ParseForge | KEGG Genes Scraper |
|---|---|---|
| Full pathway detail with genes and compounds | Yes | Not listed |
| Keyword search across databases | Yes | Yes |
| Organism-specific filtering | Yes | Not listed |
| Multi-ID detail fetch | Yes | Not listed |
| List all entries in a database | Yes | Not listed |

### Configure the run

Drive the Actor by choosing a query mode, a KEGG database, and an optional organism code or search term, and set a maximum number of pathways to collect. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "maxItems": 10,
  "mode": "list",
  "database": "pathway",
  "organism": "hsa"
}
```

A larger pull:

```json
{
  "maxItems": 200,
  "mode": "list",
  "database": "pathway",
  "organism": "hsa"
}
```

### Pricing

Pay-per-result: **$0.024 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $2.40 |
| 1,000 results | $24.00 |
| 10,000 results | $240.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [KEGG Pathways Scraper](https://apify.com/parseforge/kegg-pathways-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to KEGG through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/kegg-pathways-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check that your search term matches an entry in the selected database. For List mode, verify the organism code is valid for that database. Try a broader search term or switch to List mode to see available entries.

**Why does the organism filter not work?**

The organism code only filters results in List mode for the pathway, module, and ko databases. For other databases or modes, this field is ignored.

**Why did my Get request fail?**

Ensure you are using valid KEGG identifiers separated by a plus sign, with no spaces. The maximum is 10 IDs per request. Also confirm the IDs belong to the database you selected.

**Why is the output missing some fields?**

Not all KEGG entries contain the same level of detail. A pathway entry will include genes and compounds, while a brite entry has a different structure. The schema captures all available fields for each entry type.

**Why is the run slow?**

The KEGG API has rate limits. When listing large databases or fetching many entries, the actor respects these limits, which can extend the run time. Reduce the maximum items or use a more targeted query.

### FAQ

| Question | Answer |
|---|---|
| Do I need a KEGG license or API key to use this? | No. This actor uses the public KEGG REST API, which does not require registration or an API key for standard access. |
| What is the maximum number of pathways I can scrape in one run? | You can set the maximum up to 1,000,000 entries. The actual number retrieved depends on the database and mode you select. |
| Can I search for pathways by keyword? | Yes. Use the Find mode and enter a search term like 'glycolysis' or 'apoptosis' to retrieve matching entries from the chosen database. |
| How do I get the full detail for a specific pathway? | Switch to Get mode and enter one or more KEGG identifiers separated by a plus sign, for example 'hsa00010+hsa00020'. |
| What organism codes can I use? | You can use any standard KEGG organism code, such as 'hsa' for human, 'mmu' for mouse, 'eco' for E. coli, or 'sce' for yeast. |
| Which KEGG databases are supported? | All major databases are supported, including Pathway, Module, KO (Orthology), Compound, Reaction, Enzyme, Disease, Drug, and several genome databases. |
| Does the organism filter work with every database? | The organism code filter applies only to List mode with the pathway, module, and ko databases. It is ignored for other databases and modes. |
| What format is the output data in? | You can export your results to CSV, JSON, Excel, or XML directly from the Apify dataset. |
| Can I fetch more than 10 IDs at once in Get mode? | The KEGG API limits Get requests to 10 identifiers at a time. To fetch more, run the actor multiple times with different ID batches. |
| Is this actor suitable for commercial use? | This actor queries the public KEGG API. You are responsible for complying with the KEGG terms of use for any commercial application. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Kanehisa Laboratories. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

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

How many pathways to collect per run.

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

list = enumerate all entries in a database. find = search a database by keyword. get = retrieve full entry detail for specific IDs.

## `database` (type: `string`):

Which KEGG database to query. 'pathway' is the most common (metabolic and signaling maps).

## `organism` (type: `string`):

Optional KEGG organism code for organism-specific queries (e.g. 'hsa' = human, 'mmu' = mouse, 'eco' = E. coli, 'sce' = yeast). Only applies to 'list' mode with pathway/module/ko databases.

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

For 'find' mode: free-text keyword (e.g. 'glycolysis'). For 'get' mode: KEGG IDs separated by '+' (e.g. 'hsa00010+hsa00020', max 10). Leave empty for 'list' mode.

## Actor input object example

```json
{
  "maxItems": 10,
  "mode": "list",
  "database": "pathway",
  "organism": "hsa"
}
```

# Actor output Schema

## `overview` (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 = {
    "maxItems": 10,
    "mode": "list",
    "database": "pathway",
    "organism": "hsa"
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/kegg-pathways-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 = {
    "maxItems": 10,
    "mode": "list",
    "database": "pathway",
    "organism": "hsa",
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/kegg-pathways-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 '{
  "maxItems": 10,
  "mode": "list",
  "database": "pathway",
  "organism": "hsa"
}' |
apify call parseforge/kegg-pathways-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/kegg-pathways-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/BVFI2O5q33Blw8uqJ/builds/ug088EdRcMvbC0v9z/openapi.json
