A Node.js tool that extracts author information and their affiliations from PubMed articles based on search criteria. The tool supports filtering by publication types and date ranges, making it easy to analyze research contributions in specific fields.
- Search PubMed articles with custom queries
- Filter by publication types (e.g., Clinical Trials, Meta-Analyses)
- Filter by publication date range
- Extract author names and their affiliations
- Generate CSV reports with author details
- Handle large result sets with pagination
- Respect PubMed API rate limits
- Configurable search parameters
- Node.js (v12 or higher)
- npm or yarn package manager
- PubMed API key (get one from NCBI)
- Clone the repository:
git clone <repository-url>
cd pubmed-script- Install dependencies:
npm install
# or
yarn install- Configure your settings in
src/config.js:
module.exports = {
API_KEY: 'your-api-key-here',
SEARCH_TERMS: {
QUERY: "your search term",
PUBLICATION_TYPES: [
"Clinical Trial",
"Meta-Analysis"
]
},
PUBLICATION_YEARS: {
START: '2024',
END: '2024'
}
// ... other settings
};Run the script:
npm start
# or
yarn startThe tool will:
- Search PubMed for articles matching your criteria
- Extract author information and affiliations
- Generate a CSV file with the results
Edit src/config.js to customize:
API_KEY: Your PubMed API keySEARCH_TERMS:QUERY: Your search termPUBLICATION_TYPES: Array of publication types to filter
PUBLICATION_YEARS: Date range for publicationsMAX_RESULTS: Maximum number of results to fetch (default: 10000)BATCH_SIZE: Number of articles to process per batch (default: 20)DELAY_MS: Delay between API requests in milliseconds (default: 1000)
The tool generates a CSV file with the following columns:
- Author Name
- Affiliations (semicolon-separated)
- Titles (semicolon-separated with publication years)
Example output file name:
- Copy the example environment file:
cp .env.example .env- Edit
.envand add your PubMed API key:
PUBMED_API_KEY=your_api_key_here
You can get your API key from NCBI