{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper API - Posts, Comments & Monitoring",
    "description": "Scrape public Reddit posts, search, subreddits, media, and nested comments or monitor only newly observed posts. Anonymous read-only OAuth; no browser, proxy, login, cookies, or API key.",
    "version": "1.0",
    "x-build-id": "Ank9omKfREPMQlbWe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/thirdwatch~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-thirdwatch-reddit-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/thirdwatch~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-thirdwatch-reddit-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/thirdwatch~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-thirdwatch-reddit-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": {
          "queries": {
            "title": "Search queries or subreddits",
            "maxItems": 50,
            "type": "array",
            "description": "Plain text searches all Reddit. Use r/python for a subreddit listing or r/python: asyncio for search within one subreddit. r/python+golang runs each community separately, and they share Max results. Across all inputs, a run supports up to 50 listing targets.",
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "^\\s*(?!https?://)\\S.*$|^\\s*https?://([a-zA-Z0-9-]+\\.)?(reddit\\.com|redd\\.it)([/?#].*)?\\s*$"
            },
            "default": []
          },
          "startUrls": {
            "title": "Reddit listing, search, or post URLs (optional)",
            "maxItems": 50,
            "type": "array",
            "description": "Existing public Reddit URLs. A URL that cannot be used is skipped and listed in OUTPUT. Across all inputs, a run supports up to 50 listing targets and 100 exact post URLs.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "postUrls": {
            "title": "Specific Reddit post URLs (optional)",
            "maxItems": 100,
            "type": "array",
            "description": "Fetch exact public Reddit posts and, optionally, their comment threads. Accepts post links, redd.it short links, and Reddit app share links. The limit is 100 exact post URLs across all inputs.",
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "^\\s*(https?://)?([a-zA-Z0-9-]+\\.)?(reddit\\.com|redd\\.it)([/?#].*)?\\s*$"
            },
            "default": []
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "relevance"
            ],
            "type": "string",
            "description": "How subreddit and search results are ordered.",
            "default": "hot"
          },
          "timeFilter": {
            "title": "Time filter",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time range for top and relevance searches.",
            "default": "all"
          },
          "maxResults": {
            "title": "Maximum posts per query",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum unique posts returned for each query or listing URL. Pagination is automatic in batches of up to 100. Persistent monitors distribute a 2,000-observation safety budget across listing targets.",
            "default": 10
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Embed public comments in each post row. Check commentsSource, commentDepthFilterApplied, and commentTreeComplete for coverage. Feed results omit scores and reply depth. Comment-enabled listings are capped at 100 posts total.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Maximum comments per post",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum public comments embedded in each post row when comments are enabled.",
            "default": 10
          },
          "maxCommentDepth": {
            "title": "Maximum comment depth",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum reply depth when the full comment tree is available. Feed results cannot be filtered by depth and have commentDepthFilterApplied set to false.",
            "default": 1
          },
          "minScore": {
            "title": "Minimum post score",
            "minimum": -100000,
            "maximum": 10000000,
            "type": "integer",
            "description": "Only write posts at or above this visible Reddit score, including exact post URLs. Defaults to 0; set a negative value to include negative scores.",
            "default": 0
          },
          "skipPinnedPosts": {
            "title": "Skip pinned posts",
            "type": "boolean",
            "description": "Exclude moderator-pinned or stickied posts, including exact post URLs.",
            "default": false
          },
          "newerThan": {
            "title": "Only posts newer than (optional)",
            "pattern": "^\\s*$|^\\s*\\d{4}-\\d{2}-\\d{2}([T ].*)?\\s*$|^\\s*\\d{1,4}\\s*[a-zA-Z]+(\\s+[aA][gG][oO])?\\s*$",
            "type": "string",
            "description": "A date, a timestamp, or an age for listings and exact post URLs, for example 2026-07-01, 2026-07-01T00:00:00Z, or 7 days. Posts with unverifiable creation times are omitted and the target is incomplete. Persistent monitors usually leave this empty."
          },
          "monitorMode": {
            "title": "Output mode",
            "enum": [
              "all",
              "new-posts"
            ],
            "type": "string",
            "description": "Return every current post, or persist a baseline and return only posts not seen by this watch. An unchanged new-posts run writes no billable result rows.",
            "default": "all"
          },
          "monitorStoreName": {
            "title": "Monitor name (optional)",
            "maxLength": 200,
            "type": "string",
            "description": "Stable identity for one scheduled watch. Reuse the same name and input on every run; use a different name for each independent monitor."
          },
          "allowIncompleteMonitorFallback": {
            "title": "Keep monitoring when a source is limited",
            "type": "boolean",
            "description": "On by default. When keyword search or a New, Rising, or Hot subreddit listing is unavailable, use an incomplete alternative that can miss posts or use different ordering. Hot recovery is limited to named subreddits. New-post alerts on these sources only cover recently created posts. Alerts are marked monitoringComplete=false; check OUTPUT for incomplete targets. The last complete checkpoint is preserved. Turn off to stop a run instead whenever a target is incomplete.",
            "default": true
          },
          "preferIncompleteSearch": {
            "title": "Use incomplete search directly",
            "type": "boolean",
            "description": "Use an alternative for keyword search without trying the regular search source first. It can miss posts; rows are marked discoveryComplete=false. For monitoring, also enable Allow incomplete monitoring fallback. Off by default; does not change subreddit listings.",
            "default": false
          },
          "includeAdultSearchSupplement": {
            "title": "Try recent adult-marked posts in scoped search",
            "type": "boolean",
            "description": "For single-word searches within a named subreddit, with sort New and time filter All, also check up to 25 recent posts for literal title or body matches. Uses incomplete app search, can miss posts, and adds requests that may be rate-limited. For monitoring, enable Allow incomplete monitoring fallback. Off by default.",
            "default": false
          },
          "preferIncompleteSubreddit": {
            "title": "Use incomplete subreddit app feed directly",
            "type": "boolean",
            "description": "Use an alternative directly for New or Rising subreddit listings, including r/all and r/popular. It can miss or reorder posts; rows are marked discoveryComplete=false. For monitoring, also enable Allow incomplete monitoring fallback. Off by default; does not affect keyword searches or other sorts.",
            "default": false
          },
          "captureResumeToken": {
            "title": "Enable resumable subreddit export",
            "type": "boolean",
            "description": "For one named subreddit with New or Rising sort, without comments or monitoring, use an incomplete app feed and save a continuation in OUTPUT when a resumable position is available. Results may be missing or repeated. Off by default.",
            "default": false
          },
          "resumeToken": {
            "title": "Resume token (optional)",
            "maxLength": 32768,
            "type": "string",
            "description": "Paste a resumeToken from a previous run's OUTPUT. Use the same subreddit, sort, and filters; comments and monitoring must remain off. Reddit cursors may expire and results may be missing or repeated."
          },
          "preferWebSubreddit": {
            "title": "Use incomplete web subreddit feed directly",
            "type": "boolean",
            "description": "Use a public web feed directly for New or Rising subreddit listings. It can miss or reorder posts; rows are marked discoveryComplete=false. For monitoring, also enable Allow incomplete monitoring fallback. Off by default; does not affect keyword searches or other sorts.",
            "default": false
          },
          "allowPartialSubredditFallback": {
            "title": "Allow incomplete subreddit fallback",
            "type": "boolean",
            "description": "Allow an additional Hot-page recovery if a newest-first subreddit listing fails. It can miss posts; rows are marked discoveryComplete=false. Does not apply to keyword searches or monitoring.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Concurrent detail requests",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Parallel parsing tasks for bodies/comments. Actual Reddit requests remain globally rate-limited.",
            "default": 3
          },
          "requestDelaySecs": {
            "title": "Delay between Reddit requests",
            "minimum": 0.6,
            "maximum": 3,
            "type": "number",
            "description": "Minimum delay between anonymous Reddit API requests. Keep at 0.65 seconds unless you need a gentler crawl.",
            "default": 0.65
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}