{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper: Posts, Comments, Subreddits",
    "description": "Scrape Reddit posts, comments, subreddits and user profiles by search, subreddit, user or post link, with no login. Every row carries kind, post_id, title, body, author, subreddit, score, comment_count and created_at. Export JSON, CSV or Excel.",
    "version": "0.1",
    "x-build-id": "RuiBrolMGwWbLrboU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/herus13~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-herus13-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/herus13~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-herus13-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/herus13~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-herus13-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to collect",
            "enum": [
              "search_posts",
              "search_comments",
              "subreddit_feed",
              "subreddit_info",
              "user_posts",
              "user_comments",
              "profile",
              "post_comments"
            ],
            "type": "string",
            "description": "One kind of data per run. `search_posts` and `search_comments` read `queries`; `subreddit_feed` and `subreddit_info` read `subreddits`; `user_posts`, `user_comments` and `profile` read `users`; `post_comments` reads `posts`. Fill only the list your mode reads, the others must stay empty."
          },
          "queries": {
            "title": "Search phrases",
            "type": "array",
            "description": "Phrases to search Reddit for, one per entry. Used by the Search posts and Search comments modes. One search returns about 250 results at most; to go deeper the run repeats the phrase per subreddit, time window and order and removes duplicates. Leave empty when your mode does not read this list.",
            "items": {
              "type": "string"
            }
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddit names or links, one per entry, for example `programming`, `r/programming` or `https://www.reddit.com/r/programming`. Used by the Subreddit posts and Subreddit details modes. Leave empty when your mode does not read this list.",
            "items": {
              "type": "string"
            }
          },
          "users": {
            "title": "Users",
            "type": "array",
            "description": "User names or profile links, one per entry, for example `spez`, `u/spez` or `https://www.reddit.com/user/spez`. Used by the User posts, User comments and User profile modes. Leave empty when your mode does not read this list.",
            "items": {
              "type": "string"
            }
          },
          "posts": {
            "title": "Posts",
            "type": "array",
            "description": "Post links or ids, one per entry, for example `https://www.reddit.com/r/redditdev/comments/abc123/title/` or `abc123`. Used by the Comments of a post mode. Leave empty when your mode does not read this list.",
            "items": {
              "type": "string"
            }
          },
          "search_in_subreddits": {
            "title": "Search only in these subreddits",
            "type": "array",
            "description": "Search modes only. Restrict every phrase to these subreddits, one per entry. Leave empty to search all of Reddit.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Order",
            "enum": [
              "RELEVANCE",
              "HOT",
              "TOP",
              "NEW",
              "COMMENTS",
              "CONTROVERSIAL"
            ],
            "type": "string",
            "description": "Order of the results. Search accepts RELEVANCE, HOT, TOP, NEW and COMMENTS; Subreddit posts accepts HOT, NEW, TOP and CONTROVERSIAL; User posts accepts NEW and HOT; User comments accepts NEW and TOP. Leave empty for the mode's default: RELEVANCE for search, NEW for the listings. Not used by the other modes."
          },
          "time_range": {
            "title": "Time window",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Only results from this period: hour, day, week, month, year or all. Works in the search modes, and in Subreddit posts and User comments when the order is TOP (or CONTROVERSIAL for subreddits). Leave empty for no window."
          },
          "comment_sort": {
            "title": "Comment order",
            "enum": [
              "CONFIDENCE",
              "TOP",
              "NEW",
              "OLD",
              "CONTROVERSIAL",
              "QA"
            ],
            "type": "string",
            "description": "Comments of a post mode only. Order of the comment tree: CONFIDENCE (Reddit's default), TOP, NEW, OLD, CONTROVERSIAL or QA. Leave empty for CONFIDENCE."
          },
          "max_items_per_target": {
            "title": "Max results per phrase, subreddit or user",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "How many posts or comments to return for each entry of the list your mode reads. Default 100, minimum 0, maximum 10000. Set 0 to return nothing. Reddit lists about 950 items per subreddit or user, and a single search about 250, so higher values only help when the source has that many.",
            "default": 100
          },
          "max_comments_per_post": {
            "title": "Max comments per post",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Comments of a post mode only. How many comments to return for each post, replies included. Default 500, minimum 0, maximum 100000. Set 0 to return none. The run also writes one report row per post saying how many of the post's comments were read and which were left out.",
            "default": 500
          },
          "proxyUrls": {
            "title": "Your own proxy URLs (optional)",
            "type": "array",
            "description": "Leave empty: the run uses the residential proxy this actor ships with, included in the price of the run. To route the run through your own provider instead, add one gateway URL per entry, for example `http://user:pass@host:port` — works with any provider that issues URLs. When set, the run uses these first and switches to the included proxy if they stop working, so a broken proxy never fails the run.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}