{
  "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": "2.0",
    "x-build-id": "djREMGWTkPYvFpVgY"
  },
  "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": {
          "postRowLimit": {
            "title": "Post row limit",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many post rows. Leave empty or set 0 to save all available post rows."
          },
          "commentRowLimit": {
            "title": "Comment row limit",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many comment rows. Leave empty or set 0 to save all available comment rows."
          },
          "discoveryMethod": {
            "title": "Find content by",
            "enum": [
              "search",
              "urls",
              "subreddits",
              "users"
            ],
            "type": "string",
            "description": "Choose one way to find Reddit content. Only the fields in that choice's section are used."
          },
          "searchQueries": {
            "title": "Search queries: Queries",
            "type": "array",
            "description": "Add one or more Reddit search phrases.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "searchCommunityName": {
            "title": "Search queries: Subreddit",
            "type": "string",
            "description": "Search inside one subreddit, such as r/artificial. Leave empty to search all of Reddit."
          },
          "sort": {
            "title": "Search queries: Post sort",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "comments"
            ],
            "type": "string",
            "description": "Choose how Reddit ranks post search results.",
            "default": "new"
          },
          "commentSort": {
            "title": "Search queries: Comment sort",
            "enum": [
              "relevance",
              "top",
              "new"
            ],
            "type": "string",
            "description": "Choose how Reddit ranks comment search results.",
            "default": "new"
          },
          "dateFrom": {
            "title": "Search queries: Start",
            "pattern": "^(\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])|\\d+ (day|week|month|year)s?)$",
            "type": "string",
            "description": "Keep search results created on or after this time. Use a date like 2025-01-31 (UTC) or a relative value like 30 days."
          },
          "dateTo": {
            "title": "Search queries: 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 (UTC)."
          },
          "includeNSFW": {
            "title": "Search queries: Include NSFW content",
            "type": "boolean",
            "description": "Include Reddit search results marked as NSFW or over 18.",
            "default": false
          },
          "strictSearch": {
            "title": "Search queries: Keep exact word matches",
            "type": "boolean",
            "description": "Keep only results whose text contains every word of the search phrase. Other results are dropped.",
            "default": false
          },
          "startUrls": {
            "title": "Reddit URLs: URLs",
            "type": "array",
            "description": "Add full Reddit URLs. Post, comment, subreddit, user, popular, and search page URLs are supported.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "title": "URL",
                  "type": "string",
                  "description": "Full Reddit URL, such as https://www.reddit.com/r/artificial/",
                  "pattern": "^https?:\\/\\/([^\\/]+\\.)?reddit\\.com\\/.+"
                }
              }
            }
          },
          "subredditNames": {
            "title": "Subreddits: Names",
            "type": "array",
            "description": "Add subreddit names or r/name handles.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "subredditSort": {
            "title": "Subreddits: Feed sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising"
            ],
            "type": "string",
            "description": "Choose which subreddit feed to collect. For Top, the time range below applies.",
            "default": "hot"
          },
          "userNames": {
            "title": "Users: Names",
            "type": "array",
            "description": "Add Reddit usernames or u/name handles.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "time": {
            "title": "Time range",
            "enum": [
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Limit results to a Reddit time window. Applies to Search queries and to Top feeds of Subreddits.",
            "default": "all"
          },
          "contentType": {
            "title": "Posts or comments",
            "enum": [
              "postsAndComments",
              "posts",
              "comments"
            ],
            "type": "string",
            "description": "Choose which rows to return. Applies to Search queries and Users.",
            "default": "postsAndComments"
          },
          "includeComments": {
            "title": "Include comments under posts",
            "type": "boolean",
            "description": "Also collect comment threads under posts found by Search queries, Reddit URLs, and Subreddits.",
            "default": false
          },
          "commentsPerExpandedPost": {
            "title": "Comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Collect up to this many comments under each post, where available. Set 0 to collect all. Used only when comments are included.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}