{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper - Posts, Comments & New Posts Monitor, $0.90/1K",
    "description": "Reddit scraper and API alternative: extract posts from any subreddit (hot, new, top, rising) or the comments of a post with title, author (pseudonymized), date, link, permalink and text. Social listening and research from public feeds, no login; optional API credentials add scores.",
    "version": "0.1",
    "x-build-id": "2O3FWsTLShOemZLDt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sweet_stickball~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sweet_stickball-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/sweet_stickball~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sweet_stickball-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/sweet_stickball~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sweet_stickball-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": {
          "subreddit": {
            "title": "Subreddit or Reddit URL",
            "type": "string",
            "description": "Subreddit name (e.g. 'python') or full Reddit URL (e.g. 'https://reddit.com/r/python'). Can also be a post URL to scrape comments. Required unless 'searchQuery' is used with a Reddit app clientId/clientSecret (search across all of Reddit)."
          },
          "maxItems": {
            "title": "Maximum items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of posts or comments to return.",
            "default": 20
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "hot",
              "new",
              "top",
              "rising"
            ],
            "type": "string",
            "description": "How to sort subreddit posts.",
            "default": "hot"
          },
          "topPeriod": {
            "title": "Top period",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Only used when sort is 'top'. Time period to filter top posts.",
            "default": "all"
          },
          "searchQuery": {
            "title": "Search keywords (optional)",
            "type": "string",
            "description": "Optional. Keep only posts matching these keywords. With 'subreddit' and no API credentials: the subreddit's posts (up to 10 feed pages, about 1,000 posts) whose title or text contains every word. With a Reddit app clientId/clientSecret: Reddit's own search, inside 'subreddit' or across all of Reddit when 'subreddit' is empty."
          },
          "postedAfter": {
            "title": "Posted after (optional)",
            "type": "string",
            "description": "Optional. Only posts/comments created on or after this date: '2026-11-01', '2026-11-01T12:00:00Z' or a relative age such as '7 days' or '12 hours'. With sort 'new', reading stops at the first older post. Items without a date are dropped when a date bound is set."
          },
          "postedBefore": {
            "title": "Posted before (optional)",
            "type": "string",
            "description": "Optional. Only posts/comments created before this date (same formats as 'Posted after')."
          },
          "clientId": {
            "title": "Reddit app client ID (optional)",
            "type": "string",
            "description": "Optional. Client ID of your own Reddit app (create a 'script' or 'web' app at https://www.reddit.com/prefs/apps). With clientId and clientSecret the Actor uses the official Reddit API, which adds score, comment count, flair, NSFW flag and comment nesting. Without them it reads Reddit's public feeds, where these fields are null."
          },
          "clientSecret": {
            "title": "Reddit app client secret (optional)",
            "type": "string",
            "description": "Optional. Secret of the same Reddit app. Used only to request an application-only OAuth token; never logged or stored in the dataset."
          },
          "onlyNew": {
            "title": "Only new items (monitoring)",
            "type": "boolean",
            "description": "Optional. When on, the Actor remembers the posts/comments it returned for this search and returns (and charges) only items not returned by a previous run. The first run returns everything and records it. The memory is kept in the key-value store 'reddit-scraper-incremental' of your account. With sort 'new', reading stops at the first post already returned.",
            "default": false
          },
          "stateKey": {
            "title": "State key (optional)",
            "type": "string",
            "description": "Optional, used with 'onlyNew'. Name of the memory for this search, e.g. 'python-new'. Leave empty to derive it from the search fields (same subreddit, sort and filters = same memory). Set it to keep the memory when you change the input, or to run several independent monitors of the same search."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}