Source: https://github.com/aipoch/medical-research-skills
PMC Official Literature Download Skill
Skill Objective
Converge "download PubMed literature" requests into a single legal, traceable PMC workflow:
- First determine whether the article can actually be obtained through official PMC channels
- Only use officially permitted PMC services
- After downloading, retain source, license, and timestamp information for future reproducibility
The core of this skill is not "get any full text as fast as possible" but rather "only obtain legally accessible PMC content through officially permitted methods."
Trigger Scenarios
Use this skill first when the user has requests like:
- "Help me download this PubMed article"
- "Save the PMC full text corresponding to this PMID/PMCID"
- "Batch download PMC Open Access Subset"
- "Only use official methods to download articles from PMC"
- "Help me determine if this article can be legally downloaded from PMC"
If the user mentions Sci-Hub, mirror sites, bulk web scraping, bypassing restrictions, or similar approaches, refuse those paths directly and explain feasible alternatives using official PMC methods.
Permitted Official Channels
Only use the following official PMC channels:
PMC Cloud Service
PMC FTP Service
PMC OAI-PMH Service
PMC OA Web Service
E-utilities
BioC API
These are services explicitly permitted by PMC for automated retrieval or downloading. Do not use any other automated scraping methods.
Workflow
Step 1: Confirm What the User Actually Needs
First confirm three things:
- Whether the input is a
PMID, PMCID, DOI, or title keywords
- Whether the user wants a single full-text article, batch download, or just metadata
- Whether the target format is
XML, JSON, plain text, or PDF
If the user only provides a PMID, first map it to a PMCID, because whether it can be legally downloaded from PMC depends on whether the article exists in the PMC accessible collection.
Step 2: Determine Whether Legal Download is Possible
First determine whether the article belongs to a PMC accessible collection:
PMC Open Access Subset
PMC Author Manuscript Collection
If not in these collections, do not attempt to bypass restrictions or look for unofficial sites.
State directly:
- This article cannot be obtained through official PMC full-text download channels
- If the user needs it, I can help them use the abstract, citation information instead, or look for other legally public sources
Step 3: Select the Official Method
Choose the most appropriate official channel by scenario:
- For single full-text articles, prefer machine-readable content via
BioC API
- When retrieving
XML/JSON by PMID or PMCID, prefer BioC API
- When batch-syncing a local mirror, prefer
PMC OA Web Service or PMC Cloud Service
- For more general retrieval, location, and record-keeping, use
E-utilities
- For batch metadata harvesting, use
OAI-PMH
- When article packages,
XML, PDF, media files, or supplementary materials are needed, prefer PMC FTP Service or PMC Cloud Service
Notes:
- Only download
PDF when it is explicitly provided in the official article package
- Do not scrape publisher web pages or third-party hosting pages to obtain
PDF
- If the current article package does not contain a
PDF, inform the user honestly
Step 4: Leave an Audit Trail When Saving Locally
When downloading, save the following information whenever possible:
- Original identifier
- Source service name
- Download timestamp
- License/collection information
- Local file path
Recommended output directory:
pmc-downloads/<identifier>/
If writing JSON metadata, use UTF-8 encoding and preserve original Chinese text — do not force-escape Chinese characters.
Recommended Single-Article Download Method
If the user wants full text for a single PMID / PMCID and accepts XML or JSON, prefer the helper script bundled with this skill:
python scripts/download_pmc_bioc.py
This script only uses the official PMC BioC API and is suitable for downloading the machine-readable version of a single publicly accessible full-text article.
Recommended Batch Download Method
If the user wants to batch-pull PMC public collections, follow these principles:
- Prefer using
Cloud Service, FTP Service, or OA Web Service from the official PMC dataset page
- Do not hardcode old download paths
- If the official page indicates download location or service migration, defer to the current PMC documentation
Output Format
When answering the user, include the following information whenever possible:
- Whether this article can be downloaded through official PMC channels
- Which official service was used
- The downloaded file type
- File save location
- If download is not possible, provide a clear reason
Prohibited Actions
- Using unofficial mirrors, piracy sites, or third-party full-text repositories is prohibited
- Bulk web scraping of PMC page content is prohibited
- Bypassing license restrictions is prohibited
- Treating "can access the web page" as equivalent to "can automate batch downloads" is prohibited
Failure Handling
If an official channel does not return content, troubleshoot in the following order:
- Check if the identifier is incorrect
- Check if the article is not in the PMC accessible collection at all
- Check if the target format is not supported by that service
- Check if the current article has license restrictions
If still failing, honestly inform the user of the reason it cannot be downloaded and provide official alternative paths.
Practical Pitfalls
These are the most common gotchas with this skill — pay special attention when handling:
- The
citation_pdf_url on article pages is often just a PDF viewer page, not necessarily a directly saveable binary PDF
- Before actually downloading, first use
PMC OA Web Service to verify whether the PMCID is open, then get the official pdf link
- Official
ftp://ftp.ncbi.nlm.nih.gov/... links can usually be changed to https://ftp.ncbi.nlm.nih.gov/..., which is more stable in local environments
- After downloading, always check if the file header starts with
%PDF to avoid saving HTML as PDF by mistake
- Even if a title looks like "recent 3-year OA literature," it may not actually be in PMC's Open Access collection — do not judge downloadability by title alone
- For
PMID, do not assume it can directly download full text — first map to PMCID, then determine downloadability
Command Line Usage
Prefer the unified entry point — do not rely on modifying constants at the top of scripts, and do not make yourself remember two script names:
python scripts/download_pmc.py --pmcid PMC13011518 --pmcid PMC11656652 --pmcid PMC11787101
python scripts/download_pmc.py --identifier PMC11787101
If the user has already provided a set of PMCIDs, PMIDs, or download directory, pass them directly to download_pmc.py rather than temporarily modifying code. Only fall back to the underlying scripts when you explicitly need to debug BioC or PDF details separately.
When to Use
- Use this skill when the user explicitly needs to perform the core task of pmc-official-download and has provided the minimum executable input.
- Use this skill when you need a structured deliverable rather than general advice.
- Use this skill when the current task can be completed using this skill's bundled scripts, templates, or reference materials.
When Not to Use
- Do not proceed when required input files, identifiers, parameters, or context are missing — ask the user to provide them first.
- Do not assume capabilities beyond this skill's declared scope when the user requests external operations or inferences.
- Do not proceed without user confirmation when overwriting existing results, executing high-cost batch operations, or expanding task scope.
Required Inputs
| Field |
Required |
Format/Source |
Example |
If Missing |
| User task description |
Yes |
Text |
Research question, writing goal, analysis objective |
Stop and ask user to provide |
| Primary input material |
Depends on task |
Text, file path, ID, table, or literature |
PMID, PDF, CSV, DOCX, keywords, etc. |
Specify which material type is missing |
| Output preference |
No |
Text |
Language, format, target journal, template |
Use skill default format |
Output Contract
- Primary output: Structured result or target file aligned with this skill's objective.
- Optional output: Intermediate check notes, issue list, supplementary suggestions, or generated file paths.
- Format requirement: Unless the user specifies otherwise, prefer stable, reviewable Markdown or JSON; if the skill's bundled script requires a fixed format, use that format.
- If partially complete: Must explicitly mark as PARTIAL and state which steps are completed and which remain.
Failure Handling
- Missing critical input: Explicitly state which fields, files, or identifiers are missing and pause.
- Script, template, or resource execution failure: Report the failing step, likely cause, and recovery suggestions — do not silently degrade.
- Partial completion only: Return the verified portion first, then list remaining blockers and suggested next steps.
User Checkpoints
- Before executing batch processing, overwriting files, long-running searches, or multi-stage generation, confirm scope and output format with the user.
- Before proceeding when a key judgment is ambiguous, evidence is insufficient, or the workflow is entering the next stage, confirm with the user.
Input Validation
This skill accepts requests that match the documented purpose of pmc-official-download and include enough context to complete the workflow safely.
Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
pmc-official-download only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
Quick Validation
- Check that key scripts, templates, or reference file paths this skill depends on exist.
- Check that the final output contains the core fields, sections, or files specified for this task.
- Check that results clearly mark assumptions, limitations, and incomplete items.
1---2name: pmc-official-download3description: Download PubMed/PMC literature using officially permitted PMC methods. Whenever the user wants to download PMC full text, batch-retrieve PMC Open Access Subset articles, save full text corresponding to PMID/PMCID locally, or needs to determine whether a PubMed article can be l...4license: MIT5---6> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)
7
8
9# PMC Official Literature Download Skill
10
11## Skill Objective
12
13Converge "download PubMed literature" requests into a single legal, traceable PMC workflow:
14
15- First determine whether the article can actually be obtained through official PMC channels
16- Only use officially permitted PMC services
17- After downloading, retain source, license, and timestamp information for future reproducibility
18
19The core of this skill is not "get any full text as fast as possible" but rather "only obtain legally accessible PMC content through officially permitted methods."
20
21## Trigger Scenarios
22
23Use this skill first when the user has requests like:
24
25- "Help me download this PubMed article"
26- "Save the PMC full text corresponding to this PMID/PMCID"
27- "Batch download PMC Open Access Subset"
28- "Only use official methods to download articles from PMC"
29- "Help me determine if this article can be legally downloaded from PMC"
30
31If the user mentions Sci-Hub, mirror sites, bulk web scraping, bypassing restrictions, or similar approaches, refuse those paths directly and explain feasible alternatives using official PMC methods.
32
33## Permitted Official Channels
34
35Only use the following official PMC channels:
36
37- `PMC Cloud Service`
38- `PMC FTP Service`
39- `PMC OAI-PMH Service`
40- `PMC OA Web Service`
41- `E-utilities`
42- `BioC API`
43
44These are services explicitly permitted by PMC for automated retrieval or downloading. Do not use any other automated scraping methods.
45
46## Workflow
47
48### Step 1: Confirm What the User Actually Needs
49
50First confirm three things:
51
52- Whether the input is a `PMID`, `PMCID`, `DOI`, or title keywords
53- Whether the user wants a single full-text article, batch download, or just metadata
54- Whether the target format is `XML`, `JSON`, plain text, or `PDF`
55
56If the user only provides a `PMID`, first map it to a `PMCID`, because whether it can be legally downloaded from PMC depends on whether the article exists in the PMC accessible collection.
57
58### Step 2: Determine Whether Legal Download is Possible
59
60First determine whether the article belongs to a PMC accessible collection:
61
62- `PMC Open Access Subset`
63- `PMC Author Manuscript Collection`
64
65If not in these collections, do not attempt to bypass restrictions or look for unofficial sites.
66
67State directly:
68
69- This article cannot be obtained through official PMC full-text download channels
70- If the user needs it, I can help them use the abstract, citation information instead, or look for other legally public sources
71
72### Step 3: Select the Official Method
73
74Choose the most appropriate official channel by scenario:
75
76- For single full-text articles, prefer machine-readable content via `BioC API`
77- When retrieving `XML/JSON` by `PMID` or `PMCID`, prefer `BioC API`
78- When batch-syncing a local mirror, prefer `PMC OA Web Service` or `PMC Cloud Service`
79- For more general retrieval, location, and record-keeping, use `E-utilities`
80- For batch metadata harvesting, use `OAI-PMH`
81- When article packages, `XML`, `PDF`, media files, or supplementary materials are needed, prefer `PMC FTP Service` or `PMC Cloud Service`
82
83Notes:
84
85- Only download `PDF` when it is explicitly provided in the official article package
86- Do not scrape publisher web pages or third-party hosting pages to obtain `PDF`
87- If the current article package does not contain a `PDF`, inform the user honestly
88
89### Step 4: Leave an Audit Trail When Saving Locally
90
91When downloading, save the following information whenever possible:
92
93- Original identifier
94- Source service name
95- Download timestamp
96- License/collection information
97- Local file path
98
99Recommended output directory:
100
101```text
102pmc-downloads/<identifier>/
103```
104
105If writing JSON metadata, use UTF-8 encoding and preserve original Chinese text — do not force-escape Chinese characters.
106
107## Recommended Single-Article Download Method
108
109If the user wants full text for a single `PMID` / `PMCID` and accepts `XML` or `JSON`, prefer the helper script bundled with this skill:
110
111```text
112python scripts/download_pmc_bioc.py
113```
114
115This script only uses the official PMC `BioC API` and is suitable for downloading the machine-readable version of a single publicly accessible full-text article.
116
117## Recommended Batch Download Method
118
119If the user wants to batch-pull PMC public collections, follow these principles:
120
121- Prefer using `Cloud Service`, `FTP Service`, or `OA Web Service` from the official PMC dataset page
122- Do not hardcode old download paths
123- If the official page indicates download location or service migration, defer to the current PMC documentation
124
125## Output Format
126
127When answering the user, include the following information whenever possible:
128
129- Whether this article can be downloaded through official PMC channels
130- Which official service was used
131- The downloaded file type
132- File save location
133- If download is not possible, provide a clear reason
134
135## Prohibited Actions
136
137- Using unofficial mirrors, piracy sites, or third-party full-text repositories is prohibited
138- Bulk web scraping of PMC page content is prohibited
139- Bypassing license restrictions is prohibited
140- Treating "can access the web page" as equivalent to "can automate batch downloads" is prohibited
141
142## Failure Handling
143
144If an official channel does not return content, troubleshoot in the following order:
145
1461. Check if the identifier is incorrect
1472. Check if the article is not in the PMC accessible collection at all
1483. Check if the target format is not supported by that service
1494. Check if the current article has license restrictions
150
151If still failing, honestly inform the user of the reason it cannot be downloaded and provide official alternative paths.
152
153## Practical Pitfalls
154
155These are the most common gotchas with this skill — pay special attention when handling:
156
157- The `citation_pdf_url` on article pages is often just a PDF viewer page, not necessarily a directly saveable binary PDF
158- Before actually downloading, first use `PMC OA Web Service` to verify whether the `PMCID` is open, then get the official `pdf` link
159- Official `ftp://ftp.ncbi.nlm.nih.gov/...` links can usually be changed to `https://ftp.ncbi.nlm.nih.gov/...`, which is more stable in local environments
160- After downloading, always check if the file header starts with `%PDF` to avoid saving HTML as PDF by mistake
161- Even if a title looks like "recent 3-year OA literature," it may not actually be in PMC's Open Access collection — do not judge downloadability by title alone
162- For `PMID`, do not assume it can directly download full text — first map to `PMCID`, then determine downloadability
163
164## Command Line Usage
165
166Prefer the unified entry point — do not rely on modifying constants at the top of scripts, and do not make yourself remember two script names:
167
168```bash
169python scripts/download_pmc.py --pmcid PMC13011518 --pmcid PMC11656652 --pmcid PMC11787101
170python scripts/download_pmc.py --identifier PMC11787101
171```
172
173If the user has already provided a set of `PMCID`s, `PMID`s, or download directory, pass them directly to `download_pmc.py` rather than temporarily modifying code. Only fall back to the underlying scripts when you explicitly need to debug BioC or PDF details separately.
174
175## When to Use
176
177- Use this skill when the user explicitly needs to perform the core task of pmc-official-download and has provided the minimum executable input.
178- Use this skill when you need a structured deliverable rather than general advice.
179- Use this skill when the current task can be completed using this skill's bundled scripts, templates, or reference materials.
180
181## When Not to Use
182
183- Do not proceed when required input files, identifiers, parameters, or context are missing — ask the user to provide them first.
184- Do not assume capabilities beyond this skill's declared scope when the user requests external operations or inferences.
185- Do not proceed without user confirmation when overwriting existing results, executing high-cost batch operations, or expanding task scope.
186
187## Required Inputs
188
189| Field | Required | Format/Source | Example | If Missing |
190|---|---|---|---|---|
191| User task description | Yes | Text | Research question, writing goal, analysis objective | Stop and ask user to provide |
192| Primary input material | Depends on task | Text, file path, ID, table, or literature | PMID, PDF, CSV, DOCX, keywords, etc. | Specify which material type is missing |
193| Output preference | No | Text | Language, format, target journal, template | Use skill default format |
194
195## Output Contract
196
197- Primary output: Structured result or target file aligned with this skill's objective.
198- Optional output: Intermediate check notes, issue list, supplementary suggestions, or generated file paths.
199- Format requirement: Unless the user specifies otherwise, prefer stable, reviewable Markdown or JSON; if the skill's bundled script requires a fixed format, use that format.
200- If partially complete: Must explicitly mark as PARTIAL and state which steps are completed and which remain.
201
202## Failure Handling
203
204- Missing critical input: Explicitly state which fields, files, or identifiers are missing and pause.
205- Script, template, or resource execution failure: Report the failing step, likely cause, and recovery suggestions — do not silently degrade.
206- Partial completion only: Return the verified portion first, then list remaining blockers and suggested next steps.
207
208## User Checkpoints
209
210- Before executing batch processing, overwriting files, long-running searches, or multi-stage generation, confirm scope and output format with the user.
211- Before proceeding when a key judgment is ambiguous, evidence is insufficient, or the workflow is entering the next stage, confirm with the user.
212
213
214## Input Validation
215
216This skill accepts requests that match the documented purpose of `pmc-official-download` and include enough context to complete the workflow safely.
217
218Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
219
220> `pmc-official-download` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
221
222## Quick Validation
223
224- Check that key scripts, templates, or reference file paths this skill depends on exist.
225- Check that the final output contains the core fields, sections, or files specified for this task.
226- Check that results clearly mark assumptions, limitations, and incomplete items.