# UniProt Protein Scraper - Sequences, Genes & Function (`ninhothedev/uniprot-scraper`) Actor

$0.5/1K 🔥 UniProt protein scraper! Accession, protein name, gene, organism, function & sequence. No key. JSON, CSV, Excel or API in seconds. Power bioinformatics & drug discovery ⚡

- **URL**: https://apify.com/ninhothedev/uniprot-scraper.md
- **Developed by:** [ninhothedev](https://apify.com/ninhothedev) (community)
- **Categories:** AI, Developer tools
- **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/platform/actors/running/actors-in-store#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

## UniProt Protein Scraper — Sequences, Genes, Organisms & Function

Scrape **UniProtKB protein data** at scale — no API key, no login, no proxy required. Search the world's largest curated protein knowledgebase by keyword, gene, organism or taxonomy, or look up specific accessions, and get clean, structured JSON/CSV/Excel back.

Built on the official UniProt REST API with cursor-based pagination, so results are complete, stable and reproducible.

***

### What it does

Give it a list of search queries (`insulin`, `gene:BRCA1 AND organism_id:9606`, `reviewed:true AND kinase`) or a list of accessions (`P01308`, `P0DTC2`), and the actor returns one row per protein with:

- **accession** — primary UniProtKB accession (e.g. `P01308`)
- **entry\_name** — UniProtKB ID (e.g. `INS_HUMAN`)
- **protein\_name** — recommended (or submitted) full protein name
- **genes** — gene names and synonyms
- **organism** + **taxon\_id** — scientific name and NCBI taxonomy ID
- **sequence** — full amino-acid sequence
- **sequence\_length** — residue count
- **molecular\_weight** — in Daltons
- **function** — curated FUNCTION annotation text
- **keywords** — UniProt controlled-vocabulary keywords
- **reviewed** — `true` for Swiss-Prot (manually reviewed), `false` for TrEMBL
- **url** — direct link to the UniProt entry page
- **source**, **scraped\_at** — provenance metadata

***

### Why use it

- **No API key.** Nothing to register, nothing to rotate, nothing to expire.
- **No proxy needed.** Runs clean on datacenter IPs — cheap runs, no residential surcharge.
- **Two modes.** Bulk discovery via `search`, precise enrichment via `accessions`.
- **Full UniProt query syntax.** Anything you can type into uniprot.org search works here.
- **Reviewed vs unreviewed.** Filter Swiss-Prot gold-standard entries with `reviewed:true`.
- **Deduplicated.** Every accession appears once, even across overlapping queries.

***

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | select | `search` | `search` (queries → proteins) or `accessions` (IDs → lookup) |
| `queries` | array | `["insulin", "spike protein"]` | UniProtKB search terms, used in `search` mode |
| `accessions` | array | `[]` | UniProtKB accession IDs, used in `accessions` mode |
| `maxItems` | integer | `100` | Maximum proteins to scrape (max 1000) |

```json
{
  "mode": "search",
  "queries": ["gene:BRCA1 AND organism_id:9606", "reviewed:true AND kinase"],
  "maxItems": 500
}
```

```json
{
  "mode": "accessions",
  "accessions": ["P01308", "P0DTC2", "P38398"],
  "maxItems": 100
}
```

***

### Output sample

```json
{
  "accession": "P01308",
  "entry_name": "INS_HUMAN",
  "protein_name": "Insulin",
  "genes": ["INS"],
  "organism": "Homo sapiens",
  "taxon_id": 9606,
  "sequence": "MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN",
  "sequence_length": 110,
  "molecular_weight": 11981,
  "function": "Insulin decreases blood glucose concentration...",
  "keywords": ["3D-structure", "Diabetes mellitus", "Hormone", "..."],
  "reviewed": true,
  "url": "https://www.uniprot.org/uniprotkb/P01308",
  "source": "uniprot",
  "scraped_at": "2026-07-28T11:00:00+00:00"
}
```

***

### Pricing

Roughly **$0.50 per 1,000 proteins** in Apify platform usage. Runs on 512 MB and no proxy, so cost stays predictable — a 1,000-protein run typically finishes in a couple of minutes.

***

### Use cases

- **Bioinformatics** — build reference FASTA sets and annotation tables for pipelines
- **Drug discovery** — pull target sequences, functions and disease keywords for a target list
- **Protein research** — compare orthologs across organisms by taxonomy ID
- **Machine-learning datasets** — assemble labelled sequence corpora for protein language models
- **Database enrichment** — join UniProt annotations onto internal gene or target IDs
- **Competitive/landscape analysis** — map which proteins carry which curated keywords

***

### Useful query examples

| Goal | Query |
|---|---|
| Human proteins only | `organism_id:9606` |
| Reviewed human kinases | `reviewed:true AND organism_id:9606 AND kinase` |
| One gene, one species | `gene:BRCA1 AND organism_id:9606` |
| Membrane proteins | `keyword:KW-0472` |
| Everything about a family | `family:"insulin family"` |

***

### Related actors

- [RCSB PDB Scraper](https://apify.com/ninhothedev/rcsb-pdb-scraper) — 3D protein structures
- [Ensembl Scraper](https://apify.com/ninhothedev/ensembl-scraper) — genes, transcripts, genomes
- [ChEMBL Scraper](https://apify.com/ninhothedev/chembl-scraper) — bioactive molecules and assays
- [PubMed Scraper](https://apify.com/ninhothedev/pubmed-scraper) — biomedical literature

***

### Notes

Data comes from the public [UniProt REST API](https://rest.uniprot.org). UniProt data is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) — please cite UniProt in publications. This actor only reads public data and does not scrape any personal information.

# Actor input Schema

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

How to collect proteins. 'search' runs full-text UniProtKB queries and paginates through the results. 'accessions' looks up a fixed list of UniProtKB accession IDs directly.

## `queries` (type: `array`):

Search terms for UniProtKB, used when mode is 'search'. Plain keywords work ('insulin'), as do field queries ('gene:BRCA1 AND organism\_id:9606', 'reviewed:true AND kinase'). Each query is paginated until maxItems is reached.

## `accessions` (type: `array`):

UniProtKB accession IDs to look up one by one, used when mode is 'accessions'. Example: P01308 (human insulin), P0DTC2 (SARS-CoV-2 spike). Invalid accessions are skipped with a warning.

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

Maximum number of proteins to push to the dataset across all queries or accessions. Keeps runs cheap and predictable.

## Actor input object example

```json
{
  "mode": "search",
  "queries": [
    "insulin",
    "spike protein"
  ],
  "accessions": [
    "P01308"
  ],
  "maxItems": 100
}
```

# 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 = {
    "queries": [
        "insulin",
        "spike protein"
    ],
    "accessions": [
        "P01308"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/uniprot-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 = {
    "queries": [
        "insulin",
        "spike protein",
    ],
    "accessions": ["P01308"],
}

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/uniprot-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 '{
  "queries": [
    "insulin",
    "spike protein"
  ],
  "accessions": [
    "P01308"
  ]
}' |
apify call ninhothedev/uniprot-scraper --silent --output-dataset

```

## MCP server setup

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