{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper",
    "description": "Scrape Reddit posts, comment trees, subreddit feeds, user profiles and communities by keyword search or URL. Get title, body, author, score, upvote ratio, comment count, flair, media and timestamps. Filter by date, flair or keyword, or run only-new, with no proxy to set up. $1.20 per 1,000 items.",
    "version": "1.0",
    "x-build-id": "S8JBYxy0ZFAntSLOs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/boncross~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-boncross-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/boncross~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-boncross-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/boncross~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-boncross-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": {
          "searches": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to search for posts across Reddit, or inside one subreddit if you set one below. Reddit search syntax works: quotes, subreddit:, author:, title:, self:yes, flair:.",
            "items": {
              "type": "string"
            }
          },
          "searchCommunities": {
            "title": "Also search communities",
            "type": "boolean",
            "description": "For each search term, also return matching subreddits as community records.",
            "default": false
          },
          "searchUsers": {
            "title": "Also search users",
            "type": "boolean",
            "description": "For each search term, also return matching user profiles.",
            "default": false
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddit names or URLs whose feed to read, for example TrueChefKnives, r/AskReddit or https://www.reddit.com/r/pasta/.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Any Reddit URLs. A post returns the post and its comments, a subreddit or feed returns its posts, a user profile returns the profile plus that user's posts and comments (a /submitted or /comments link narrows it), and a search results page returns the search.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxItems": {
            "title": "Maximum results for the whole run",
            "minimum": 0,
            "type": "integer",
            "description": "A run-wide ceiling across every target. The per-target limit above applies to each one separately, so ten targets at 50 each returns 500; set this to cap the total. Zero means no run-wide limit. Rows that report an input the actor could not resolve are not counted here and are never charged for.",
            "default": 0
          },
          "maxPosts": {
            "title": "Max posts per search / subreddit / user",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Cap on posts per search, subreddit or URL. Reddit itself stops any listing at about 1,000.",
            "default": 100
          },
          "searchSort": {
            "title": "Search sort",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "comments"
            ],
            "type": "string",
            "description": "Order of search results. Comment search only knows relevance, new and top; hot and comments fall back to relevance there.",
            "default": "relevance"
          },
          "searchTime": {
            "title": "Search time window",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Only posts from this period.",
            "default": "all"
          },
          "withinSubreddit": {
            "title": "Search within subreddit",
            "type": "string",
            "description": "Restrict every search term to this subreddit, by name or URL. Leave empty to search all of Reddit."
          },
          "feedSort": {
            "title": "Subreddit feed",
            "enum": [
              "new",
              "hot",
              "top",
              "rising",
              "controversial",
              "comments"
            ],
            "type": "string",
            "description": "Which feed to read for each subreddit. Latest comments returns the subreddit's newest comments across all its threads, as comment rows, capped by Max posts.",
            "default": "new"
          },
          "feedTime": {
            "title": "Feed time window",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window for the Top and Controversial feeds.",
            "default": "week"
          },
          "userContent": {
            "title": "User profile content",
            "enum": [
              "overview",
              "submitted",
              "comments"
            ],
            "type": "string",
            "description": "For user profile URLs: posts and comments together, posts only, or comments only. A /submitted or /comments link overrides it.",
            "default": "overview"
          },
          "userSort": {
            "title": "User profile order",
            "enum": [
              "new",
              "hot",
              "top",
              "controversial"
            ],
            "type": "string",
            "description": "For user profile URLs. Top and Controversial use the Top and Controversial time window above.",
            "default": "new"
          },
          "postedAfter": {
            "title": "Posts posted after",
            "type": "string",
            "description": "Keep posts created on or after this date or datetime, for example 2026-08-01 or 2026-08-01T12:00:00Z. On newest-first listings the actor stops paging once it reaches older posts. Reddit search has no date parameter, so other sorts still read pages up to Reddit's cap before filtering."
          },
          "postedBefore": {
            "title": "Posts posted before",
            "type": "string",
            "description": "Keep posts created on or before this date or datetime. A bare date means the end of that day."
          },
          "commentedAfter": {
            "title": "Comments posted after",
            "type": "string",
            "description": "Keep comments created on or after this date or datetime."
          },
          "commentedBefore": {
            "title": "Comments posted before",
            "type": "string",
            "description": "Keep comments created on or before this date or datetime."
          },
          "onlyWithFlair": {
            "title": "Only posts with flair",
            "type": "array",
            "description": "Keep only posts whose flair matches one of these, ignoring case. Posts without a matching flair are dropped before any comments are fetched.",
            "items": {
              "type": "string"
            }
          },
          "filterKeywords": {
            "title": "Filter keywords",
            "type": "array",
            "description": "Words or phrases, matched ignoring case, against the post title and text and against comment text. Dropped items are not charged. With comments on, this keeps only the comments in a thread that mention your terms.",
            "items": {
              "type": "string"
            }
          },
          "filterKeywordMode": {
            "title": "Keyword mode",
            "enum": [
              "any",
              "all",
              "exclude"
            ],
            "type": "string",
            "description": "any keeps items with at least one keyword, all needs every keyword, exclude drops items that contain any of them.",
            "default": "any"
          },
          "includeNsfw": {
            "title": "Include NSFW",
            "type": "boolean",
            "description": "Keep posts, comments and communities marked over 18.",
            "default": true
          },
          "searchComments": {
            "title": "Also search comments",
            "type": "boolean",
            "description": "For each search term, also return matching comments sorted by relevance, new or top within the time window. Hits come back as full comment records.",
            "default": false
          },
          "maxCommentsPerSearch": {
            "title": "Max comments per search",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Cap on comments returned per search term when comment search is on. Reddit gives about 9 per page.",
            "default": 100
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "0 means posts only. Anything higher expands the full comment tree, including the collapsed branches, up to this many comments per post (at most 5,000). With a comment date, keyword or only-new filter, a tree stops being read once five pages of comments in a row match nothing, and a comment search stops after five such pages.",
            "default": 0
          },
          "maxCommentDepth": {
            "title": "Max comment depth",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Deepest reply level to keep. 0 keeps top-level comments only.",
            "default": 50
          },
          "commentSort": {
            "title": "Comment sort",
            "enum": [
              "confidence",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "How Reddit ranks the comment tree before it is read.",
            "default": "confidence"
          },
          "includeUsers": {
            "title": "Fetch author profiles",
            "type": "boolean",
            "description": "Return a user record with karma, account age and description for each distinct author seen, up to Max users.",
            "default": false
          },
          "maxUsers": {
            "title": "Max users",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Cap on author profiles fetched per run.",
            "default": 50
          },
          "includeCommunities": {
            "title": "Fetch community details",
            "type": "boolean",
            "description": "Return a community record with subscribers, description and type for each subreddit seen.",
            "default": false
          },
          "customLabels": {
            "title": "Custom labels",
            "type": "object",
            "description": "Key and value strings added to every output record, for example {\"campaign\": \"launch-sept\"}, so you can tag runs."
          },
          "dedupStoreName": {
            "title": "Only-new store name",
            "type": "string",
            "description": "Name of a key-value store that remembers what was returned. Set it on a scheduled run and each run yields only new posts, comments and profiles."
          },
          "includeRawData": {
            "title": "Include raw Reddit object",
            "type": "boolean",
            "description": "Attach Reddit's original JSON as raw on posts, communities and users. It makes records large.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many requests run at once across the whole run. The default is the fastest level measured clean; lower it only if a run reports refusals or errors.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}