{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper Pro",
    "description": "Reddit scraper for automation workflows. Track keywords across Reddit or inside chosen communities, monitor subreddits, score posts with AFINN sentiment and pull full comment threads. Flat JSON - title, body, author, subreddit, score, flair, timestamps, matched keywords - for n8n and Zapier.",
    "version": "1.0",
    "x-build-id": "snwNYDePwqdtfq6yg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/webdatalabs~reddit-scraper-pro/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-webdatalabs-reddit-scraper-pro",
        "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/webdatalabs~reddit-scraper-pro/runs": {
      "post": {
        "operationId": "runs-sync-webdatalabs-reddit-scraper-pro",
        "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/webdatalabs~reddit-scraper-pro/run-sync": {
      "post": {
        "operationId": "run-sync-webdatalabs-reddit-scraper-pro",
        "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": {
          "searchMode": {
            "title": "Search Mode",
            "enum": [
              "keyword",
              "subreddit"
            ],
            "type": "string",
            "description": "Keyword Search looks across all of Reddit (or inside the subreddits you list) using Reddit's search engine. Subreddit Monitoring works inside specific communities and REQUIRES at least one subreddit below.",
            "default": "keyword"
          },
          "keywords": {
            "title": "Keywords to Track",
            "type": "array",
            "description": "What to search for. Required in Keyword Search mode. In Subreddit Monitoring mode: leave empty to get the newest posts of each community, or add keywords to search each community for them (multi-word keywords are searched as a phrase, matching post titles and post bodies). Reddit's search engine decides what matches; the keywords_matched output field tells you which keywords literally appear in each post.",
            "default": [
              "AI",
              "ChatGPT",
              "web scraping"
            ],
            "items": {
              "type": "string"
            }
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Communities to scrape, with or without the 'r/' prefix (e.g. 'webdev' or 'r/webdev'). REQUIRED when Search Mode is Subreddit Monitoring. In Keyword Search mode this is optional: leave it empty to search all of Reddit, or list subreddits to restrict the search to them.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItemsPerSubreddit": {
            "title": "Max Posts Per Subreddit",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on how many posts are fetched, saved and charged. In Subreddit Monitoring mode this is the budget per subreddit (shared across your keywords). In Keyword Search mode it is the budget per keyword per subreddit. Filters below can reduce the final count further, never increase it.",
            "default": 50
          },
          "searchSort": {
            "title": "Keyword Search Sort",
            "enum": [
              "relevance",
              "new",
              "top",
              "comments"
            ],
            "type": "string",
            "description": "How Reddit sorts keyword-search results. Applies to Keyword Search mode only - Subreddit Monitoring always fetches the newest matching posts first.",
            "default": "relevance"
          },
          "maxAgeHours": {
            "title": "Maximum Post Age",
            "minimum": 0,
            "maximum": 8760,
            "type": "integer",
            "description": "Only keep posts newer than this. 0 = no age limit. Posts older than the limit are fetched and then dropped, so a tight limit combined with a large Max Posts value can return far fewer rows than the cap - the run log reports exactly how many were dropped for being too old.",
            "default": 0
          },
          "minUpvotes": {
            "title": "Minimum Upvotes",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep posts with at least this many upvotes. 0 captures every mention (best for brand monitoring); raise it to filter noise.",
            "default": 0
          },
          "includeComments": {
            "title": "Scrape Comments",
            "type": "boolean",
            "description": "Fetch the comment thread of every saved post. Costs one extra request per saved post, so runs take noticeably longer. Keep off unless you need comment data.",
            "default": false
          },
          "commentDepth": {
            "title": "Comment Depth",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Levels of nested replies to fetch (0 = top-level comments only, 2 = replies to replies). Ignored when Scrape Comments is off.",
            "default": 1
          },
          "analyzeSentiment": {
            "title": "Sentiment Analysis",
            "type": "boolean",
            "description": "Score each post with AFINN-165 sentiment analysis, adding sentiment_score and sentiment_label (positive/negative/neutral). Useful for brand monitoring.",
            "default": true
          },
          "dedupeAcrossRuns": {
            "title": "Remember Posts Across Runs",
            "type": "boolean",
            "description": "For scheduled monitoring: remember which posts were already delivered and skip (and never re-charge) them on the next run with the same subreddits and keywords. Leave off for one-off runs - with it on, a repeated run can legitimately return zero new posts.",
            "default": false
          },
          "webhookUrl": {
            "title": "Webhook URL for Automation",
            "pattern": "^https?://",
            "type": "string",
            "description": "Send the results to n8n, Zapier or a custom endpoint. The batch is POSTed as JSON when the run completes. Example: https://your-n8n.com/webhook/reddit-alerts"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}