{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Url Scraper",
    "description": "Scrape Reddit posts and comments from a list of URLs. Returns title, author, score, text, media, and more. Built for large batches with parallel runs and residential proxy support.",
    "version": "0.27",
    "x-build-id": "nTRQ1QcqaKvSg0z3i"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/krillin~reddit-url-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-krillin-reddit-url-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/krillin~reddit-url-scraper/runs": {
      "post": {
        "operationId": "runs-sync-krillin-reddit-url-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/krillin~reddit-url-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-krillin-reddit-url-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 URLs (small lists)",
            "type": "array",
            "description": "Paste Reddit post or comment permalinks here for small/medium jobs (roughly up to a few thousand URLs). Each item needs a \"url\" field. For tens of thousands or millions of URLs, use urlsDatasetId instead — large lists do not fit well in this field.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "urlsDatasetId": {
            "title": "URLs Dataset ID (large jobs)",
            "type": "string",
            "description": "Apify Dataset ID where each item contains a Reddit URL (default field name: \"url\"). Use this for very large lists that do not fit in startUrls. Create a dataset in Console or push items from your notebook/API, then paste the dataset ID here."
          },
          "urlField": {
            "title": "URL field name in dataset",
            "type": "string",
            "description": "Which field on each dataset item holds the Reddit link. Default is \"url\". Change this if your items use another key such as \"link\" or \"permalink\".",
            "default": "url"
          },
          "outputDatasetName": {
            "title": "Results dataset name (optional)",
            "type": "string",
            "description": "Optional named dataset to ALSO write results to (in addition to the run's default dataset). Set a stable name (e.g. reddit-scrape-results) so you always know where to download. Leave empty to use only the run's default dataset."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "CRITICAL for success. Reddit blocks datacenter IPs. Enable Apify Proxy and select the RESIDENTIAL group for production runs. Without residential proxies you will often see HTTP 403 failures.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "How many URLs are fetched at the same time. The Actor always runs at this full concurrency from the start (no ramp-up), even for small URL lists. Default 100. Too high (e.g. 200) can cause more Reddit 403/429 blocks.",
            "default": 100
          },
          "maxRequestsPerCrawl": {
            "title": "Max URLs to scrape (test cap)",
            "minimum": 1,
            "type": "integer",
            "description": "Optional safety cap. Example: set 1000 to estimate cost/success rate before a full million-URL run. Leave empty for no limit."
          },
          "datasetOffset": {
            "title": "Dataset offset (advanced)",
            "minimum": 0,
            "type": "integer",
            "description": "Start index when reading the URLs dataset. Leave at 0 unless you want to scrape only a window of the dataset.",
            "default": 0
          },
          "datasetLimit": {
            "title": "Dataset limit (advanced)",
            "minimum": 1,
            "type": "integer",
            "description": "Max items to read from the URLs dataset for this run. Leave empty to read the whole dataset."
          },
          "progressLogEvery": {
            "title": "Log progress every N successes",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "How often to print progress (success count, fail rate). Use 1000–5000 for large runs so logs stay readable.",
            "default": 1000
          },
          "preflightCheck": {
            "title": "Preflight connectivity check",
            "type": "boolean",
            "description": "Before scraping, run one quick, time-boxed request to verify proxy/connectivity. Keep ON for production so you fail fast if proxies are misconfigured. Turn OFF for the absolute fastest start (saves ~1 request of startup latency).",
            "default": true
          },
          "shuffleUrls": {
            "title": "Shuffle URLs before scraping",
            "type": "boolean",
            "description": "Randomizes the order so the same subreddit is not hit over and over in a tight loop. Reduces blocks. Keep ON.",
            "default": true
          },
          "retryFailedUrls": {
            "title": "Second-pass retry for failed URLs",
            "type": "boolean",
            "description": "After the main pass, retry recoverable failed URLs once at lower concurrency with fresh IPs to recover temporary Reddit blocks. Keep ON unless you want maximum speed with no recovery pass.",
            "default": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}