MedQuery 2.0.11

dotnet add package MedQuery --version 2.0.11
                    
NuGet\Install-Package MedQuery -Version 2.0.11
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MedQuery" Version="2.0.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MedQuery" Version="2.0.11" />
                    
Directory.Packages.props
<PackageReference Include="MedQuery" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MedQuery --version 2.0.11
                    
#r "nuget: MedQuery, 2.0.11"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MedQuery@2.0.11
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MedQuery&version=2.0.11
                    
Install as a Cake Addin
#tool nuget:?package=MedQuery&version=2.0.11
                    
Install as a Cake Tool

MedQuery

The MedQuery library is a wrapper around the PubMed APIs for EFetch and ESearch. It allows for querying and retrieving publication data from PubMed.

Features

  • Query PubMed for journal article and book publication data
  • Query constructor for author, title, affiliation, and date-based searches
  • Parse PubMed TXT article data files
  • Parse PubMed XML article data files

Installation

To install MedQuery, you can use the following command:

dotnet add package MedQuery --version [latest version number]

Usage

// Create search criteria
SearchTerms searchTerms = new SearchTerms()
  .DateTerm(THIS_YEAR)
  .AuthorTerm("John Doe")
  .AuthorTerm("Jane Doe")
  .AffiliateTerm("University of Learning");

// Instantiate an EUtilsAPI with the search terms
EUtils api = new EUtilsAPI(searchTerms);

// Run your search
if (await api.GetResultsAsync())
{
  // Handle results in the here...
  foreach (var article in api.SearchResults.Articles)
  {
    // Do work... //
  }
}

Limitations

We tested and thoroughly reviewed the ESearch/EFetch documentation to ensure that all search result data is captured, but this API may still miss some data types. An 'errorTracking' argument has been provided in the 'GetResultsAsync' method to allow users to detect if data types were missed when generating search results. When activated, this may slow down the response time for searches.

Over time, we hope to add additional publication types and databases to this API.

Updates

  • Added book results.
  • Moved the search result data into the 'SearchResult' property of the 'EUtilAPI'.
  • Fixed bugs that prevented some publication data stored in outer XML fields from populating.
  • Added an error reporting option to searches designed to detect data fields not handled by this API.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please direct any contribution requests to the repository owner.

Contact

For any questions or issues, please open an issue on this repository or contact the repository owner directly.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.11 202 6/16/2025
2.0.0 295 12/18/2024
1.1.3 202 9/11/2024
1.0.1 192 9/5/2024
1.0.0 173 9/5/2024

- Added search term constructor
- Streamlined EUtilsAPI constructor