Get Scientific Document
Fetch one full document as markdown. This is the target of each download_url returned by GET /v2/datasets/scientific/search.
A PubMed Central article returns its open-access full text with sections, table captions and figure captions, plus a pdf_url. A ClinicalTrials.gov study returns the complete study record.
When no full text exists for the id, the response is 200 with found: false and a reason. An id in the wrong format returns 400. An unknown doc_type returns 404. A failure at the source returns 502.
Path parameters
Document source: pmc or clinicaltrials.
PubMed Central id such as PMC6503629, or ClinicalTrials.gov id such as NCT02000622.
Response
Successful Response
False when no full-text body is available for this id.
‘pmc’ or ‘clinical_trial’.
The full document as markdown.
e.g. ‘pmc_jats_full_text’ | ‘ctgov_record’.
Open-access PDF landing URL (PMC).
Why full text is unavailable, when found=false.
Errors
import json
import requests
BASE_URL = "https://api.filesearch.dev"
API_KEY = "your_api_key"
PMCID = "PMC6503629"
headers = {
"Authorization": f"Bearer {API_KEY}",
}
response = requests.get(
f"{BASE_URL}/v2/datasets/scientific/documents/pmc/{PMCID}",
headers=headers,
timeout=60.0,
)
print(json.dumps(response.json(), indent=2)){
"found": true,
"type": "pmc",
"figure_caption_count": 5,
"markdown": "# PARP inhibitors and homologous recombination deficiency in breast cancer\n\n**Abstract.** ...",
"markdown_source": "pmc_jats_full_text",
"pdf_url": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6503629/pdf/",
"pmcid": "PMC6503629",
"section_count": 12,
"table_caption_count": 3
}