## 3 Materials and Methods  
We developed a systematic pipeline for retrieving and analyzing aging-related clinical trial data from ClinicalTrials.gov using its v2 Application Programming Interface (API). The pipeline, implemented in Python, interacts with the API through custom functions designed for efficient pagination, comprehensive coverage, and minimal rate limit errors (see GitHub link for source code).  
Initial API queries were structured to capture study design, intervention details, enrollment numbers, and outcome measures (Appendix A). We combined search terms such as \"Aged\" and \"tDCS\" and applied regex-based filtering (e.g., \"tds\"), which identified a pool of trials potentially relevant to noninvasive brain stimulation in older adults [53; 54; 55; 56].  
A verification system checked the unique National Clinical Trial (NCT) identifiers retrieved against the total count reported by the API in each data collection cycle. Any discrepancy automatically triggered additional retrieval attempts, ensuring that the final dataset comprehensively represents the available trials.  
All retrieved records were stored in Parquet format to facilitate quick access and seamless transfer between Jupyter notebooks. For broader compatibility and easier manual review, we also maintained copies in CSV and Excel formats. During data cleaning, we standardized placeholders for missing values (e.g., replacing various empty fields with a consistent NULL), converted enrollment counts into numeric fields, and normalized metadata such as FDA regulatory status and healthy-volunteer indicators.  
All core data-processing scripts were written in Python 3.12, leveraging several key libraries:  
* pandas [1], for data manipulation;
* Requests, for handling API interactions;
* NumPy [2], for numerical operations;
* OpenRouter, for coordinating multi-LLM (large language model) requests.  
Version control was maintained for all scripts, configuration files, and environment details (including Python packages and random seeds), thereby ensuring reproducibility of results.  
Table 1: Data Source Transparency.  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Description** & **Details** \\ \hline Data Source & ClinicalTrials.gov \\ \hline API Endpoint URL & [[https://clinicaltrials.gov/data-api/api](https://clinicaltrials.gov/data-api/api)]([https://clinicaltrials.gov/data-api/api](https://clinicaltrials.gov/data-api/api)) \\ \hline Query Terms-Keywords & “Aged” \\ \hline Number of Trials Retrieved & 10,030 trials \\ \hline Inclusion Criteria & Trials explicitly mentioning tDCS, targeting \\  & older adults (aged \(\geq\) 65), and involving brain \\ \hline Exclusion Criteria & Trials not explicitly mentioning tDCS, animal \\  & studies, duplicates, and unrelated interventions \\ \hline Final Number of Trials Analyzed & 83 trials \\ \hline Date of Data Extraction & 1 January 2025 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Data Source Transparency.  
\"secondary_targets\": [\"List of secondary regions\"] or [], \"stimulation_parameters\": [ \"intensity\": \"e.g., 2 mA\" or null, \"duration\": \"e.g., 20 min\" or null  
The prompt was iteratively tested across multiple LLM versions to ensure both syntactic and semantic accuracy. Specifically, format checks verified strict JSON syntax, with the exact schema fields and content checks ensuring proper mapping of the fields (e.g., \"primary_type\", \"is noninvasive\") to trial text.