{
  "openapi": "3.0.1",
  "info": {
    "title": "PubMed Scraper & New Article Monitor",
    "description": "Run PubMed searches on a schedule via the official NCBI API and get only new articles since the last run, with abstract, authors, affiliation, MeSH terms, DOI and free full-text links. Reviews and retractions flagged.",
    "version": "0.5",
    "x-build-id": "7T5VzRvM8PePAZNBD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/heaped_qualm~pubmed-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-heaped_qualm-pubmed-monitor",
        "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/heaped_qualm~pubmed-monitor/runs": {
      "post": {
        "operationId": "runs-sync-heaped_qualm-pubmed-monitor",
        "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/heaped_qualm~pubmed-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-heaped_qualm-pubmed-monitor",
        "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": {
          "queries": {
            "title": "PubMed queries (saved searches)",
            "type": "array",
            "description": "One search per line, in PubMed syntax, e.g. semaglutide[tiab], Smith J[au] AND oncology, \"Nature\"[ta] AND CRISPR, obesity[mh]. If PubMed has to adjust a query (unknown field or phrase), the run log says so.",
            "default": [
              "semaglutide[tiab]"
            ],
            "items": {
              "type": "string"
            }
          },
          "publicationTypes": {
            "title": "Publication types",
            "type": "array",
            "description": "Keep only these article types. Empty = all types.",
            "items": {
              "type": "string",
              "enum": [
                "Review",
                "Systematic Review",
                "Meta-Analysis",
                "Randomized Controlled Trial",
                "Clinical Trial",
                "Clinical Trial, Phase III",
                "Observational Study",
                "Case Reports",
                "Guideline",
                "Preprint",
                "Letter",
                "Editorial"
              ]
            }
          },
          "lastDays": {
            "title": "Look back (days)",
            "minimum": 0,
            "maximum": 36500,
            "type": "integer",
            "description": "Only articles from the last N days, by the date type below. Ignored when \"Date from\" or \"Date to\" is set. 0 = no limit.",
            "default": 30
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Start of the date range (YYYY-MM-DD). Setting either date switches off the look-back window."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "End of the date range (YYYY-MM-DD). Setting either date switches off the look-back window."
          },
          "dateType": {
            "title": "Date type",
            "enum": [
              "edat",
              "pdat",
              "mdat"
            ],
            "type": "string",
            "description": "Which date the window applies to. \"Added to PubMed\" is best for alerts because it covers articles indexed late.",
            "default": "edat"
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "pub_date",
              "relevance",
              "first_author",
              "journal"
            ],
            "type": "string",
            "description": "Order used when a query has more hits than the max.",
            "default": "pub_date"
          },
          "maxResultsPerQuery": {
            "title": "Max results per query",
            "minimum": 1,
            "maximum": 9999,
            "type": "integer",
            "description": "Maximum articles checked per query per run (newest first with the default sort).",
            "default": 100
          },
          "onlyNew": {
            "title": "Only new since last run",
            "type": "boolean",
            "description": "Monitor mode: return only PMIDs not seen in earlier runs under the same monitor name. The first run returns everything in the window as BASELINE. Switch off to return every match (already seen ones are marked SEEN). It starts switched off in the form, so a manual test run always shows results. Switch it on in the task you schedule. API calls that omit this field get monitor mode on.",
            "default": true
          },
          "stateKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name of this monitor's memory (letters, digits and dashes; other characters become dashes). Use a different name for each saved task or schedule.",
            "default": "default"
          },
          "includeAbstract": {
            "title": "Include abstract, MeSH, keywords, affiliation, grants",
            "type": "boolean",
            "description": "Adds abstract, MeSH terms, keywords, first affiliation and grant agencies (one extra EFetch request per 200 articles). If EFetch fails, the articles are still returned without these fields. Abstracts can be copyrighted by the publisher; you are responsible for how you use them.",
            "default": true
          },
          "contactEmail": {
            "title": "Your contact email (recommended by NCBI)",
            "type": "string",
            "description": "Sent to NCBI as the E-utilities \"email\" parameter, as NCBI asks, so they can contact you instead of blocking traffic. Not saved in the output."
          },
          "apiKey": {
            "title": "NCBI API key (optional)",
            "type": "string",
            "description": "Optional free key from your NCBI account. Raises the rate limit from 3 to 10 requests per second; useful only for very large runs."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}