{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper: Posts, Comments, Search and Full History",
    "description": "Scrape Reddit posts and comments from subreddits, searches, post and user links. No login needed. Full history by date from a public archive, threads found through Google, free lead flags and summary row, only-new mode. Keeps working when Reddit blocks. $0.90 per 1,000 posts.",
    "version": "0.2",
    "x-build-id": "P8Zwh7XkglVE10YXP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/locaihost~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-locaihost-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/locaihost~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-locaihost-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/locaihost~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-locaihost-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": {
          "startUrls": {
            "title": "Reddit links",
            "type": "array",
            "description": "Any mix of subreddit, post, user and search links. www, old, new and short redd.it links all work. A subreddit link also returns a free row of facts about the community.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Words to search for, one per line. Searched across all of Reddit, or only inside the subreddits below when you list any.",
            "items": {
              "type": "string"
            }
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Community names without \"r/\", one per line. On their own they return each community's feed; with search terms they limit the search to these communities.",
            "items": {
              "type": "string"
            }
          },
          "maxPosts": {
            "title": "Posts per source",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "How many posts to return from each subreddit, search or user, up to 10,000. Past the newest 1,000 (as far back as Reddit lists) the rest come from the public Reddit archive. 0 returns only the free subreddit facts. A post link always returns that post.",
            "default": 25
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Open each post and return its comments as their own rows, with depth and parent so you can rebuild the thread. Slower: each post is one more page.",
            "default": false
          },
          "onlyNew": {
            "title": "Only posts not returned before",
            "type": "boolean",
            "description": "Remembers which posts this exact input returned in earlier runs and leaves them out, so a daily schedule only brings new posts. Repeats are never charged.",
            "default": false
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "relevance",
              "comments"
            ],
            "type": "string",
            "description": "Order of posts. Subreddit feeds know hot, new, top and rising; search knows relevance, hot, top, new and most comments. A sort a page does not know falls back to its default. A sort inside a link wins over this.",
            "default": "hot"
          },
          "time": {
            "title": "Time window",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "For top and search results: how far back to look.",
            "default": "week"
          },
          "users": {
            "title": "Users",
            "type": "array",
            "description": "Usernames without \"u/\", one per line. Returns their public posts, plus a free row with their public karma and account age.",
            "items": {
              "type": "string"
            }
          },
          "postedAfter": {
            "title": "Posted after",
            "type": "string",
            "description": "Only posts from this date on: 2026-11-01, an ISO time, or a span back from now like \"7 days\" or \"3 months\". Older history comes from the public Reddit archive."
          },
          "postedBefore": {
            "title": "Posted before",
            "type": "string",
            "description": "Only posts up to this date, same formats as above."
          },
          "includeKeywords": {
            "title": "Must contain one of",
            "type": "array",
            "description": "Keep only posts whose title, text or flair has at least one of these words (not case sensitive). Posts left out are not charged.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Leave out posts with",
            "type": "array",
            "description": "Drop posts whose title, text or flair has any of these words. Not charged.",
            "items": {
              "type": "string"
            }
          },
          "requireQueryTerms": {
            "title": "Every search word must appear",
            "type": "boolean",
            "description": "Reddit's search also returns loose matches. On, a search result is kept only when every word of the search is in its title or text.",
            "default": false
          },
          "brands": {
            "title": "Brands to flag",
            "type": "array",
            "description": "Brand or rival names. Each post lists the ones it mentions in brandsMentioned and gets a mentions-brand flag. Free; does not filter.",
            "items": {
              "type": "string"
            }
          },
          "maxCommentsPerPost": {
            "title": "Comments per post",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Most comments returned for one post, in the order Reddit shows them (best first, replies under their parent).",
            "default": 50
          },
          "includeNsfw": {
            "title": "Include adult posts",
            "type": "boolean",
            "description": "Adult (NSFW) posts are left out unless this is on. Reddit hides many of them from logged-out visitors, so some may still be missing.",
            "default": false
          },
          "summaryRow": {
            "title": "Add a summary row",
            "type": "boolean",
            "description": "A free last row with rows per subreddit, the top posts by score, the date range and what was left out. Never charged.",
            "default": true
          },
          "useArchive": {
            "title": "Use the public Reddit archive",
            "type": "boolean",
            "description": "Fills date ranges older than Reddit lists, full comment trees on old posts, and anything Reddit refuses to show. Rows from it say dataSource \"archive\". The archive runs about a day behind Reddit.",
            "default": true
          },
          "googleSearch": {
            "title": "Also find threads through Google",
            "type": "boolean",
            "description": "For search terms: finds Reddit threads of any age through Google's site:reddit.com results, then reads each one from Reddit. Good for research on older threads that Reddit's own search no longer shows. Adds about $0.0025 of our cost per Google page (10 results), which counts toward your run's spend limit. Dates and a community, when given, go into the Google query. Google makes each page of links wait up to about a minute, so allow extra run time.",
            "default": false
          },
          "activityDays": {
            "title": "Activity history (days)",
            "minimum": 0,
            "maximum": 90,
            "type": "integer",
            "description": "Adds posts per day for each subreddit, for this many days back, to its free subreddit row. 0 skips it.",
            "default": 0
          },
          "redditCookies": {
            "title": "Your Reddit cookies",
            "type": "string",
            "description": "Optional. Paste your own reddit.com cookies (a JSON export from a cookie extension, or the Cookie header) to read as your account: Reddit's search, more comments, and communities your account can see. Only the token_v2 cookie is used; it is encrypted by Apify, never stored by this tool and never written to the log. Use your own account only."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}