{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper — Posts, Comments, Search, Subreddit Monitoring",
    "description": "Subreddit listings, keyword search and full comment trees, no login and no proxy to configure. Posts with full text, score, flair and media; comments with depth and parent. Schedule it with onlyNew to get just what appeared since the last run. Pay per row, no start fee.",
    "version": "0.1",
    "x-build-id": "5wffBtz8ayRhiZjmN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/moxlade~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-moxlade-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/moxlade~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-moxlade-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/moxlade~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-moxlade-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",
            "maxItems": 100,
            "type": "array",
            "description": "Subreddit names or URLs (Upwork, r/Upwork, https://www.reddit.com/r/Upwork/). Each is listed by `sort` and `time`. With `searches` set as well, every search runs inside each of these subreddits instead.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Listing sort",
            "enum": [
              "new",
              "hot",
              "top",
              "rising"
            ],
            "type": "string",
            "description": "How each subreddit is listed. `new` is chronological, which is what `postedSince` and `onlyNew` walk most cheaply.",
            "default": "new"
          },
          "time": {
            "title": "Time range (top)",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Applies to `sort: top` only.",
            "default": "week"
          },
          "searches": {
            "title": "Search queries",
            "maxItems": 100,
            "type": "array",
            "description": "Keyword searches for posts, across all of Reddit — or inside each of `subreddits` when both are given. One row per matching post.",
            "items": {
              "type": "string"
            }
          },
          "searchSort": {
            "title": "Search sort",
            "enum": [
              "new",
              "relevance",
              "hot",
              "top",
              "comments"
            ],
            "type": "string",
            "description": "Order of search results, as Reddit's own search offers it.",
            "default": "new"
          },
          "postUrls": {
            "title": "Post URLs or ids",
            "maxItems": 1000,
            "type": "array",
            "description": "Specific posts to fetch: URLs (https://www.reddit.com/r/Upwork/comments/1w8w2hb/…) or ids (1w8w2hb, t3_1w8w2hb). Each comes back with its full body and, with `includeComments`, its comment tree.",
            "items": {
              "type": "string"
            }
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Fetch the comment tree of every delivered post — one `comment` row per comment, with author, score, depth and parent, right after its post. Billed as `comment` per row.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Cap on comment rows per post. Deep threads are expanded breadth-first until the cap.",
            "default": 100
          },
          "commentSort": {
            "title": "Comment sort",
            "enum": [
              "confidence",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "Reddit's comment ordering for the tree.",
            "default": "confidence"
          },
          "fetchBodies": {
            "title": "Fetch post bodies for search hits",
            "type": "boolean",
            "description": "A search hit alone carries title, score, comment count and date. Leave this on to read each hit's author and full text as well (one extra request per post). Subreddit listings and post URLs always carry the body.",
            "default": true
          },
          "postedSince": {
            "title": "Posted since",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2}(T[0-9:.]+Z?)?|\\s*\\d{1,3}\\s*[hdwmHDWM]\\s*)$",
            "type": "string",
            "description": "Keep only posts created after this point: a date (2026-09-01), a timestamp, or a window before now — 12h, 7d, 2w, 1m. With `sort: new` the listing walk stops at the cutoff, so nothing older is fetched."
          },
          "onlyNew": {
            "title": "Only new since the last run (monitoring)",
            "type": "boolean",
            "description": "Remember every post delivered and skip it next time. Schedule the task and each run returns only what appeared since the previous one — a run with nothing new delivers no rows and costs nothing. The memory is a named key-value store (`stateStoreName`, or one derived from the targets when left empty).",
            "default": false
          },
          "stateStoreName": {
            "title": "Monitoring store name",
            "pattern": "^[a-zA-Z0-9-]{0,63}$",
            "type": "string",
            "description": "Name of the key-value store that keeps the delivered ids for `onlyNew`. Leave empty to derive one from the subreddits, searches and post URLs; set it to share one memory between tasks or to reset it (a new name starts fresh)."
          },
          "maxItems": {
            "title": "Max posts",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many post rows across the whole run. Comment rows are bounded separately by `maxCommentsPerPost`. With no start fee, this is also your spending cap: posts × $0.002 (+ comments × $0.001).",
            "default": 100
          },
          "maxPostsPerSource": {
            "title": "Max posts per subreddit or search",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How far down each listing or search to look. Reddit itself stops a listing at about 1,000 posts.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}