{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper V1 — Subreddit Feeds, Posts, Comments (4)",
    "description": "Scrape Reddit posts and comments by URL or subreddit name. No Reddit account or OAuth required.",
    "version": "1.8",
    "x-build-id": "2V4LJ3hvHO5YfPTag"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/red_crawler~reddit-content-fetcher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-red_crawler-reddit-content-fetcher",
        "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/red_crawler~reddit-content-fetcher/runs": {
      "post": {
        "operationId": "runs-sync-red_crawler-reddit-content-fetcher",
        "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/red_crawler~reddit-content-fetcher/run-sync": {
      "post": {
        "operationId": "run-sync-red_crawler-reddit-content-fetcher",
        "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": [
          "endpoint"
        ],
        "properties": {
          "endpoint": {
            "title": "What to fetch",
            "enum": [
              "subreddit_posts",
              "post_detail",
              "post_comments",
              "comment_detail"
            ],
            "type": "string",
            "description": "Choose which kind of Reddit content to retrieve.",
            "default": "subreddit_posts"
          },
          "subreddit": {
            "title": "Subreddit name",
            "pattern": "^[A-Za-z0-9_]{1,50}$",
            "type": "string",
            "description": "Subreddit name without the r/ prefix. Used by: Scrape Posts."
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "best",
              "hot",
              "new",
              "top",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "Post sort order. Used by: Scrape Posts.",
            "default": "hot"
          },
          "time_filter": {
            "title": "Time filter (only for sort = top or controversial)",
            "enum": [
              "",
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window — IGNORED unless sort is set to 'top' or 'controversial'. Leave as '—' for other sort orders.",
            "default": ""
          },
          "limit": {
            "title": "Limit",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Max posts to fetch (1–1000). Used by: Scrape Posts.",
            "default": 25
          },
          "post_detail_url": {
            "title": "Post URL or ID",
            "type": "string",
            "description": "Reddit post permalink, t3_xxxxx, or short id. Used by: Post Detail."
          },
          "comments_post_url": {
            "title": "Post URL or ID",
            "type": "string",
            "description": "Reddit post permalink, t3_xxxxx, or short id whose comments you want. Used by: Scrape Comments."
          },
          "comments_num": {
            "title": "Comments count",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many comments to return (1–5000). Used by: Scrape Comments.",
            "default": 100
          },
          "comment_sort": {
            "title": "Comment sort",
            "enum": [
              "best",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "Comment sort order. Used by: Scrape Comments.",
            "default": "top"
          },
          "comment_mode": {
            "title": "Comment mode",
            "enum": [
              "custom",
              "top_level",
              "all"
            ],
            "type": "string",
            "description": "How to traverse the comment tree. 'custom' = full tree to count, 'top_level' = top comments only, 'all' = full tree no limit.",
            "default": "custom"
          },
          "comment_url": {
            "title": "Comment URL or ID",
            "type": "string",
            "description": "Reddit comment permalink, t1_xxxxx, or short id. Used by: Comment Detail."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}