{
  "openapi": "3.0.1",
  "info": {
    "title": "PubMed Articles Scraper",
    "description": "Full PubMed records - abstracts, authors with affiliations, MeSH terms, grants, DOI and free-full-text links. PubMed serves at most 9,999 records per query and the history server does not open that window, so larger queries are cut into Entrez-date slices automatically.",
    "version": "0.1",
    "x-build-id": "mMMeYB423HTPVeznH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapyx~pubmed-articles-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapyx-pubmed-articles-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/scrapyx~pubmed-articles-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapyx-pubmed-articles-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/scrapyx~pubmed-articles-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapyx-pubmed-articles-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": {
          "mode": {
            "title": "What to collect",
            "enum": [
              "search",
              "articles",
              "citedby"
            ],
            "type": "string",
            "description": "search = find articles by query. articles = fetch the PMIDs you name. citedby = fetch every article that cites the PMIDs you name.",
            "default": "search"
          },
          "searchTerm": {
            "title": "Search query",
            "type": "string",
            "description": "For mode='search'. Full PubMed query syntax works: crispr AND \"gene therapy\"[MeSH Terms] AND 2020:2024[dp]. Note that PubMed silently expands a plain phrase through MeSH — 'heart attack' runs as a five-clause boolean — and the summary row publishes the query it actually ran as queryTranslation."
          },
          "pmids": {
            "title": "PubMed IDs",
            "type": "array",
            "description": "For mode='articles' and mode='citedby'. A numeric PMID like 38786024, or a pubmed.ncbi.nlm.nih.gov URL. A PMID that does not exist comes back as an honest zero, listed under pmidsNotFound.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max articles",
            "minimum": 0,
            "type": "integer",
            "description": "Set 0 for unlimited. PubMed serves at most 9,999 records per query; above that this actor cuts the query into Entrez-date slices automatically (see Break the 9,999 window).",
            "default": 50
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "none",
              "relevance",
              "pub_date",
              "Author",
              "JournalName"
            ],
            "type": "string",
            "description": "PubMed IGNORES an unknown sort without error and returns its own default order instead, so only the four it honours are offered here. 'none' omits the parameter and takes upstream's default.",
            "default": "none"
          },
          "minDate": {
            "title": "From date",
            "type": "string",
            "description": "YYYY/MM/DD. WARNING about PubMed itself: a from-date with no to-date is ignored ENTIRELY — HTTP 200, no error, and the unfiltered result set. This actor fills the missing to-date with today and reports maxDateDefaulted so you can see it happened."
          },
          "maxDate": {
            "title": "To date",
            "type": "string",
            "description": "YYYY/MM/DD."
          },
          "dateType": {
            "title": "Which date to filter on",
            "enum": [
              "edat",
              "pdat",
              "mdat"
            ],
            "type": "string",
            "description": "edat = the date the record entered PubMed. pdat = publication date. mdat = last MEDLINE revision. edat is the default because it is the only one that distributes evenly: a record published '2020 Jan' is indexed as 2020/01/01, so pdat puts ~75% of a month onto its first day.",
            "default": "edat"
          },
          "breakResultWindow": {
            "title": "Break the 9,999-record window",
            "type": "boolean",
            "description": "PubMed serves at most 9,999 records per query and usehistory/WebEnv does NOT open that window — the history server returns the same refusal. With this on, a larger query is cut into Entrez-date slices until every record is reachable. Turn it off to take the first 9,999 and stop.",
            "default": true
          },
          "includeCitedByCount": {
            "title": "Include cited-by counts",
            "type": "boolean",
            "description": "Adds citedByCount to every article, from NCBI's own link database. Costs one extra request per 50 articles.",
            "default": false
          },
          "ncbiApiKey": {
            "title": "NCBI API key (optional)",
            "type": "string",
            "description": "NCBI allows 3 requests/second per IP anonymously and 10/s with a free key from your NCBI account. Supplying one raises the default pace automatically. Leave blank to run anonymously."
          },
          "contactEmail": {
            "title": "Contact email (optional)",
            "type": "string",
            "description": "NCBI's usage policy asks automated clients to identify a contact so they can reach you before blocking anything. Sent as the `email` parameter. Optional — requests without it also succeed."
          },
          "efetchBatchSize": {
            "title": "Records per fetch request",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many articles to pull per efetch call, 1-1000. Fetches are POSTed because a GET dies at ~500 ids with HTTP 414 and an empty body. 1000 ids is a ~20 MB response for no gain once the rate cap binds.",
            "default": 200
          },
          "maxConcurrency": {
            "title": "Max concurrent requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Concurrency buys nothing once the 3-per-second rate cap binds; minRequestInterval is the honest speed control.",
            "default": 3
          },
          "minRequestInterval": {
            "title": "Min seconds between request starts",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "Politeness pacing shared across all workers. 0 uses the built-in default, which is the published NCBI limit itself: ~0.34s (3/s) anonymously, ~0.11s (10/s) when an API key is supplied. Raise it if you still see rate-limit retries.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "OFF by default and deliberately so. E-utilities has no WAF, and NCBI's rate limit is keyed on your IP — routing through a rotating residential pool would not fix a 429, it would evade a published limit by making one client look like many.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}