Search Scientific Documents
Search PubMed Central open-access articles and ClinicalTrials.gov study records. The same query returns the same list: no model is involved, and results from the two sources are merged in a fixed order.
Every result is a document with full text available. Its download_url fetches that document as markdown from GET /v2/datasets/scientific/documents/{doc_type}/{doc_id}. Send the same Authorization header when following it.
limit applies per source, so a request can return up to twice that many results. When one source fails, results from the other are still returned and the failure is listed in errors.
Query parameters
2-2000 charactersSearch query, 2 to 2000 characters.
1-25Defaults to 10Maximum results per source, 1 to 25.
1-50Defaults to 10Prefer documents from this many years back, where the source supports date filtering. 1 to 50.
Response
Successful Response
The query that was searched.
Per-source error messages (empty when all succeeded).
Results grouped by source (pmc, clinicaltrials).
0Errors
import json
import requests
BASE_URL = "https://api.filesearch.dev"
API_KEY = "your_api_key"
headers = {
"Authorization": f"Bearer {API_KEY}",
}
response = requests.get(
f"{BASE_URL}/v2/datasets/scientific/search",
headers=headers,
params={"q": "PARP inhibitor BRCA1 breast cancer", "limit": 5, "recency_years": 10},
timeout=30.0,
)
print(json.dumps(response.json(), indent=2)){
"query": "PARP inhibitor BRCA1 breast cancer",
"errors": {},
"execution_time_ms": 842,
"results": [
{
"download_url": "https://api.filesearch.dev/v2/datasets/scientific/documents/pmc/PMC6503629",
"type": "pmc",
"full_text_available": true,
"journal": "Cancer Research",
"pmcid": "PMC6503629",
"title": "PARP inhibitors and homologous recombination deficiency in breast cancer",
"year": 2024
},
{
"download_url": "https://api.filesearch.dev/v2/datasets/scientific/documents/clinicaltrials/NCT02000622",
"type": "clinical_trial",
"full_text_available": true,
"nct_id": "NCT02000622",
"phase": "PHASE3",
"status": "ACTIVE_NOT_RECRUITING",
"title": "Olaparib as Adjuvant Treatment in Patients With Germline BRCA Mutated High Risk HER2 Negative Primary Breast Cancer"
}
],
"results_by_source": {
"pmc": [
{
"download_url": "https://api.filesearch.dev/v2/datasets/scientific/documents/pmc/PMC6503629",
"type": "pmc",
"full_text_available": true,
"journal": "Cancer Research",
"pmcid": "PMC6503629",
"title": "PARP inhibitors and homologous recombination deficiency in breast cancer",
"year": 2024
}
],
"clinicaltrials": [
{
"download_url": "https://api.filesearch.dev/v2/datasets/scientific/documents/clinicaltrials/NCT02000622",
"type": "clinical_trial",
"full_text_available": true,
"nct_id": "NCT02000622",
"phase": "PHASE3",
"status": "ACTIVE_NOT_RECRUITING",
"title": "Olaparib as Adjuvant Treatment in Patients With Germline BRCA Mutated High Risk HER2 Negative Primary Breast Cancer"
}
]
},
"sources_searched": [
"pmc",
"clinicaltrials"
],
"total_results": 2
}