# NCBI dbSNP Variants Scraper (`parseforge/ncbi-dbsnp-variants-scraper`) Actor

Scrapes NCBI dbSNP variant records by free-text query and returns each one as a flat row with rsID, alleles, clinical significance, and genomic location.

- **URL**: https://apify.com/parseforge/ncbi-dbsnp-variants-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Other, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $19.00 / 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.
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)

### NCBI dbSNP Variants Scraper

**Scrape genetic variant data from NCBI dbSNP by gene symbol, rsID, or condition, up to a million per run.** Each variant returns its rsID, alleles, clinical significance, and genomic location. No API key required. Export to CSV, JSON, Excel, or XML.

NCBI dbSNP is the central public archive for human genetic variation, but querying it manually across hundreds of variants is slow and error-prone. This Actor reads the public search results directly, letting you collect structured variant records for any gene, rsID, or disease term. It returns each matching variant in one flat, analysis-ready row.

| Who uses it | What they scrape NCBI dbSNP for |
|---|---|
| Clinical geneticists | Compile a list of clinically significant variants for a gene panel from a single search term. |
| Bioinformatics researchers | Gather variant coordinates and allele frequencies for population studies without writing custom E-utilities scripts. |
| Pharma R\&D teams | Monitor newly submitted variants linked to a disease target for drug discovery pipelines. |

### What it does

This Actor collects NCBI dbSNP variant records by free-text query and returns each one as a flat row with rsID, alleles, clinical significance, and genomic coordinates.

- 🔍 **Free-text query:** accepts gene symbols (BRCA1), rsIDs (rs334), or condition names (sickle cell).
- 📊 **Flat row output:** every variant is returned as one row, ready for spreadsheets or statistical tools.
- ⚙️ **Configurable limit:** set a maximum from 1 to 1,000,000 variants per run to control scope and cost.

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

### What you can do with NCBI dbSNP data

**🧬 Build a gene variant panel.**

A clinical lab enters a gene symbol like BRCA1 and collects all linked variants with clinical significance to design a diagnostic report.

**📈 Track variant submissions for a disease.**

A researcher queries a condition like 'cystic fibrosis' weekly to capture newly submitted variants and update a research database.

**🗺️ Retrieve genomic coordinates for annotation.**

A bioinformatician searches by rsID list to get chromosome positions and alleles for a custom annotation track.

### Why choose this scraper

|  | What you get |
|---|---|
| **No API key or E-utilities setup** | Query dbSNP directly without registering for an NCBI API key or managing rate limits. |
| **Structured, flat schema** | Every variant is returned with the same fields, so you can merge runs or load them into a database immediately. |
| **Handles large queries** | Collect up to a million variants in one run for genome-wide or panel-wide analyses. |

### How it compares

No other Store actor targets NCBI dbSNP the same way, so the honest comparison is with the alternatives teams actually weigh.

| | NCBI dbSNP Variants Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When NCBI dbSNP changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |

### Configure the run

Drive the Actor with a single free-text query, and set a maximum variant count so only the records you need reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "maxItems": 10
}
```

A larger pull:

```json
{
  "maxItems": 200
}
```

### Pricing

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

| Results collected | Approximate cost |
|---|---|
| 100 results | $2.10 |
| 1,000 results | $21.00 |
| 10,000 results | $210.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 [NCBI dbSNP Variants Scraper](https://apify.com/parseforge/ncbi-dbsnp-variants-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 NCBI dbSNP 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/ncbi-dbsnp-variants-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 query matches a term that returns variants on the NCBI dbSNP website. Try the same search manually at ncbi.nlm.nih.gov/snp. If it returns results there, ensure your query is spelled correctly and does not contain extra punctuation.

**The run stopped before collecting all variants.**

Check the maxItems setting in your input. The Actor stops when it reaches that number. Increase the maximum if you need more variants, up to 1,000,000.

**Some fields are empty in my dataset.**

Not every variant has every field populated in dbSNP. For example, a variant may lack a clinical significance annotation. Empty cells mean the data was not present on the source page.

**The run is taking a long time.**

Large queries with high maxItems values will take longer because the Actor must paginate through many search results. Reduce maxItems or narrow your query to speed up the run.

### FAQ

| Question | Answer |
|---|---|
| What search terms can I use? | You can enter a gene symbol (BRCA1, APOE), an rsID (rs334, rs7412), or a condition name (sickle cell, cystic fibrosis). The query is passed directly to the dbSNP search, so any term that works on the website should work here. |
| Does this require an NCBI API key? | No. This Actor reads the public search results pages, so you do not need to register for an NCBI API key or manage E-utilities rate limits. |
| What fields are returned for each variant? | Each row includes the rsID, alleles, clinical significance, genomic location (chromosome and coordinates), and other metadata that dbSNP displays in its search results. |
| How many variants can I collect in one run? | You can set the maximum from 1 to 1,000,000 variants. The Actor will stop after reaching that count, even if the search returns more results. |
| Can I scrape multiple genes at once? | Each run takes a single query. To collect variants for multiple genes, run the Actor once per gene and merge the datasets afterward. |
| Is the data from the latest dbSNP build? | Yes. The Actor reads the live NCBI dbSNP website, so you always get the current build and the most recently submitted variants. |
| Can I filter by clinical significance inside the Actor? | The Actor returns all variants matching your query. You can filter the resulting dataset by clinical significance or any other field after the run using your own tools. |
| What output formats are supported? | You can export your dataset to CSV, JSON, Excel, or XML from the Apify platform. |

### Related actors

- [google-scholar-scraper](https://apify.com/parseforge/google-scholar-scraper?fpr=vmoqkp): Use this to find academic papers citing a variant or gene when you need citation data.

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 National Center for Biotechnology Information, U.S. National Library of Medicine. 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

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

Free-text query against dbSNP (gene symbol, rsID, condition). Example: BRCA1, APOE, sickle cell.

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

Maximum number of variants to collect per run.

## Actor input object example

```json
{
  "query": "BRCA1",
  "maxItems": 10
}
```

# 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 = {
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/ncbi-dbsnp-variants-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 }

# Run the Actor and wait for it to finish
run = client.actor("parseforge/ncbi-dbsnp-variants-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
}' |
apify call parseforge/ncbi-dbsnp-variants-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/ncbi-dbsnp-variants-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/7yaNlypIjeUAPhBbC/builds/40KfYKunZbnq90BKE/openapi.json
