{
  "openapi": "3.0.1",
  "info": {
    "title": "PubMed Article Monitor",
    "description": "Monitor new PubMed articles by query, publication type and date via the official NCBI E-utilities (esearch, esummary, efetch). Incremental 'new since last run' monitoring, a markdown digest and an optional webhook. No API key required at 3 requests/second, no scraping.",
    "version": "0.1",
    "x-build-id": "eOAko1u92vCPxo7zZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/artemi_kupolov~pubmed-article-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-artemi_kupolov-pubmed-article-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/artemi_kupolov~pubmed-article-monitor/runs": {
      "post": {
        "operationId": "runs-sync-artemi_kupolov-pubmed-article-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/artemi_kupolov~pubmed-article-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-artemi_kupolov-pubmed-article-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": {
          "query": {
            "title": "PubMed query",
            "type": "string",
            "description": "A PubMed search term, using the usual field tags if you want them. Examples: `mRNA vaccine`, `CRISPR[Title]`, `Smith J[Author]`, `Nature[Journal]`. Combined with publication type and the date window using AND. Leave empty only if you want every article in the date window (capped by `maxItems`)."
          },
          "publicationTypes": {
            "title": "Publication types",
            "type": "array",
            "description": "Official PubMed publication types, AND-ed into the query as `\"Journal Article\"[Publication Type]`. Short aliases such as `review`, `RCT`, `trial`, `preprint` or `guideline` are also accepted. Leave empty for any type.",
            "items": {
              "type": "string",
              "enum": [
                "Journal Article",
                "Review",
                "Systematic Review",
                "Meta-Analysis",
                "Clinical Trial",
                "Randomized Controlled Trial",
                "Controlled Clinical Trial",
                "Clinical Trial, Phase I",
                "Clinical Trial, Phase II",
                "Clinical Trial, Phase III",
                "Clinical Trial, Phase IV",
                "Case Reports",
                "Comparative Study",
                "Observational Study",
                "Multicenter Study",
                "Editorial",
                "Letter",
                "Comment",
                "News",
                "Practice Guideline",
                "Preprint",
                "Dataset"
              ]
            }
          },
          "datePreset": {
            "title": "Date window",
            "enum": [
              "last_24_hours",
              "last_7_days",
              "last_30_days",
              "last_90_days",
              "ytd",
              "custom",
              "since_last_run"
            ],
            "type": "string",
            "description": "Quick window for the date selected in `dateType`. Defaults to the last 7 days so a run never queries the entire PubMed archive. Use `custom` with the date fields below, or `since_last_run` for incremental monitoring.",
            "default": "last_7_days"
          },
          "dateType": {
            "title": "Date type",
            "enum": [
              "edat",
              "pdat",
              "mhdat",
              "mdat"
            ],
            "type": "string",
            "description": "Which PubMed date the window applies to. `edat` (default) is the Entrez / entry date — when the record appeared in PubMed — and is the right choice for a 'what's new' monitor. `pdat` is the publication date, `mhdat` the MeSH date, `mdat` the modification date.",
            "default": "edat"
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Inclusive start of the date range (`YYYY-MM-DD`). Used when `datePreset` is `custom`, or as a floor under `sinceLastRun`. Sent to E-utilities as `mindate`."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Inclusive end of the date range (`maxdate`)."
          },
          "sinceLastRun": {
            "title": "Only articles since the last run",
            "type": "boolean",
            "description": "Set the start date from the previous successful run of this monitor (minus one day of overlap). Combine with `onlyNew` for a scheduled watch.",
            "default": false
          },
          "onlyNew": {
            "title": "Skip articles already seen",
            "type": "boolean",
            "description": "Drop PMIDs stored in the key-value store from a previous run. Seen articles are still counted in the log. Turn off to re-export the full window.",
            "default": true
          },
          "maxItems": {
            "title": "Maximum articles",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on articles written to the dataset (1–10 000). Default 100.",
            "default": 100
          },
          "pageSize": {
            "title": "Search page size",
            "minimum": 10,
            "maximum": 500,
            "type": "integer",
            "description": "PMIDs requested per esearch call (10–500, default 200). EFetch then retrieves records in batches of up to 200.",
            "default": 200
          },
          "includeDigest": {
            "title": "Write a markdown digest",
            "type": "boolean",
            "description": "Write an email-friendly markdown digest of *new* articles to the key-value store as `digest.md`.",
            "default": true
          },
          "webhookUrl": {
            "title": "Webhook URL for new articles",
            "type": "string",
            "description": "Optional HTTPS URL. When at least one *new* article is found, the Actor POSTs a JSON body with `digest`, `newCount` and the article list. The Actor never sends email itself."
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Namespace for stored seen-PMIDs and the last date. Use a different key for each scheduled watch (for example `mrna-vaccine` vs `crispr-reviews`).",
            "default": "default"
          },
          "tool": {
            "title": "NCBI tool name",
            "type": "string",
            "description": "Value of the official E-utilities `tool` parameter (no spaces). Identifies this software to NCBI. Default `pubmed-article-monitor`.",
            "default": "pubmed-article-monitor"
          },
          "email": {
            "title": "NCBI contact email",
            "type": "string",
            "description": "Value of the official E-utilities `email` parameter. NCBI uses it only to contact the developer if a run violates the usage policy. Default is the Actor author's address; override it with your own if you run this heavily.",
            "default": "artemikupolov@gmail.com"
          },
          "ncbiApiKey": {
            "title": "NCBI API key (optional)",
            "type": "string",
            "description": "Optional E-utilities API key. Without a key the Actor stays at or below 3 requests per second (the official limit). With a key the cap is 10 r/s and the default delay is lowered. Get a key from your NCBI account settings. Leave empty unless you need a higher rate."
          },
          "requestDelaySecs": {
            "title": "Delay between API calls (seconds)",
            "minimum": 0.11,
            "maximum": 5,
            "type": "number",
            "description": "Pause before each E-utilities request. Default 0.4 s (just under 3 r/s) without a key, or 0.12 s with a key. The Actor will not go below the official rate limit.",
            "default": 0.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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}