{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper: Posts, Comments & Community Research",
    "description": "Find Reddit posts by keyword, collect subreddit discussions, export comments and replies, and organize available community and public profile data. Simple no-code inputs and separate datasets.",
    "version": "0.2",
    "x-build-id": "wKYXNadgxaM5IOCOn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lofomachines~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lofomachines-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/lofomachines~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-lofomachines-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/lofomachines~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-lofomachines-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": "Reddit links",
            "type": "array",
            "description": "Paste links to Reddit posts, subreddits, searches or public user profiles. Links are collected independently of the keyword and subreddit fields below. Leave empty when using those fields instead.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchQueries": {
            "title": "Keywords to search",
            "type": "array",
            "description": "Enter one phrase per line. Leave Subreddits empty to search across Reddit, or add subreddit names to search each phrase inside those communities. The prefilled coffee example collects up to 10 results; replace or clear it for your own search.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "subreddits": {
            "title": "Subreddit names",
            "type": "array",
            "description": "Enter names such as Coffee or espresso. With keywords, each keyword is searched inside each listed subreddit. Without keywords, collect the subreddit feeds. Reddit links above remain independent sources.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxPosts": {
            "title": "How many posts per source?",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum unique posts for each keyword/source or selected user post feed. Set 0 to follow all pages Reddit exposes. Reddit may stop returning posts before this number; unlimited does not mean a complete historical archive.",
            "default": 1000
          },
          "includeComments": {
            "title": "Collect comments too",
            "type": "boolean",
            "description": "Also save available discussion comments and replies in the Comments dataset. Leave off if you only need posts. Public feeds may omit scores and reply relationships.",
            "default": false
          },
          "maxComments": {
            "title": "Comments per post",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum comments and replies to collect from each post. Also applies to a user comment feed. Use 0 for all comments the source exposes.",
            "default": 1000
          },
          "postSort": {
            "title": "Post order",
            "enum": [
              "new",
              "hot",
              "top",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "Choose the subreddit feed to collect. Applies to subreddit names and links without their own explicit feed. Top and Controversial also use the time period below.",
            "default": "new"
          },
          "timeFilter": {
            "title": "Time period",
            "enum": [
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Reddit time period for search and supported Top/Controversial feeds. This is a source-side filter, not an exact date range, and is not applied to direct post links or ordinary New/Hot feeds.",
            "default": "all"
          },
          "includeAdultContent": {
            "title": "Include adult-marked posts",
            "type": "boolean",
            "description": "Allow posts marked as adult content when Reddit makes them publicly available. This does not unlock restricted communities or require a login. Adult-marked posts are excluded by default when their classification is known.",
            "default": false
          },
          "userSections": {
            "title": "Collect from user links",
            "uniqueItems": true,
            "type": "array",
            "description": "Choose public posts, public comments or both for supplied user profile links. An explicit submitted/comments URL selects that particular feed. Private, removed or inaccessible content is not restored.",
            "items": {
              "type": "string",
              "enum": [
                "posts",
                "comments"
              ],
              "enumTitles": [
                "Posts",
                "Comments"
              ]
            },
            "default": [
              "posts"
            ]
          },
          "redditAccessToken": {
            "title": "Reddit OAuth access token (optional)",
            "type": "string",
            "description": "Optional current OAuth access token from your own approved Reddit application. Leave empty for public feeds, which omit many metrics and reply relationships. This is not your Reddit password. Stored as a secret input. Richer access depends on token permissions, expiration and Reddit restrictions."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}