{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper: posts, comments, subreddits, users & search",
    "description": "Scrape Reddit posts with every comment of a thread, subreddits by hot, new, top or rising, search results, user profiles with their posts and comments, and subreddit details: scores, upvote ratios, flairs, images, videos, links, karma. Fast, no login, no browser.",
    "version": "0.1",
    "x-build-id": "4PevdaJF8jYMlWeqT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pikoulas~reddit/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pikoulas-reddit",
        "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/pikoulas~reddit/runs": {
      "post": {
        "operationId": "runs-sync-pikoulas-reddit",
        "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/pikoulas~reddit/run-sync": {
      "post": {
        "operationId": "run-sync-pikoulas-reddit",
        "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": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Reddit URLs of posts (with their comments), comment permalinks, share links (reddit.com/r/.../s/...), redd.it links, subreddits (keeping a /top/?t=week or /new sort), users (/user/name, /submitted or /comments) and searches (reddit.com/search?q=..., r/name/search?q=...).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddit names (python, r/python) or URLs. Gives each one's details and its posts, sorted as set below. r/all, r/popular and multireddits (python+rust) work too.",
            "items": {
              "type": "string"
            }
          },
          "subredditSort": {
            "title": "Subreddit sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "The order of a subreddit's posts. Top and controversial take the time below.",
            "default": "hot"
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords searched on Reddit, for posts, communities or users as set below.",
            "items": {
              "type": "string"
            }
          },
          "searchFor": {
            "title": "Search for",
            "enum": [
              "posts",
              "communities",
              "users"
            ],
            "type": "string",
            "description": "Posts, communities (subreddits) or users. Reddit gives up to about a hundred communities or users per search.",
            "default": "posts"
          },
          "searchSort": {
            "title": "Search sort",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "comments"
            ],
            "type": "string",
            "description": "The order of a search's posts.",
            "default": "relevance"
          },
          "searchSubreddit": {
            "title": "Search in subreddit",
            "type": "string",
            "description": "Search posts in this subreddit only (python). Empty for all of Reddit."
          },
          "time": {
            "title": "Time",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "The period of a search and of a subreddit's top or controversial posts. Empty for Reddit's own: all time for search, today for a subreddit."
          },
          "users": {
            "title": "Users",
            "type": "array",
            "description": "Usernames (spez, u/spez) or profile URLs. Gives each profile's details, its posts, newest first, and its comments if set below.",
            "items": {
              "type": "string"
            }
          },
          "maxPostsPerSource": {
            "title": "Max posts per source",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Posts from each subreddit, search or user (communities or users for a search of those). Reddit lists up to about 1,000 per source. 0 for details only.",
            "default": 25
          },
          "includeComments": {
            "title": "Include comments of listed posts",
            "type": "boolean",
            "description": "Comments of every post the subreddits, searches and users list, up to the maximum below. Posts given by URL always come with theirs.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Comments and replies of each post, in the order set below, as deep as Reddit goes. 0 for none.",
            "default": 100
          },
          "commentsSort": {
            "title": "Comments sort",
            "enum": [
              "top",
              "best",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "The order comments are taken in.",
            "default": "top"
          },
          "maxCommentsPerUser": {
            "title": "Max comments per user",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Each user's own comments, newest first, with the post each answers. 0 for none (a user's /comments URL then takes max posts per source of them).",
            "default": 0
          },
          "includeDetails": {
            "title": "Include subreddit and user details",
            "type": "boolean",
            "description": "One item per subreddit (subscribers, description, creation date, icon) and per user (karma, creation date, badges).",
            "default": true
          },
          "includeNSFW": {
            "title": "Include NSFW",
            "type": "boolean",
            "description": "Posts, communities and users marked over 18.",
            "default": false
          },
          "postedAfter": {
            "title": "Posted after",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Only posts and comments from this date on (YYYY-MM-DD). Newest-first listings stop once they get past it; posts given by URL are taken whatever their date."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed for most runs. Reddit allows 100 requests per 10 minutes from an IP (a request gives 100 posts or up to 500 comments): past that, and when Reddit refuses the run's IP, the run takes a new IP from Apify's residential proxy by itself.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}