# fetchPubmedArticles

**Identifier:** `pubmed_fetchPubmedArticles`

**Provider:** [PubMed](https://kirha.com/providers/pubmed.md)

Fetch full article details from PubMed using EFetch. Returns complete article metadata including abstract, authors, journal info, MeSH (Medical Subject Headings) terms, and keywords for up to 20 PMIDs. Safe to bind to PMIDs from searchPubmed/findRelatedArticles: an empty pmids array returns empty articles without calling the API.

## Run it with the CLI

```bash
kirha tools run pubmed_fetchPubmedArticles \
  --input '{
    "pmids": [
      "<pmids>"
    ]
  }'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "pubmed_fetchPubmedArticles",
  "input": {
    "pmids": [
      "<pmids>"
    ]
  }
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "includeKeywords": {
      "default": true,
      "type": "boolean"
    },
    "includeMeshTerms": {
      "default": true,
      "type": "boolean"
    },
    "includeReferences": {
      "default": false,
      "type": "boolean"
    },
    "pmids": {
      "description": "PubMed IDs to fetch. Empty array is allowed and returns no articles.",
      "items": {
        "type": "string"
      },
      "maxItems": 20,
      "type": "array"
    }
  },
  "required": [
    "pmids"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "articles": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "abstract": {
            "type": "string"
          },
          "authorCount": {
            "description": "Total number of authors on the article",
            "type": "number"
          },
          "authors": {
            "description": "First 6 authors only, affiliation kept for the first 1; see authorCount for the full total",
            "items": {
              "additionalProperties": false,
              "properties": {
                "affiliation": {
                  "type": "string"
                },
                "firstName": {
                  "type": "string"
                },
                "initials": {
                  "type": "string"
                },
                "lastName": {
                  "type": "string"
                }
              },
              "required": [
                "lastName",
                "firstName",
                "initials"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "doi": {
            "type": "string"
          },
          "europePmcUrl": {
            "description": "Europe PMC mirror URL for the same full-text article. Only present when pmcId is available.",
            "type": "string"
          },
          "journal": {
            "additionalProperties": false,
            "properties": {
              "isoAbbreviation": {
                "type": "string"
              },
              "issue": {
                "type": "string"
              },
              "pages": {
                "type": "string"
              },
              "pubDate": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "volume": {
                "type": "string"
              }
            },
            "required": [
              "title",
              "isoAbbreviation",
              "pubDate"
            ],
            "type": "object"
          },
          "keywords": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "meshTermCount": {
            "description": "Total number of MeSH terms on the article",
            "type": "number"
          },
          "meshTerms": {
            "description": "First 12 MeSH terms only; see meshTermCount for the full total",
            "items": {
              "additionalProperties": false,
              "properties": {
                "descriptor": {
                  "type": "string"
                },
                "isMajorTopic": {
                  "type": "boolean"
                },
                "qualifier": {
                  "type": "string"
                }
              },
              "required": [
                "descriptor",
                "isMajorTopic"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "pmcArticleUrl": {
            "description": "Canonical PMC article landing URL. Only present when pmcId is available.",
            "type": "string"
          },
          "pmcId": {
            "description": "PubMed Central ID (e.g. 'PMC1234567'). Present only when the article has a free full-text version on PMC.",
            "type": "string"
          },
          "pmcPdfUrl": {
            "description": "Direct downloadable PDF URL on PubMed Central. Only present when pmcId is available.",
            "type": "string"
          },
          "pmid": {
            "type": "string"
          },
          "publicationTypes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "pmid",
          "title",
          "abstract",
          "authors",
          "authorCount",
          "journal",
          "publicationTypes"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "context": {
      "type": "string"
    },
    "notFoundPmids": {
      "items": {
        "type": "string"
      },
      "type": "array"
    }
  },
  "required": [
    "context",
    "articles",
    "notFoundPmids"
  ],
  "type": "object"
}
```

## Related tools

Other PubMed tools that this tool refers to, or that refer to it.

- [`findRelatedArticles`](https://kirha.com/providers/pubmed/findRelatedArticles.md)
- [`searchPubmed`](https://kirha.com/providers/pubmed/searchPubmed.md)

-----

[All PubMed tools](https://kirha.com/providers/pubmed.md) · [< Back to tools list](https://kirha.com/tools.md)