{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper",
    "description": "Scrape public Reddit posts, comments, subreddits, and user profiles from search queries, Reddit URLs, subreddit feeds, or usernames. Export structured rows with IDs, URLs, authors, timestamps, scores, comment counts, media links, and matched inputs.",
    "version": "1.0",
    "x-build-id": "EdVReZLOexzlaUNXe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/maximedupre~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-maximedupre-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/maximedupre~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-maximedupre-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/maximedupre~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-maximedupre-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": {
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Add one or more Reddit search phrases.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "searchCommunityName": {
            "title": "Limit search to subreddit",
            "type": "string",
            "description": "Focus keyword search inside one subreddit, such as r/artificial. Leave empty to search all of Reddit."
          },
          "searchResultType": {
            "title": "Search result type",
            "enum": [
              "postsAndComments",
              "posts",
              "comments"
            ],
            "type": "string",
            "description": "Choose which result types to return for each search query.",
            "default": "postsAndComments"
          },
          "sort": {
            "title": "Search post sort",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "comments"
            ],
            "type": "string",
            "description": "Choose how Reddit ranks post search results.",
            "default": "new"
          },
          "commentSort": {
            "title": "Search comment sort",
            "enum": [
              "relevance",
              "top",
              "new"
            ],
            "type": "string",
            "description": "Choose how Reddit ranks comment search results.",
            "default": "new"
          },
          "time": {
            "title": "Search time range",
            "enum": [
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Limit search results to a Reddit time window.",
            "default": "all"
          },
          "dateFrom": {
            "title": "Start date",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
            "type": "string",
            "description": "Keep search results created on or after this date."
          },
          "dateTo": {
            "title": "End date",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
            "type": "string",
            "description": "Keep search results created on or before this date."
          },
          "maxDaysOld": {
            "title": "Freshness window",
            "minimum": 0,
            "type": "integer",
            "description": "Keep search results from the last number of days. Set 0 to turn this off. Date fields take priority when filled.",
            "default": 30
          },
          "includeNSFW": {
            "title": "Include NSFW content",
            "type": "boolean",
            "description": "Include Reddit search results marked as NSFW or over 18.",
            "default": false
          },
          "strictSearch": {
            "title": "Keep close keyword matches",
            "type": "boolean",
            "description": "Filter saved search rows toward records that clearly match the search phrase.",
            "default": false
          },
          "collectCommentsUnderSearchPosts": {
            "title": "Collect comments under found posts",
            "type": "boolean",
            "description": "Also collect comment threads under post results found by search queries.",
            "default": false
          },
          "startUrls": {
            "title": "Reddit URLs",
            "type": "array",
            "description": "Add Reddit post, comment, subreddit, user, popular, or search URLs.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "title": "URL",
                  "type": "string",
                  "description": "Reddit URL",
                  "pattern": "^https?:\\/\\/([^\\/]+\\.)?reddit\\.com\\/.+"
                }
              }
            }
          },
          "subredditNames": {
            "title": "Subreddits",
            "type": "array",
            "description": "Add subreddit names or r/name handles.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "subredditSort": {
            "title": "Subreddit feed sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising"
            ],
            "type": "string",
            "description": "Choose which subreddit feed to collect.",
            "default": "hot"
          },
          "subredditTime": {
            "title": "Subreddit top time range",
            "enum": [
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Choose the time window when subreddit feed sort is Top.",
            "default": "all"
          },
          "collectCommentsUnderSubredditPosts": {
            "title": "Collect comments under subreddit posts",
            "type": "boolean",
            "description": "Also collect comment threads under posts from subreddit feeds.",
            "default": true
          },
          "userNames": {
            "title": "Users",
            "type": "array",
            "description": "Add Reddit usernames or u/name handles.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "userActivity": {
            "title": "User activity",
            "enum": [
              "postsAndComments",
              "posts",
              "comments"
            ],
            "type": "string",
            "description": "Choose which public activity rows to collect from user profiles.",
            "default": "postsAndComments"
          },
          "postRowLimit": {
            "title": "Post row limit",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum post rows to save for each search query, subreddit, user, or listing URL. Leave empty or set 0 to save all available post rows."
          },
          "commentRowLimit": {
            "title": "Comment row limit",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum comment rows to save for each search query, user, comment URL, or search URL. Leave empty or set 0 to save all available comment rows."
          },
          "commentsPerExpandedPost": {
            "title": "Comments per expanded post",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum comments to save under each post when comment collection is turned on in a section. Set 0 to save all comments under each post.",
            "default": 150
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}