{
  "openapi": "3.0.1",
  "info": {
    "title": "Yandex Dzen Scraper",
    "description": "Yandex Dzen (Zen) scraper : \nextract public stats from articles and videos in bulk: views, likes, comments, author info, subscribers. Paste a list of URLs.",
    "version": "1.0",
    "x-build-id": "3rWbe0RGzFRRc4fwH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sashaebashu~yandex-dzen-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sashaebashu-yandex-dzen-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/sashaebashu~yandex-dzen-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sashaebashu-yandex-dzen-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/sashaebashu~yandex-dzen-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sashaebashu-yandex-dzen-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": {
          "urls": {
            "title": "Yandex Zen URLs (bulk paste)",
            "type": "array",
            "description": "Paste one URL per line. Supports articles (https://dzen.ru/a/<id>), videos (https://dzen.ru/video/watch/<id>) and shorts (https://dzen.ru/shorts/<id>). You can also paste many links separated by spaces, commas or new lines — they will be split automatically. Query strings and anchors are ignored.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Yandex Zen URLs (list / file / Google Sheet)",
            "type": "array",
            "description": "Alternative bulk input: paste a list, upload a file, or link a Google Sheet of Dzen URLs. Combined with the field above.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of publications to scrape in a single run. Helps control cost and run time.",
            "default": 1000
          },
          "engagementScore": {
            "title": "Add engagement score (vs author's median)",
            "type": "boolean",
            "description": "Score each item against its author's OWN median reach, so standout posts surface regardless of the channel's size. Adds authorMedianViews, viewsVsAuthorMedian and engagementVsAuthorMedian to each row (values > 1 beat the author's typical performance). Best when scraping many items from the same author. Off by default.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many publications to fetch in parallel. 4–6 balances speed and reliability; lower it to 2 if many items come back as failed.",
            "default": 4
          },
          "changeDetection": {
            "title": "Detect changes since the last run",
            "type": "boolean",
            "description": "Compare every publication with the previous run that used the same input and label it in `changeType`: new, changed, unchanged, or removed (deleted at the source since the last run). Changed publications carry the old and new numbers in `changes`.",
            "default": false
          },
          "onlyChanged": {
            "title": "Only new and changed publications",
            "type": "boolean",
            "description": "With change detection on, leave out publications that did not move. Left-out publications are not written and not charged.",
            "default": false
          },
          "freshnessStamps": {
            "title": "Add freshness stamps",
            "type": "boolean",
            "description": "Adds `firstSeenAt` (when the publication first appeared in your runs with this input), `lastConfirmedAt` (when it was last seen) and `timesSeen`.",
            "default": false
          },
          "anomalyDetection": {
            "title": "Flag anomalies",
            "type": "boolean",
            "description": "Score each publication against comparable publications from the same channel in this run and flag the ones far outside the usual range: `anomalyScore`, `isAnomaly`, `anomalyReason`. Needs at least 5 comparable publications; with fewer, the publication is compared with the whole run. Results are written at the end of the run in this mode.",
            "default": false
          },
          "anomalyThreshold": {
            "title": "Anomaly threshold",
            "minimum": 1,
            "maximum": 20,
            "type": "number",
            "description": "How far from typical an item must be to count as an anomaly. 3.5 is the usual choice; lower values flag more items.",
            "default": 3.5
          },
          "alertRules": {
            "title": "Alert rules",
            "type": "array",
            "description": "One rule per line, e.g. `views >= 50000`. Combine conditions with `and`. Operators: > >= < <= == != contains. Matching rows get `alertTriggered: true` and the matched rules in `alerts`; the matches are also saved to the ALERTS record.",
            "items": {
              "type": "string"
            }
          },
          "onlyAlerts": {
            "title": "Only rows that trigger an alert",
            "type": "boolean",
            "description": "Return only the rows that match at least one alert rule. Other rows are not written and not charged.",
            "default": false
          },
          "mcpSyncConnector": {
            "title": "Sync results to",
            "type": "string",
            "description": "Write the results straight into the tool your team already uses — Notion, Google Sheets, Airtable or any MCP server with a write tool."
          },
          "mcpSyncTool": {
            "title": "Sync: tool",
            "type": "string",
            "description": "Name of the connector tool that adds rows, e.g. create_records."
          },
          "mcpSyncArguments": {
            "title": "Sync: tool arguments",
            "type": "object",
            "description": "Use {{rows}} for a batch of rows, or {{row}} and {{row.views}} for one row per call, e.g. {\"table\": \"Results\", \"records\": \"{{rows}}\"}. Every row carries a stable `key`."
          },
          "mcpSyncUpdateTool": {
            "title": "Sync: update tool (optional)",
            "type": "string",
            "description": "Tool that updates existing rows. When set, publications synced by earlier runs are updated in place instead of being added again; their record id is available as {{row.externalId}}."
          },
          "mcpSyncUpdateArguments": {
            "title": "Sync: update tool arguments (optional)",
            "type": "object",
            "description": "Same placeholders as above. Defaults to the sync tool arguments."
          },
          "mcpSyncFields": {
            "title": "Sync: fields",
            "type": "array",
            "description": "Which fields to send. Leave empty for the main columns.",
            "items": {
              "type": "string"
            }
          },
          "mcpSyncBatchSize": {
            "title": "Sync: rows per call",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many rows go into one {{rows}} call.",
            "default": 10
          },
          "mcpNotifyConnector": {
            "title": "Notify when done",
            "type": "string",
            "description": "Post a one-message summary to Slack, Teams, Telegram, email or any messaging MCP server when the run finishes or fails."
          },
          "mcpNotifyTarget": {
            "title": "Notify: channel or recipient",
            "type": "string",
            "description": "For example #alerts or name@company.com. Used when the message arguments are filled in automatically."
          },
          "mcpNotifyOn": {
            "title": "Notify: when",
            "enum": [
              "always",
              "failure",
              "alerts"
            ],
            "type": "string",
            "description": "Every run, only failed runs, or only runs that found alerts or changes.",
            "default": "always"
          },
          "mcpNotifyTool": {
            "title": "Notify: tool (optional)",
            "type": "string",
            "description": "Picked automatically when empty (send_message, post_message and similar)."
          },
          "mcpNotifyArguments": {
            "title": "Notify: tool arguments (optional)",
            "type": "object",
            "description": "Use {{summary}}, {{status}}, {{itemCount}} and {{runUrl}}, e.g. {\"channel\": \"#alerts\", \"text\": \"{{summary}}\"}."
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings. The default (Apify Proxy, residential, Russia) is the most reliable choice for Dzen — leave it unless you have a reason to change it.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "RU"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}