{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Subreddit Scraper",
    "description": "Extract public subreddit metadata from Reddit communities: subscriber counts, weekly visitors and contributions, titles, descriptions, creation dates, NSFW and restriction flags, icons, banners, rules and post flairs. Optionally collect new, hot, top or rising posts. No Reddit login or API key.",
    "version": "1.0",
    "x-build-id": "jpqWm85S7ayNj4Jio"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/coregent~reddit-subreddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-coregent-reddit-subreddit-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/coregent~reddit-subreddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-coregent-reddit-subreddit-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/coregent~reddit-subreddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-coregent-reddit-subreddit-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",
        "required": [
          "subreddits"
        ],
        "properties": {
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Communities to scrape, one per line. Every common form works: startups, r/startups, https://www.reddit.com/r/startups/, https://old.reddit.com/r/startups/. Equivalent spellings of one community are merged before anything is fetched or charged. Post, user, search and multireddit URLs are rejected. Up to 1,000 per run. If a run meets 100 unavailable communities and they outnumber the available ones, the rest of that run gets basic, uncharged data only (see the README).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeRules": {
            "title": "Include rules",
            "type": "boolean",
            "description": "Add the community's public rules (short name, description, violation reason) to each subreddit row. A rules failure never fails the row.",
            "default": true
          },
          "includePostFlairs": {
            "title": "Include post flair templates",
            "type": "boolean",
            "description": "Add the community's public post flair templates (ID, text, moderator-only flag). Reddit does not publish flair colours on this route, so the colour fields are null.",
            "default": false
          },
          "includePosts": {
            "title": "Also collect posts",
            "type": "boolean",
            "description": "Collect public posts from each community as separate rows (rowType = post). Off by default — the Actor is subreddit-first, and posts are charged per post.",
            "default": false
          },
          "postSort": {
            "title": "Post sort",
            "enum": [
              "NEW",
              "HOT",
              "TOP",
              "RISING",
              "CONTROVERSIAL"
            ],
            "type": "string",
            "description": "Reddit's listing order. NEW is chronological and stops early at the 'Only posts newer than' date. TOP and CONTROVERSIAL use the time range below.",
            "default": "NEW"
          },
          "topTimeRange": {
            "title": "Time range (Top / Controversial)",
            "enum": [
              "HOUR",
              "DAY",
              "WEEK",
              "MONTH",
              "YEAR",
              "ALL"
            ],
            "type": "string",
            "description": "Window for TOP and CONTROVERSIAL listings. Ignored for NEW, HOT and RISING.",
            "default": "WEEK"
          },
          "maxPostsPerSubreddit": {
            "title": "Max posts per subreddit",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Cap per community. Reddit's live listings expose a bounded history — commonly around the most recent or top ~1,000 posts per listing — so higher values can return fewer.",
            "default": 25
          },
          "postsNewerThan": {
            "title": "Only posts newer than",
            "type": "string",
            "description": "Optional. A span such as '24 hours', '7 days', '2 weeks', or a date such as '2026-09-01'. Older posts are skipped and never charged; a NEW listing stops as soon as it reaches them.",
            "default": ""
          },
          "includeNsfw": {
            "title": "Include NSFW posts",
            "type": "boolean",
            "description": "When off, NSFW communities still get their subreddit row (with isNsfw = true), but no posts are collected from them, and NSFW-tagged posts elsewhere are skipped.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Subreddits in parallel",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many communities to process at once (1–20). Posts within one community are always fetched in order.",
            "default": 5
          },
          "requestDelayMs": {
            "title": "Minimum delay between requests (ms)",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Extra pacing on top of the built-in rate control for Reddit's post listings. Raise it if runs report rate limiting.",
            "default": 0
          },
          "debugMode": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Verbose logging of requests, pages and skips.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Datacenter proxy (the default) or no proxy both work. Apify RESIDENTIAL proxy is refused and fails the run at startup: post listings are large and residential bandwidth is billed to the Actor, while Reddit serves the same data to datacenter addresses. To route through your own residential provider, use Custom proxy URLs — that traffic goes through your account and is honoured.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}