# PubMed Articles Scraper - Authors, Journals & DOIs (`eliai/pubmed-articles-scraper`) Actor

Search PubMed and get one row per article: title, full author list, journal, volume/issue/pages, DOI with a resolvable link, PMCID, publication types and languages. Full PubMed query syntax, bulk searches. $0.008 per article; empty searches are free.

- **URL**: https://apify.com/eliai/pubmed-articles-scraper.md
- **Developed by:** [Broke to Built](https://apify.com/eliai) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$8.00 / 1,000 articles scrapeds

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

## PubMed Articles Scraper — Authors, Journals & DOIs

Search **PubMed** and get **one row per article**: title, the full author list, journal,
volume/issue/pages, a bare **DOI** with a resolvable link, **PMCID**, publication types and
languages.

Full PubMed query syntax. No API key, no account. **$0.008 per article** — a search that matches
nothing is recorded and **not charged**.

### Input

```json
{ "query": "crispr AND 2024[pdat]", "maxArticles": 100, "sort": "date" }
```

Bulk:

```json
{ "queries": ["semaglutide", "\"Smith J\"[au] AND cardiology"], "maxArticles": 50 }
```

| Field | Type | Notes |
|---|---|---|
| `query` | string | Any PubMed query — `crispr AND 2024[pdat]`, `"Smith J"[au]`, MeSH terms. |
| `queries` | string\[] | Up to 10 searches per run. |
| `maxArticles` | integer | 1–500 per search. **You are charged per article returned.** |
| `sort` | enum | `relevance`, `date`, `author`, `journal`. |
| `apiKey` | string | Optional NCBI key — see Limits. |

### Output

```json
{
  "ok": true,
  "pmid": "25315507",
  "url": "https://pubmed.ncbi.nlm.nih.gov/25315507/",
  "title": "Genome modification by CRISPR/Cas9.",
  "authors": ["Ma Y", "Zhang L", "Huang X"],
  "firstAuthor": "Ma Y",
  "journal": "The FEBS journal",
  "pubDateRaw": "2014 Dec",
  "pubDate": null,
  "pubYear": 2014,
  "volume": "281", "issue": "23", "pages": "5186-93",
  "doi": "10.1111/febs.13110",
  "doiUrl": "https://doi.org/10.1111/febs.13110",
  "pmcid": null,
  "publicationTypes": ["Journal Article", "Review"],
  "languages": ["eng"],
  "totalMatches": 70754
}
```

### What it gets right

- ⭐ **Partial dates are not invented.** PubMed prints `"2014 Dec"` when the issue was monthly.
  `pubDateRaw` keeps exactly what the source said, `pubDate` stays **null** unless a full day
  exists, and `pubYear` is always there for filtering. No article gets a fake 1st-of-the-month.
- **The DOI is bare and the link works.** PubMed returns `"doi: 10.1111/…"` in `elocationid`;
  the prefix is stripped and `doiUrl` is built from the cleaned value.
- ⚠️ **`esummary` returns a map keyed by id *plus* a `uids` array.** Iterating its values naively
  emits that array as a bogus, title-less record — which you would then be billed for. This walks
  the ids it asked for, in order, and the promise spec asserts every `pmid` is numeric.
- **`totalMatches` tells you how big the literature is**, so you know whether 25 rows is the whole
  answer or the tip of 70,000.
- **Two calls, batched.** `esearch` for ids, then `esummary` in batches of 200 — not one request
  per article.

### Pricing

**$0.008 per article returned.** No start fee. A search matching nothing produces an
`articleCount: 0` record with `totalMatches` and **is not charged**.

### Limits

- NCBI allows **3 requests/second per IP** without a key and **10/second** with one. Runs here are
  small and batched, so the keyless limit is usually fine; supply `apiKey` (free from your NCBI
  account) for heavy use.
- 10 searches per run, up to 500 articles each.
- Returns **citation metadata, not abstracts or full text**. Use the `pmcid` for open-access
  full text via PubMed Central.
- `citedByCount` is PubMed Central's reference count where available, not a Scopus/WoS citation
  count.

### FAQ

**Do I need an NCBI API key?** No.

**Can I get abstracts?** Not in this Actor — it returns citation metadata.

**Does PubMed query syntax work?** Yes, including field tags (`[au]`, `[pdat]`, `[mesh]`) and
boolean operators.

### Changelog

- **0.1 (2026-09-10)** — first release. One row per article, batched esummary, bare DOIs with
  resolvable links, partial dates preserved, bulk searches.

# Actor input Schema

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

Any PubMed query. Full PubMed syntax works, e.g. crispr AND 2024\[pdat], or "Smith J"\[au].

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

Several searches in one run. Up to 10.

## `maxArticles` (type: `integer`):

You are charged per article returned.

## `sort` (type: `string`):

Order results by PubMed relevance, publication date, first author or journal.

## `apiKey` (type: `string`):

NCBI allows 3 requests/second per IP without a key and 10/second with one. Free from your NCBI account. Only needed for heavy runs.

## Actor input object example

```json
{
  "query": "crispr",
  "queries": [],
  "maxArticles": 25,
  "sort": "relevance"
}
```

# Actor output Schema

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

Every item this run produced, as JSON.

## `resultsCsv` (type: `string`):

The same items as a spreadsheet-ready CSV.

# 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 = {
    "query": "crispr",
    "queries": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("eliai/pubmed-articles-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 = {
    "query": "crispr",
    "queries": [],
}

# Run the Actor and wait for it to finish
run = client.actor("eliai/pubmed-articles-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 '{
  "query": "crispr",
  "queries": []
}' |
apify call eliai/pubmed-articles-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,eliai/pubmed-articles-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/M820BEwdZMREUxMwr/builds/qYwYr07aBmVNdBEMo/openapi.json
