{
  "openapi": "3.0.1",
  "info": {
    "title": "PubMed Scraper - Articles, Abstracts, Authors & MeSH",
    "description": "For literature reviews, RAG pipelines and LLM training sets: PubMed articles with the full abstract, authors with affiliations and ORCID, DOI, PMC ID and MeSH terms. Goes past PubMed's 9,999-result cap by slicing dates, so a 70,772-hit search comes back whole. Export as JSON, CSV or Excel.",
    "version": "0.1",
    "x-build-id": "OiHw3CeqNxYSqR4wd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/neverempty~pubmed-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-neverempty-pubmed-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/neverempty~pubmed-scraper/runs": {
      "post": {
        "operationId": "runs-sync-neverempty-pubmed-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/neverempty~pubmed-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-neverempty-pubmed-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "Anything you would type into the PubMed search box, including its syntax: AND / OR / NOT, \"exact phrases\" and field tags such as [Title/Abstract], [MeSH Terms] or [Affiliation]. If PubMed cannot find a word, cannot find a quoted phrase, or would ignore part of the query, it normally drops or unquotes that part and quietly returns a wider search; here nothing is fetched or charged in that case and a row says what PubMed would have changed. A quoted phrase that PubMed does match is searched as a phrase, as asked."
          },
          "authors": {
            "title": "Authors",
            "type": "array",
            "description": "Author names as PubMed writes them, one per line: Doudna JA or Doudna, Jennifer A. A name is matched exactly as written, so Smith J does not also return Smith JA (for that wider form, write Smith J[au] in the search query). Several authors mean any of them (OR). When you give two or more, each is also counted on its own and a name with no articles at all comes back as its own row, because PubMed drops an unknown author from an OR list without saying so.",
            "items": {
              "type": "string"
            }
          },
          "journals": {
            "title": "Journals",
            "type": "array",
            "description": "Journal titles or their abbreviations, one per line: Nature, The New England journal of medicine or N Engl J Med. Several journals mean any of them (OR).",
            "items": {
              "type": "string"
            }
          },
          "publicationTypes": {
            "title": "Article types",
            "type": "array",
            "description": "Keep only these PubMed publication types. Several types mean any of them (OR).",
            "items": {
              "type": "string",
              "enum": [
                "Journal Article",
                "Review",
                "Systematic Review",
                "Meta-Analysis",
                "Randomized Controlled Trial",
                "Controlled Clinical Trial",
                "Clinical Trial",
                "Clinical Trial, Phase I",
                "Clinical Trial, Phase II",
                "Clinical Trial, Phase III",
                "Clinical Trial, Phase IV",
                "Clinical Trial Protocol",
                "Observational Study",
                "Multicenter Study",
                "Comparative Study",
                "Validation Study",
                "Evaluation Study",
                "Case Reports",
                "Practice Guideline",
                "Guideline",
                "Consensus Development Conference, NIH",
                "Editorial",
                "Letter",
                "Comment",
                "News",
                "Preprint",
                "Retracted Publication",
                "Retraction Notice",
                "Expression of Concern",
                "Published Erratum"
              ]
            }
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Earliest date, written 2024, 2024-03 or 2024-03-15. Leave empty for no lower limit. A date that does not exist (2025-02-30) is refused rather than sent, because PubMed answers a malformed date with zero results."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Latest date, written the same way. 2024 means up to 31 December 2024. Leave empty for no upper limit."
          },
          "dateType": {
            "title": "Which date",
            "enum": [
              "publication",
              "added"
            ],
            "type": "string",
            "description": "publication = the article's publication date (an article with separate online and print dates matches either). added = the day the record was added to PubMed, which is the one to use for new articles since your last run.",
            "default": "publication"
          },
          "pmids": {
            "title": "PMIDs to look up",
            "type": "array",
            "description": "PubMed IDs to fetch directly, one per line: 33087898, PMID: 33087898 or a pubmed.ncbi.nlm.nih.gov link. Up to 10,000 per run. A PMID PubMed has no record for comes back as its own row saying so (not charged). This can be combined with a search; an article found both ways is returned and charged once.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Order",
            "enum": [
              "relevance",
              "pub_date",
              "Author",
              "JournalName"
            ],
            "type": "string",
            "description": "relevance = PubMed's Best Match. pub_date = newest publication first. Past 9,999 results the search is split by date added, newest first, and this order applies within each part.",
            "default": "relevance"
          },
          "maxResults": {
            "title": "Maximum articles",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "How many articles the search returns (PMID lookups are not counted against this). You are charged for the articles you actually receive. PubMed lets one search read only 9,999 results; above that this Actor splits the search by the date each article was added to PubMed, so up to 100,000 can be returned. Measured rate is about 19 articles a second, so the default one-hour run timeout reaches roughly 69,000 - for more than that, give the run a longer timeout. A run that runs out of time stops and adds a row saying so, instead of presenting a part as the whole.",
            "default": 100
          },
          "maxRetries": {
            "title": "Attempts per request",
            "minimum": 1,
            "maximum": 6,
            "type": "integer",
            "description": "How many times to try a request in total when PubMed does not answer or answers that too many requests arrived (it allows three per second). A rejected request is never retried.",
            "default": 4
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}