Loading...
Loading...
Compare original and translation side by side
uvuvuv.env.envFDA_API_KEY.envENV_FILE.envprintf "Enter openFDA API key (typing hidden): " && read -s key && echo && echo "FDA_API_KEY=$key" >> "ENV_FILE" && echo "Saved."dotenv.envcatgrepechoprintenvos.environ.getuvuvuv.env.envFDA_API_KEYprintf "Enter openFDA API key (typing hidden): " && read -s key && echo && echo "FDA_API_KEY=$key" >> "ENV_FILE" && echo "Saved."dotenv.envcatgrepechoprintenvos.environ.getWarning: An automated agent can easily exhaust the 1,000-request daily limit in a single research session. Always set an API key before running multi-query workflows.
Instruct the user to register for a free key at https://open.fda.gov/apis/authentication/ and follow the prerequisite instructions above to addto theFDA_API_KEYfile. The script will emit a warning to stderr if no API key is detected..env
--output--output <file>警告:自动化智能体在单次研究会话中很容易耗尽1000次请求的每日限制。在运行多查询工作流前,务必设置API密钥。
--output--output <file>uv run scripts/openfda_query.py {search,count,download} --output <file> [options]uv run scripts/openfda_query.py {search,count,download} --output <file> [options]uv run scripts/openfda_query.py search \
--category drug --endpoint event \
--search "patient.drug.medicinalproduct:aspirin" \
--limit 5 --output /tmp/fda_results.json{"status": "success", "output": "/tmp/fda_results.json", "results_in_file": 5, "total_matching": 601477}--output--categorydrugdevicefoodtobaccootheranimalandveterinarycosmetictransparency--endpointeventlabel510k--searchpatient.drug.medicinalproduct:aspirin+AND+serious:1--sortreceivedate:desc--limit--skip--api_keyFDA_API_KEYuv run scripts/openfda_query.py search \
--category drug --endpoint event \
--search "patient.drug.medicinalproduct:aspirin" \
--limit 5 --output /tmp/fda_results.json{"status": "success", "output": "/tmp/fda_results.json", "results_in_file": 5, "total_matching": 601477}--output--categorydrugdevicefoodtobaccootheranimalandveterinarycosmetictransparency--endpointeventlabel510k--searchpatient.drug.medicinalproduct:aspirin+AND+serious:1--sortreceivedate:desc--limit--skip--api_keyFDA_API_KEYuv run scripts/openfda_query.py count \
--category drug --endpoint event \
--search "patient.drug.medicinalproduct:aspirin" \
--count_field "patient.reaction.reactionmeddrapt.exact" \
--summary 10 --output /tmp/aspirin_reactions.json--count_field.exact--summary Nuv run scripts/openfda_query.py count \
--category drug --endpoint event \
--search "patient.drug.medicinalproduct:aspirin" \
--count_field "patient.reaction.reactionmeddrapt.exact" \
--summary 10 --output /tmp/aspirin_reactions.json--count_field.exact--summary Nuv run scripts/openfda_query.py download \
--category drug --endpoint event \
--search "patient.drug.medicinalproduct:aspirin" \
--limit 100 --max_pages 5 \
--output /tmp/aspirin_events.json--max_pages--all_resultsTip: Common drugs can have excessive reports. Use a date range (e.g.,) to limit the volume of download.receivedate:[20250101+TO+20250131]
uv run scripts/openfda_query.py download \
--category drug --endpoint event \
--search "patient.drug.medicinalproduct:aspirin" \
--limit 100 --max_pages 5 \
--output /tmp/aspirin_events.json--max_pages--all_results提示:常见药物可能有大量报告。使用日期范围(例如)来限制下载量。receivedate:[20250101+TO+20250131]
.exactundefined.exactundefined
> **Note**: Many brand names in the FDA database include variant suffixes (e.g.,
> "TYLENOL Extra Strength" rather than just "TYLENOL"). If an `.exact` search
> returns 0 results, try without `.exact` to see the available brand name
> variants, then re-query with the full exact name.
The `.exact` suffix is also required when using `--count_field` to aggregate
whole phrases instead of individual words.
> **注意**:FDA数据库中的许多品牌名称包含变体后缀(例如“TYLENOL Extra Strength”而非仅“TYLENOL”)。如果`.exact`搜索返回0条结果,尝试不使用`.exact`查看可用的品牌名称变体,然后使用完整的精确名称重新查询。
在使用`--count_field`聚合整词而非单个单词时,也需要`.exact`后缀。Note: MedDRA is a proprietary ontology and is not indexed in the EMBL-EBI OLS. To approximate MedDRA hierarchy lookups, use the Human Phenotype Ontology (HP) or NCI Thesaurus (NCIT) as proxy ontologies — they cross-reference MedDRA IDs and provide parent/ancestor relationships.
undefined注意:MedDRA是专有本体,未在EMBL-EBI OLS中索引。要近似MedDRA层级查询,请使用**人类表型本体(HP)或NCI词库(NCIT)**作为代理本体——它们交叉引用MedDRA ID并提供父/祖先关系。
undefinedundefinedundefineddrugdevicefoodtobaccootheranimalandveterinarycosmetictransparencydrugdevicefoodtobaccootheranimalandveterinarycosmetictransparencysearch--outputcount--summary 10 --outputdownload--all_results--outputsearch--summary 10 --outputcountdownload--all_results