{
  "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": "CN4kQnf50d8tnHW9q"
  },
  "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 to scrape (the 'r/' prefix is optional). Each subreddit is fetched independently using the sort and time settings below. Leave empty if you only want to use search keywords or URLs. If you leave every source empty, the run defaults to r/popular.",
            "items": {
              "type": "string"
            }
          },
          "searches": {
            "title": "Search Keywords",
            "type": "array",
            "description": "Keywords to search across Reddit (e.g., 'climate change', 'best espresso machine'). Each keyword runs independently. Use the 'Search returns' toggles below to choose whether to get posts, comments, communities, users, or any mix.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Reddit URLs",
            "type": "array",
            "description": "Paste Reddit URLs directly. Accepts subreddit URLs (reddit.com/r/...), post URLs (reddit.com/r/.../comments/...), user profiles (reddit.com/user/...), and search URLs (reddit.com/search?q=...). Mix any types in one list.",
            "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.",
            "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": 10000,
            "type": "integer",
            "description": "Cap on total rows in the output dataset across every source. Use 0 for unlimited (the run will keep paging until Reddit returns no more results). Hard upper bound is 10,000. Note: Reddit caps each subreddit/search source at roughly 1,000 results — to go deeper, split your query across multiple sorts, narrower time windows, or additional subreddits.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}