PubMedToolkit
- timeout (Optional[float]): The timeout for API requests in seconds. (default: :obj:
None
)
init
_make_request
- endpoint (str): The API endpoint to call.
- params (Dict[str, Union[str, int]]): Query parameters.
- retries (int, optional): Number of retry attempts. (default: :obj:
3
)
search_papers
- query (str): The search query string.
- max_results (int, optional): Maximum number of results to return. (default: :obj:
10
) - sort (str, optional): Sort order - ‘relevance’ or ‘date’. (default: :obj:
"relevance"
) - date_range (Optional[Dict[str, str]], optional): Date range filter with ‘from’ and ‘to’ dates in YYYY/MM/DD format. (default: :obj:
None
) - publication_type (Optional[List[str]], optional): Filter by publication types (e.g., [“Journal Article”, “Review”]). (default: :obj:
None
)
get_paper_details
- paper_id (Union[str, int]): PubMed ID of the paper.
- include_references (bool, optional): Whether to include referenced papers. (default: :obj:
False
)
get_abstract
- paper_id (Union[str, int]): PubMed ID of the paper.
get_citation_count
- paper_id (Union[str, int]): PubMed ID of the paper.
get_related_papers
- paper_id (Union[str, int]): PubMed ID of the paper.
- max_results (int, optional): Maximum number of results to return. (default: :obj:
10
)