{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper",
    "description": "Crawl Reddit posts, comments, communities, and user profiles without requiring login. Pay only for the results you get, limit scraping by posts or items, and export complete datasets in multiple formats for easy analysis or integration.",
    "version": "0.0",
    "x-build-id": "tdWrbjeFllIWDwn2n"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapingdino~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapingdino-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/scrapingdino~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapingdino-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/scrapingdino~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapingdino-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": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Full Reddit URLs: subreddits, users, posts, search results, or popular feeds. When provided, search parameters are ignored unless ignoreStartUrls is true.",
            "items": {
              "type": "string"
            }
          },
          "searches": {
            "title": "Search keywords",
            "type": "array",
            "description": "Keywords to search on Reddit. Used when startUrls is empty or ignoreStartUrls is true.",
            "items": {
              "type": "string"
            }
          },
          "searchPosts": {
            "title": "Search for posts",
            "type": "boolean",
            "description": "When using searches, include post results.",
            "default": true
          },
          "searchUsers": {
            "title": "Search for users",
            "type": "boolean",
            "description": "When using searches, include user results.",
            "default": false
          },
          "searchCommunities": {
            "title": "Search for communities",
            "type": "boolean",
            "description": "When using searches, include subreddit/community results.",
            "default": false
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Fetch comments for scraped posts.",
            "default": true
          },
          "includeMediaLinks": {
            "title": "Include media links and extra post metrics",
            "type": "boolean",
            "description": "When enabled, exported posts include imageUrls, videoUrls, mediaType, and upVoteRatio. Media is always processed internally; this only controls dataset export.",
            "default": true
          },
          "outputCompatibility": {
            "title": "Output compatibility",
            "enum": [
              "apify",
              "extended"
            ],
            "type": "string",
            "description": "apify: lean dataset aligned with trudax/reddit-scraper field names. extended: richer internal fields (source, createdAtUtc, authorFlairDetail).",
            "default": "apify"
          },
          "commentOutput": {
            "title": "Comment output format",
            "enum": [
              "flat",
              "tree"
            ],
            "type": "string",
            "description": "flat: export each comment as its own dataset row. tree: attach nested comment trees to posts (scraping behavior unchanged).",
            "default": "flat"
          },
          "includeUserInfo": {
            "title": "Include user profile info",
            "type": "boolean",
            "description": "When scraping user URLs, fetch profile metadata.",
            "default": true
          },
          "includeCommunityInfo": {
            "title": "Include community info",
            "type": "boolean",
            "description": "When scraping subreddit URLs, fetch community metadata (title, subscribers, etc.).",
            "default": true
          },
          "includeNSFW": {
            "title": "Include NSFW content",
            "type": "boolean",
            "description": "When false, items with over18=true are excluded from the dataset.",
            "default": true
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "rising",
              "comments"
            ],
            "type": "string",
            "description": "Sort for search and some listings: relevance, hot, top, new, rising, or comments (post search).",
            "default": "new"
          },
          "time": {
            "title": "Time filter",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window for top/controversial listings and search when sort is top.",
            "default": "all"
          },
          "maxItems": {
            "title": "Maximum total items",
            "minimum": 1,
            "maximum": 2147483647,
            "type": "integer",
            "description": "Hard cap on all dataset items combined (posts, comments, users, communities).",
            "default": 100
          },
          "maxPosts": {
            "title": "Maximum posts per source",
            "minimum": 0,
            "maximum": 2147483647,
            "type": "integer",
            "description": "Max posts per subreddit, user, search query, or popular feed.",
            "default": 50
          },
          "maxComments": {
            "title": "Maximum comments per post",
            "minimum": 0,
            "maximum": 2147483647,
            "type": "integer",
            "description": "Max comments fetched for each post when includeComments is true. Set to 0 to skip comments.",
            "default": 50
          },
          "maxUsers": {
            "title": "Maximum users per search",
            "minimum": 0,
            "maximum": 2147483647,
            "type": "integer",
            "description": "Max user results per search keyword.",
            "default": 10
          },
          "maxCommunities": {
            "title": "Maximum communities per search",
            "minimum": 0,
            "maximum": 2147483647,
            "type": "integer",
            "description": "Max community results per search keyword or community listing.",
            "default": 10
          },
          "postDateLimit": {
            "title": "Post date limit",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}",
            "type": "string",
            "description": "Only keep posts created on or after this ISO date (e.g. 2024-01-01). Forces chronological filtering on created_utc."
          },
          "commentDateLimit": {
            "title": "Comment date limit",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}",
            "type": "string",
            "description": "Only keep comments created on or after this ISO date (e.g. 2024-01-01)."
          },
          "ignoreStartUrls": {
            "title": "Ignore start URLs",
            "type": "boolean",
            "description": "If true, only searches are processed (ignores startUrls).",
            "default": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}