{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper for Leads & Pain Points",
    "description": "Scrape Reddit posts, comments, communities, and profiles for lead research, pain point discovery, social listening, and AI-ready market intelligence workflows.",
    "version": "1.0",
    "x-build-id": "wBhFlznZbRrIiwt5S"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/runtime~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-runtime-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/runtime~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-runtime-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/runtime~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-runtime-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": {
          "startLinks": {
            "title": "Start URLs",
            "type": "array",
            "description": "Reddit URLs to scrape directly. Supports subreddit, post, user, leaderboard, search, and multireddit URLs. If empty and no search queries are provided, the actor falls back to https://www.reddit.com/r/popular/.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Keyword searches to run against Reddit search.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "searchScope": {
            "title": "Search scope",
            "enum": [
              "posts",
              "communities"
            ],
            "type": "string",
            "description": "Choose whether search queries return posts or communities/users.",
            "default": "posts"
          },
          "sortOrder": {
            "title": "Sort order",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "comments"
            ],
            "type": "string",
            "description": "Sort order passed to Reddit search.",
            "default": "relevance"
          },
          "timeWindow": {
            "title": "Time window",
            "enum": [
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Relative time filter for post searches.",
            "default": "all"
          },
          "totalItemCap": {
            "title": "Total item cap",
            "minimum": 1,
            "type": "integer",
            "description": "Stop the run after this many items have been stored.",
            "default": 100
          },
          "postCap": {
            "title": "Post cap",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of posts collected per subreddit, feed, or user. Set to 0 to disable post collection where supported.",
            "default": 50
          },
          "commentCap": {
            "title": "Comment cap",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of comments collected per post or user. Set to 0 to disable comment collection.",
            "default": 25
          },
          "communityCap": {
            "title": "Community cap",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of communities collected from search.",
            "default": 25
          },
          "profileCap": {
            "title": "Profile cap",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of user profiles collected from community/user search results.",
            "default": 25
          },
          "leaderboardCap": {
            "title": "Leaderboard cap",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of communities collected from /subreddits/leaderboard.",
            "default": 25
          },
          "scrollWaitSeconds": {
            "title": "Retry wait",
            "minimum": 1,
            "type": "integer",
            "description": "Seconds to wait before retrying 403, 429, and connection errors.",
            "default": 30
          },
          "useApifyProxy": {
            "title": "Use Apify Proxy",
            "type": "boolean",
            "description": "Enable Apify Proxy when no custom proxy URLs are provided.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Advanced Apify Proxy or custom proxy settings. Residential proxies are recommended for Reddit.",
            "default": {}
          },
          "minScore": {
            "title": "Minimum score",
            "minimum": 0,
            "type": "integer",
            "description": "Exclude full-extract posts and comments with a lower score. Not applied in light extract mode.",
            "default": null
          },
          "includeNSFW": {
            "title": "Include NSFW",
            "type": "boolean",
            "description": "When disabled, excludes full-extract posts and communities marked as NSFW. Not applied in light extract mode.",
            "default": true
          },
          "logMetrics": {
            "title": "Log metrics",
            "type": "boolean",
            "description": "Log duration, throughput, filters, retries, and errors at the end of the run.",
            "default": true
          },
          "enablePagination": {
            "title": "Enable pagination",
            "type": "boolean",
            "description": "Follow Reddit listing pagination via the after cursor until caps are reached or no more pages are available.",
            "default": false
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Exclude full-extract items created before this ISO 8601 date. Not applied in light extract mode.",
            "default": null
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Exclude full-extract items created after this ISO 8601 date. Not applied in light extract mode.",
            "default": null
          },
          "enableDeduplication": {
            "title": "Enable deduplication",
            "type": "boolean",
            "description": "Skip duplicate full-extract items by entityId within the same run. Not applied in light extract mode.",
            "default": false
          },
          "lightExtract": {
            "title": "Light extract",
            "type": "boolean",
            "description": "Return only permalink, headline, and textBody for posts and comments. Communities, profiles, filters, deduplication, and extendResultFunction are skipped in this mode.",
            "default": false
          },
          "failOnNoResults": {
            "title": "Fail on no results",
            "type": "boolean",
            "description": "Fail the run when no entities are stored after crawl errors. Useful for internal validation and monitoring; leave disabled for normal scraping jobs that may intentionally return empty datasets.",
            "default": false
          },
          "extendResultFunction": {
            "title": "Extend result function",
            "type": "string",
            "description": "Optional JavaScript function called as async ({ data, page }) => object for full-extract items. Invalid functions fall back to a no-op. Not executed in light extract mode.",
            "default": null
          },
          "debugLog": {
            "title": "Debug log",
            "type": "boolean",
            "description": "Enable extra debug logging for fetched URLs and HTTP status codes.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}