Get Scientific Document

GEThttps://api.filesearch.dev/v2/datasets/scientific/documents/:doc_type/:doc_id

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

doc_typestringRequired

Document source: pmc or clinicaltrials.

doc_idstringRequired

PubMed Central id such as PMC6503629, or ClinicalTrials.gov id such as NCT02000622.

Response

Successful Response

foundboolean

False when no full-text body is available for this id.

typestring

‘pmc’ or ‘clinical_trial’.

figure_caption_countinteger or nullOptional
markdownstring or nullOptional

The full document as markdown.

markdown_sourcestring or nullOptional

e.g. ‘pmc_jats_full_text’ | ‘ctgov_record’.

nct_idstring or nullOptional
pdf_urlstring or nullOptional

Open-access PDF landing URL (PMC).

pmcidstring or nullOptional
reasonstring or nullOptional

Why full text is unavailable, when found=false.

section_countinteger or nullOptional
table_caption_countinteger or nullOptional

Errors

GET/v2/datasets/scientific/documents/:doc_type/:doc_id
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))
200
{
  "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
}
Was this page helpful?