{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Search and Thread Scraper",
    "description": "Search Reddit by keyword and subreddit, read subreddits, or read threads with comments. One row per post and comment: title, text, author, subreddit, date, link, and the search term it matched. No login, no Reddit API key. CSV or Clay ready.",
    "version": "0.1",
    "x-build-id": "FnnVUTiIhRKygQuMX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mambalabs~reddit-search-thread-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mambalabs-reddit-search-thread-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/mambalabs~reddit-search-thread-scraper/runs": {
      "post": {
        "operationId": "runs-sync-mambalabs-reddit-search-thread-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/mambalabs~reddit-search-thread-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-mambalabs-reddit-search-thread-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": {
          "search_terms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to search Reddit for, one per line. With subreddits, each term is searched inside each subreddit; without, across all of Reddit. Up to 50 searches per run (terms times subreddits).",
            "items": {
              "type": "string"
            }
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddit names (sales, r/sales, or a subreddit URL), one per line. With search terms, the search runs inside these subreddits. Without search terms, the newest posts of each subreddit are read (see Subreddit sort).",
            "items": {
              "type": "string"
            }
          },
          "thread_urls": {
            "title": "Thread URLs",
            "type": "array",
            "description": "Reddit thread URLs, for example https://www.reddit.com/r/sales/comments/1abc23/title/. Each thread returns its post and its comments, up to Max comments per thread. Up to 200 per run.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Search sort",
            "enum": [
              "new",
              "relevance",
              "top",
              "comments",
              "hot"
            ],
            "type": "string",
            "description": "How Reddit orders search results: new (default, newest first), relevance, top, comments (most commented), or hot.",
            "default": "new"
          },
          "subreddit_sort": {
            "title": "Subreddit sort",
            "enum": [
              "new",
              "hot",
              "top",
              "rising"
            ],
            "type": "string",
            "description": "Used when subreddits are given without search terms: new (default), hot, top, or rising.",
            "default": "new"
          },
          "time_window": {
            "title": "Time window",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Reddit's own time filter for searches and for the top subreddit sort: hour, day, week, month (default), year, or all.",
            "default": "month"
          },
          "since_days": {
            "title": "Only posts from the last N days",
            "type": "string",
            "description": "Optional. Drop posts older than this many days, by the date the post was published. 0 or empty: no date limit beyond the time window."
          },
          "max_posts_per_query": {
            "title": "Max posts per query",
            "type": "string",
            "description": "At most this many posts per search or subreddit, up to 1,000. Search results without the search term do not count; the actor reads up to 10 pages of 100 results to fill the count.",
            "default": "50"
          },
          "require_term_match": {
            "title": "Only posts that contain the search term",
            "enum": [
              "true",
              "false"
            ],
            "type": "string",
            "description": "On (default): a search result is kept only when the search term is in the post's title or text, its words next to each other and in order (case and punctuation ignored, so cold email matches Cold-email and cold emails). Results Reddit returns for other reasons are dropped and not charged. Off: every result Reddit returns is kept.",
            "default": "true"
          },
          "include_comments": {
            "title": "Include comments",
            "enum": [
              "true",
              "false"
            ],
            "type": "string",
            "description": "On: each post found by a search or a subreddit read also returns its comments as rows, up to Max comments per thread, one extra page read per post. Off (default): posts only. Thread URLs always return their comments.",
            "default": "false"
          },
          "max_comments_per_thread": {
            "title": "Max comments per thread",
            "type": "string",
            "description": "At most this many comments per thread, top comments first, up to 500.",
            "default": "25"
          },
          "comment_depth": {
            "title": "Comment depth",
            "type": "string",
            "description": "How many reply levels to read under each top level comment, 1 to 10. Default 3.",
            "default": "3"
          },
          "only_new": {
            "title": "Only new results",
            "enum": [
              "true",
              "false"
            ],
            "type": "string",
            "description": "On: a post or comment an earlier run already returned for the same query is skipped and not charged, so a scheduled run returns only new posts. The ids are kept in a key-value store in your own Apify account. Off (default): every result is returned.",
            "default": "false"
          },
          "state_key": {
            "title": "State key",
            "type": "string",
            "description": "Optional. A name for the only new results memory, so two schedules keep separate memories."
          },
          "max_charge_usd": {
            "title": "Maximum charge for this run (USD)",
            "type": "string",
            "description": "Optional. The run stops before a charge that would pass this amount. Summary rows are always returned."
          },
          "proxy_mode": {
            "title": "Proxy mode",
            "enum": [
              "auto",
              "residential"
            ],
            "type": "string",
            "description": "auto (default): requests go through the Apify proxy pool, and a request the pool cannot get through is retried on residential addresses. residential: every request uses residential addresses. A reliability setting only; it does not change what you pay.",
            "default": "auto"
          },
          "source_tag": {
            "title": "Source tag",
            "type": "string",
            "description": "Internal attribution tag. Leave empty."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}