{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper",
    "description": "Scrape Reddit posts and comments from subreddits, users, keyword searches and post links: title, full text, score, upvote ratio, flair, dates and threaded replies. Monitor only new posts, go past the 1,000-post limit, get RAG chunks for AI. No login. Export to CSV or JSON.",
    "version": "0.0",
    "x-build-id": "TA6EzkQ4NolNbCnvI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/keklik~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-keklik-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/keklik~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-keklik-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/keklik~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-keklik-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",
        "required": [
          "targets"
        ],
        "properties": {
          "targets": {
            "title": "🔗 Reddit targets",
            "type": "array",
            "description": "One per line, any mix: a subreddit (https://www.reddit.com/r/Python/ or r/Python), a user (u/spez), a post link, a Reddit search link, or plain words to search all of Reddit for (web scraping tools).",
            "items": {
              "type": "string"
            }
          },
          "whatToGet": {
            "title": "📦 What to get",
            "enum": [
              "posts",
              "posts_comments",
              "media"
            ],
            "type": "string",
            "description": "Posts only; each post followed by its comments (replies included, each with its depth and parent; comments are rows of their own, marked type comment); or only image, video and gallery posts (searches use Reddit's media search, which shows no date, score or text).",
            "default": "posts"
          },
          "aiOutput": {
            "title": "🤖 AI output",
            "enum": [
              "none",
              "finetune",
              "rag"
            ],
            "type": "string",
            "description": "Also get each post in a shape AI tools take directly. Fine-tuning pairs: the post as the user's message and its highest-scoring direct reply as the answer, for training a chat model (turns on comments). RAG chunks: each post, with its comments if you get them, as clean Markdown split into chunks of about 750 tokens, each with its title, subreddit, date and link, ready for a vector database or as a search source for an AI agent. Both come as their own table and as one JSONL file. Fine-tuning pairs are free; RAG chunks are a small charge per post turned into chunks, on top of the posts and comments.",
            "default": "none"
          },
          "maxPosts": {
            "title": "🔢 Max posts per target",
            "minimum": 0,
            "type": "integer",
            "description": "Stop each target after this many posts. 0 means as many as Reddit lists (about 1,000 for a subreddit, fewer for a search).",
            "default": 100
          },
          "maxResults": {
            "title": "🛑 Max results in total",
            "minimum": 0,
            "type": "integer",
            "description": "Stop the whole run after this many rows, posts and comments together. 0 means no limit. Handy to try a big input on a few results first; your maximum cost per run also always applies.",
            "default": 0
          },
          "onlyNew": {
            "title": "🔔 Only new since my last run",
            "type": "boolean",
            "description": "For scheduled runs: each target returns only posts newer than the newest one the last run saved (for a post link, only its new comments). Targets are read newest first and stop at what you already have, so runs are fast and cheap. Runs of the same saved task share this memory; different tasks keep their own. Free.",
            "default": false
          },
          "goDeeper": {
            "title": "⏬ Go past Reddit's 1,000-post limit",
            "type": "boolean",
            "description": "Reddit stops every subreddit, user and search listing at about 1,000 posts. Turn this on to also read the same target's other sorts and time windows (New, Top of all time, year, month, week, Controversial, Hot), skipping posts already saved, to get well past that. Set Max posts per target to how many you want, or 0 for all Reddit will show. Slower: about 2.5 minutes per 1,000 posts. Free; you pay for the posts as usual.",
            "default": false
          },
          "crawlLinkedPages": {
            "title": "🌐 Also read linked pages ($)",
            "type": "boolean",
            "description": "For posts that link to an outside page (an article, a blog, a product page): also get that page's title and its text as clean Markdown, in the linked_page_title and linked_page_text columns. Links to images, videos and social sites are skipped. You pay per page read; pages that can't be read are free.",
            "default": false
          },
          "searchSubreddits": {
            "title": "🔎 Search only in these subreddits",
            "type": "array",
            "description": "For search words in Reddit targets: search inside each of these subreddits (r/SaaS or SaaS) instead of all of Reddit, one search per subreddit. A pasted Reddit search link keeps its own.",
            "items": {
              "type": "string"
            }
          },
          "matchWords": {
            "title": "🎯 Match words",
            "enum": [
              "reddit",
              "all",
              "phrase"
            ],
            "type": "string",
            "description": "Reddit's search also returns loosely related posts. Pick a stricter match to keep only posts whose title or text has every one of your search words, or the exact phrase. The text of a search result is read from its own page when the title alone doesn't settle it, which makes those posts slower to get.",
            "default": "reddit"
          },
          "sort": {
            "title": "↕️ Sort",
            "enum": [
              "default",
              "new",
              "top",
              "hot",
              "rising",
              "controversial",
              "comments",
              "relevance"
            ],
            "type": "string",
            "description": "How posts are ordered. A sort a target doesn't have falls back to Reddit's default for it. A sort in a link you paste is used when this is left on Reddit's default.",
            "default": "default"
          },
          "time": {
            "title": "🕒 Time window",
            "enum": [
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "For Top and Controversial, and for searches: only posts from this period, as Reddit counts it.",
            "default": "all"
          },
          "postedSince": {
            "title": "📅 Posted since",
            "pattern": "^$|^\\s*\\d+\\s*[hdwHDW]\\s*$|^\\s*\\d+\\s*(hour|day|week|month|year)s?\\s*$|^\\s*\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])([ T]\\d{2}:\\d{2}(:\\d{2})?)?\\s*$",
            "type": "string",
            "description": "Only posts from this date on: a date like 2026-11-01, or a period back from now like 7 days or 24 hours (handy for scheduled runs). With sort New, the run stops reading a target at the first older post, so it's fast and cheap."
          },
          "postedBefore": {
            "title": "📅 Posted before",
            "pattern": "^$|^\\s*\\d+\\s*[hdwHDW]\\s*$|^\\s*\\d+\\s*(hour|day|week|month|year)s?\\s*$|^\\s*\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])([ T]\\d{2}:\\d{2}(:\\d{2})?)?\\s*$",
            "type": "string",
            "description": "Only posts from before this date (2026-11-01 means up to the end of that day) or before a period back from now (30 days). Together with Posted since, a date range."
          },
          "flairs": {
            "title": "🏷️ Only these flairs",
            "type": "array",
            "description": "Keep only posts with one of these flairs (the tag a subreddit puts on posts, such as Hiring or Question), in any letter case. Write any to keep every post that has a flair. A search result's flair is read from its own page.",
            "items": {
              "type": "string"
            }
          },
          "includeNsfw": {
            "title": "🔞 Include NSFW",
            "type": "boolean",
            "description": "Include posts and communities marked NSFW (18+). Off: they're skipped, and an NSFW subreddit or post link is listed in Failed targets.",
            "default": false
          },
          "maxComments": {
            "title": "💬 Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "With \"Posts with their comments\": stop each post's comments after this many. 0 means all of them.",
            "default": 100
          },
          "maxDepth": {
            "title": "↘️ Max reply depth",
            "minimum": 0,
            "type": "integer",
            "description": "With comments: 0 keeps only direct replies to the post, 1 also replies to those, and so on. Leave empty for the whole thread. Deeper replies are not even loaded, so runs are faster."
          },
          "commentsSince": {
            "title": "📅 Comments posted since",
            "pattern": "^$|^\\s*\\d+\\s*[hdwHDW]\\s*$|^\\s*\\d+\\s*(hour|day|week|month|year)s?\\s*$|^\\s*\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])([ T]\\d{2}:\\d{2}(:\\d{2})?)?\\s*$",
            "type": "string",
            "description": "With comments: only comments from this date on, or from a period back like 1 day (for new replies on threads you follow)."
          },
          "commentsBefore": {
            "title": "📅 Comments posted before",
            "pattern": "^$|^\\s*\\d+\\s*[hdwHDW]\\s*$|^\\s*\\d+\\s*(hour|day|week|month|year)s?\\s*$|^\\s*\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])([ T]\\d{2}:\\d{2}(:\\d{2})?)?\\s*$",
            "type": "string",
            "description": "With comments: only comments from before this date or period."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}