{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper",
    "description": "[💰 $1.0 / 1K] Extract posts, comments, users, and subreddits from Reddit. Provide subreddit names, search queries, or paste Reddit URLs (post / subreddit / user / search) — mix and match. Returns one row per record with a recordType discriminator.",
    "version": "1.1",
    "x-build-id": "QRNvfegyialdcJg45"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/solidcode~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-solidcode-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/solidcode~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-solidcode-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/solidcode~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-solidcode-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": {
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddit NAMES only — e.g. 'askspain' or 'r/askspain', one per line (the 'r/' prefix is optional). Do NOT paste full links here; put any reddit.com/... URL in the 'Reddit URLs' field below instead. Each subreddit is fetched independently using the sort and time settings below. Tip: a specific subreddit name sorted by New returns full history (far past 1,000 posts), while the r/popular and r/all aggregator feeds cap at about 1,000 — name the communities you care about to collect more. Leave empty if you only want search keywords or URLs. If every source is empty, the run defaults to r/popular.",
            "items": {
              "type": "string"
            }
          },
          "searches": {
            "title": "Search Keywords",
            "type": "array",
            "description": "Search TERMS only — e.g. 'climate change' or 'best espresso machine', one per line. Do NOT paste a search URL here; put any reddit.com/search?q=... or reddit.com/r/.../search?q=... link in the 'Reddit URLs' field below instead. Each keyword runs independently. Use the 'Search returns' toggles below to choose posts, comments, communities, users, or any mix.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Reddit URLs",
            "type": "array",
            "description": "Paste Reddit links here (this is the right field for any URL). Accepts subreddit URLs (reddit.com/r/...), post URLs (reddit.com/r/.../comments/...), user profiles (reddit.com/user/...), and search URLs (reddit.com/search?q=... or reddit.com/r/<sub>/search?q=...). Mix any types in one list. Tip: a search URL already carries its own keyword, sort, and time window — those override the global Sort/Time settings for that link.",
            "items": {
              "type": "string"
            }
          },
          "searchCommunityName": {
            "title": "Restrict Search to a Community",
            "type": "string",
            "description": "Optional. If set, every search keyword above will be restricted to this single subreddit (e.g., 'programming'). Leave empty to search all of Reddit. The 'r/' prefix is optional."
          },
          "searchPosts": {
            "title": "Search returns posts",
            "type": "boolean",
            "description": "Include matching posts in keyword search results.",
            "default": true
          },
          "searchComments": {
            "title": "Search returns comments",
            "type": "boolean",
            "description": "Include matching comments in keyword search results. Note: Reddit's public comment-search index has been limited since 2021 — this option may return zero rows for many queries. To extract comments containing a keyword reliably, search for posts and let the actor walk each post's comment tree (see Maximum comments per post).",
            "default": false
          },
          "searchCommunities": {
            "title": "Search returns communities",
            "type": "boolean",
            "description": "Include matching subreddits in keyword search results.",
            "default": false
          },
          "searchUsers": {
            "title": "Search returns users",
            "type": "boolean",
            "description": "Include matching user profiles in keyword search results.",
            "default": false
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "new",
              "hot",
              "top",
              "rising",
              "controversial",
              "relevance",
              "comments"
            ],
            "type": "string",
            "description": "Result ordering. 'Hot' surfaces trending posts, 'New' shows the most recent, 'Top' shows the highest-scoring within the time window, 'Rising' is gaining momentum, 'Controversial' surfaces polarizing posts, 'Comments' is most-commented, 'Relevance' applies only to keyword searches. Pick 'New' to collect the most data — sorting a named subreddit (or user) by New pages through its full history, far past the ~1,000 limit that the other sorts hit.",
            "default": "new"
          },
          "time": {
            "title": "Time window",
            "enum": [
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Date window for 'Top' sort and for keyword searches. Other sorts ignore this. 'All time' returns the unfiltered ranking.",
            "default": "all"
          },
          "includeNSFW": {
            "title": "Include NSFW content",
            "type": "boolean",
            "description": "When off (the default), posts and subreddits flagged as over-18 are filtered out of the results — safer for general use. Turn on if you specifically want adult-tagged content.",
            "default": false
          },
          "postDateLimit": {
            "title": "Earliest post date",
            "type": "string",
            "description": "Only include posts created on or after this date. Accepts a calendar date (2025-04-01), an ISO timestamp (2025-04-01T12:00:00Z), or a relative value such as '7d', '2 weeks', '48 hours', '1 month'. When sort=new, pagination stops as soon as older posts are reached. Leave empty for no limit."
          },
          "commentDateLimit": {
            "title": "Earliest comment date",
            "type": "string",
            "description": "Only include comments created on or after this date. Accepts a calendar date (2025-04-01), an ISO timestamp (2025-04-01T12:00:00Z), or a relative value such as '7d', '2 weeks', '48 hours'. Leave empty for no limit."
          },
          "skipComments": {
            "title": "Skip comments on posts",
            "type": "boolean",
            "description": "When scraping a post (via URL or search), do NOT also fetch its comment tree. On by default to keep runs fast — turn off if you also want each post's comment thread (this multiplies request count and runtime).",
            "default": true
          },
          "skipUserPosts": {
            "title": "Skip user's posts",
            "type": "boolean",
            "description": "When scraping a user profile, skip their submitted posts.",
            "default": false
          },
          "skipUserComments": {
            "title": "Skip user's comments",
            "type": "boolean",
            "description": "When scraping a user profile, skip their comments.",
            "default": false
          },
          "skipCommunityInfo": {
            "title": "Skip subreddit info row",
            "type": "boolean",
            "description": "When scraping a subreddit, omit the metadata row (member count, description, etc.) and only emit the posts.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum results (total)",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Cap on total rows in the output dataset across every source. Use 0 for truly unlimited — the run keeps paging until each source's full history is exhausted (a named subreddit or user sorted by New can run very deep, so expect large datasets and longer runs). To reach high targets, name a specific subreddit (or user) and sort by New — that returns full history, well beyond 1,000. The r/popular and r/all aggregator feeds and keyword searches stay capped at about 1,000, so prefer specific community names when you want depth.",
            "default": 100
          },
          "maxComments": {
            "title": "Maximum comments per post",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "How many comments to fetch from each post. Use 0 to fetch the entire comment tree (can balloon for popular threads). Hard upper bound is 1,000.",
            "default": 100
          },
          "maxCommentDepth": {
            "title": "Maximum comment depth",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum nesting depth when walking a comment tree (0 = only top-level comments, 10 = ten levels of replies). Caps how deep the actor follows nested reply chains. Hard upper bound is 20.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}