{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper - Markdown for AI & n8n",
    "description": "Extract Reddit posts and comments as LLM-ready Markdown. No API key needed. Direct n8n/Make integration—connect output to AI nodes instantly. 20x faster than browser scrapers. Perfect for lead gen, product validation, and market research workflows.",
    "version": "0.0",
    "x-build-id": "6pQTtaF0nVo0s1bKX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/clearpath~reddit-to-llm-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-clearpath-reddit-to-llm-api",
        "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/clearpath~reddit-to-llm-api/runs": {
      "post": {
        "operationId": "runs-sync-clearpath-reddit-to-llm-api",
        "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/clearpath~reddit-to-llm-api/run-sync": {
      "post": {
        "operationId": "run-sync-clearpath-reddit-to-llm-api",
        "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": {
          "mode": {
            "title": "How do you want to scrape?",
            "enum": [
              "subreddit_feed",
              "search",
              "direct_urls"
            ],
            "type": "string",
            "description": "Pick one mode. Each mode works differently - read the descriptions above to choose. Only fill in the fields for your selected mode.",
            "default": "subreddit_feed"
          },
          "subreddits": {
            "title": "Which subreddits to browse?",
            "type": "array",
            "description": "FOR BROWSE MODE: Enter the subreddits you want to get posts from. We'll grab the hot/new/top posts from each one. You can enter them in any format - we'll figure it out. Examples: 'Python' or '/r/Python' or 'https://reddit.com/r/Python' all work.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": [
              "indiehackers"
            ]
          },
          "subredditSort": {
            "title": "What kind of posts?",
            "enum": [
              "hot",
              "new",
              "top",
              "rising"
            ],
            "type": "string",
            "description": "Choose which posts to get: 'hot' = trending now, 'new' = newest first, 'top' = highest voted, 'rising' = getting popular fast",
            "default": "hot"
          },
          "subredditTimeFilter": {
            "title": "From what time period? (only for 'top' posts)",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "If you selected 'top' above, choose the time range. For example, 'week' gets the top posts from the last 7 days. Ignored if you didn't select 'top'."
          },
          "subredditLimit": {
            "title": "How many posts per subreddit?",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum posts to get from each subreddit. For example, if you enter 3 subreddits and set this to 50, you'll get up to 150 posts total (50 from each).",
            "default": 25
          },
          "searchKeywords": {
            "title": "What keywords to search for?",
            "type": "array",
            "description": "FOR SEARCH MODE: Enter words or phrases. Posts must contain ALL keywords you enter (AND logic). Examples: Enter 'API' + 'problem' to find posts about API problems. Or enter 'pain point' + 'SaaS' to find SaaS pain points.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "restrictToSubreddits": {
            "title": "Where to search? (optional)",
            "type": "array",
            "description": "Leave empty to search ALL of Reddit. Or enter specific subreddits to only search within them. Example: To find pain points, enter 'SaaS' + 'startups' to search only in r/SaaS and r/startups. Same format as above - 'Python' or '/r/Python' or URLs all work.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "searchSort": {
            "title": "How to sort results?",
            "enum": [
              "relevance",
              "new",
              "top",
              "comments"
            ],
            "type": "string",
            "description": "Choose how to order search results: 'relevance' = best matches first, 'new' = newest first, 'top' = highest voted, 'comments' = most discussed",
            "default": "relevance"
          },
          "searchLimit": {
            "title": "How many search results?",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of posts to return from the search. Example: Set to 100 to get the top 100 matching posts.",
            "default": 25
          },
          "urls": {
            "title": "Which posts to scrape?",
            "type": "array",
            "description": "FOR SCRAPE URLs MODE: Paste the full URLs of Reddit posts you want to scrape. Get these by copying the URL from your browser when viewing a post. Example: 'https://reddit.com/r/Python/comments/abc123/my_post_title/'",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "includeComments": {
            "title": "Get comments too?",
            "type": "boolean",
            "description": "Check this to scrape comments on each post. Uncheck to only get the post itself (faster but less info).",
            "default": true
          },
          "commentsLimit": {
            "title": "How many comments per post?",
            "minimum": 0,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum comments to get for each post. Set to 0 for unlimited (we'll get as many as Reddit gives us, usually up to several thousand). Higher numbers = longer scraping time.",
            "default": 500
          },
          "scrapeImages": {
            "title": "Download images?",
            "type": "boolean",
            "description": "Check this to extract and store images from posts (like uploaded images, galleries). Warning: This will use more storage space.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy settings (Advanced)",
            "type": "object",
            "description": "Leave as default unless you know what you're doing. This controls how the scraper connects to Reddit to avoid being blocked.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}