# ENA Sequence Read Archive Metadata Scraper (`ninhothedev/ena-sequence-scraper`) Actor

$0.5/1K 🔥 ENA Sequence Archive! Query SRA/ENA runs & experiments with rich metadata. No key. JSON, CSV, Excel or API in seconds. Feed sequencing meta-analysis workflows ⚡

- **URL**: https://apify.com/ninhothedev/ena-sequence-scraper.md
- **Developed by:** [ninhothedev](https://apify.com/ninhothedev) (community)
- **Categories:** Developer tools, Education, Automation
- **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/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

## ENA Sequence Read Archive Metadata Scraper

Scrape **sequencing runs, studies and samples** from the [European Nucleotide
Archive (ENA)](https://www.ebi.ac.uk/ena/browser/home) — including direct
**FASTQ download links** — straight into a clean, structured dataset.

Powered by the free, public **ENA Portal API** (`https://www.ebi.ac.uk/ena/portal/api`).
**No API key, no login, no token.** Filter by organism (NCBI taxon), library
strategy, or any raw ENA query expression.

> The FASTQ links returned are ENA's own **public download URLs** — they point
> straight at the raw sequence files on the EBI FTP servers.

### What you get

Three modes, selected with the `mode` input:

- **`runs`** — sequencing runs (`read_run`). Rich metadata plus the actual
  FASTQ file URLs, sizes and MD5 checksums (split out of ENA's semicolon lists,
  paired-end aware).
- **`studies`** — studies / projects (`study`).
- **`samples`** — biological samples (`sample`).

### Example output (runs)

```json
{
  "type": "read_run",
  "run_accession": "DRR000539",
  "experiment_accession": "DRX000200",
  "sample_accession": "SAMD00011100",
  "study_accession": "PRJDA36577",
  "scientific_name": "Homo sapiens",
  "tax_id": "9606",
  "instrument_platform": "ILLUMINA",
  "instrument_model": "Illumina Genome Analyzer II",
  "library_strategy": "WGS",
  "library_source": "GENOMIC",
  "library_layout": "PAIRED",
  "read_count": 12345678,
  "base_count": 987654321,
  "fastq_urls": [
    "ftp://ftp.sra.ebi.ac.uk/vol1/fastq/DRR000/DRR000539/DRR000539_1.fastq.gz",
    "ftp://ftp.sra.ebi.ac.uk/vol1/fastq/DRR000/DRR000539/DRR000539_2.fastq.gz"
  ],
  "fastq_file_count": 2,
  "fastq_bytes": [51328587, 102162121],
  "total_fastq_bytes": 153490708,
  "fastq_md5": ["dcf9a4f09a386d5e661c53611bb64610", "56002911767c227267ff15a7c3abe84d"],
  "first_public": "2011-02-01",
  "center_name": "RIKEN",
  "study_title": "Human whole genome sequencing",
  "url": "https://www.ebi.ac.uk/ena/browser/view/DRR000539",
  "source": "ena",
  "scraped_at": "2026-08-11T00:00:00+00:00"
}
```

### Input

| Field | Type | Description |
|-------|------|-------------|
| `mode` | select | `runs`, `studies` or `samples`. Default `runs`. |
| `taxonId` | string | NCBI taxon ID, e.g. `9606` (human). Builds `tax_eq()`. |
| `freeQuery` | string | Raw ENA query expression. **Overrides** `taxonId`. e.g. `tax_tree(2) AND instrument_platform="OXFORD_NANOPORE"`. |
| `libraryStrategy` | string | e.g. `WGS`, `WXS`, `RNA-Seq`, `ChIP-Seq`. AND-ed onto the query. |
| `maxItems` | integer | Cap on records returned. Default `200`, max `10000`. |

### Use cases

- **Genomics data discovery** — find all public runs for an organism, platform or assay.
- **Pipeline input staging** — grab FASTQ URLs + sizes + MD5s to seed a bioinformatics pipeline.
- **Metadata harvesting** — build a catalogue of studies, samples and runs for a taxon.
- **Reproducibility** — snapshot the exact accessions, checksums and provenance behind an analysis.

### Pricing

Roughly **~$0.50 per 1,000 records** on Apify's pay-per-result model. The ENA
Portal API itself is free; you only pay for Apify platform usage.

### Related actors

- [NCBI Genomes Scraper](https://apify.com/ninhothedev/ncbi-genomes-scraper)
- [NCBI E-utilities Scraper](https://apify.com/ninhothedev/ncbi-eutils-scraper)
- [Ensembl Scraper](https://apify.com/ninhothedev/ensembl-scraper)
- [UniProt Scraper](https://apify.com/ninhothedev/uniprot-scraper)

### Notes

- Data comes from the ENA Portal API; ENA is maintained by EMBL-EBI.
- FASTQ URLs are public EBI FTP download links.
- This actor reads only public metadata and adds no authentication.

# Actor input Schema

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

Which ENA record type to search: 'runs' = sequencing runs (read\_run, includes FASTQ links), 'studies' = studies/projects (study), 'samples' = biological samples (sample).

## `taxonId` (type: `string`):

Optional NCBI taxonomy ID to filter by organism. Builds an ENA tax\_eq() clause, e.g. '9606' for Homo sapiens, '10090' for mouse. Ignored if 'Free query' is set. Prefilled with 9606 so a default run returns human data immediately; clear it to run a broader query.

## `freeQuery` (type: `string`):

Optional raw ENA Portal query expression. Overrides 'Taxon ID' when set. Examples: 'tax\_tree(2)', 'instrument\_platform="OXFORD\_NANOPORE"', 'first\_public>=2024-01-01 AND tax\_eq(9606)'.

## `libraryStrategy` (type: `string`):

Optional library strategy filter, AND-ed onto the query. Examples: 'WGS', 'WXS', 'RNA-Seq', 'ChIP-Seq', 'AMPLICON', 'ATAC-seq'. Applies mainly to 'runs' mode.

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

Maximum number of records to fetch and push to the dataset (1-10000).

## Actor input object example

```json
{
  "mode": "runs",
  "taxonId": "9606",
  "freeQuery": "tax_eq(9606) AND instrument_platform=\"ILLUMINA\"",
  "libraryStrategy": "WGS",
  "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 = {
    "taxonId": "9606"
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/ena-sequence-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 = { "taxonId": "9606" }

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/ena-sequence-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 '{
  "taxonId": "9606"
}' |
apify call ninhothedev/ena-sequence-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ninhothedev/ena-sequence-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/k9VriHFgQIR6Zz2pq/builds/WPhlQQylAi2EZiFMi/openapi.json
