{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper - Neatrat ⚡",
    "description": "🚀 High-speed Reddit scraping. No API limits. No Proxies needed.",
    "version": "0.1",
    "x-build-id": "DGNggk2QGtavHaEjN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/neatrat~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-neatrat-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/neatrat~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-neatrat-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/neatrat~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-neatrat-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": {
          "searchTerms": {
            "title": "Search Keywords",
            "type": "array",
            "description": "Keywords to search on Reddit. The options below (search targets, sort, time, community filter) only apply to this section. Independent from Direct URLs — you can use either or both, results are combined.",
            "items": {
              "type": "string"
            }
          },
          "searchTypes": {
            "title": "Search targets",
            "uniqueItems": true,
            "type": "array",
            "description": "Which surfaces to search for each keyword. Pick any combination of posts, communities, and users.",
            "items": {
              "type": "string",
              "enum": [
                "posts",
                "communities",
                "users"
              ],
              "enumTitles": [
                "Search for posts",
                "Search for communities",
                "Search for users"
              ]
            },
            "default": [
              "posts"
            ]
          },
          "withinSubreddit": {
            "title": "Limit search to a community",
            "type": "string",
            "description": "Optional. When set, keyword post searches are restricted to this subreddit. Accepts `r/programming` or `programming`."
          },
          "searchSort": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "new",
              "comments",
              "top"
            ],
            "type": "string",
            "description": "Sort order for keyword post searches.",
            "default": "new"
          },
          "timeFilter": {
            "title": "Time range",
            "enum": [
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Optional time window for keyword searches and top/controversial sorts.",
            "default": "all"
          },
          "startUrls": {
            "title": "Reddit URLs",
            "type": "array",
            "description": "Reddit URLs to scrape. The actor auto-detects posts, comment permalinks, subreddits, user pages, search URLs, popular, and leaderboard pages — no need to pick the right endpoint manually. Use `/r/<subreddit>/about/` to scrape a subreddit's metadata (sidebar, description, rules) instead of its posts.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "postSort": {
            "title": "Default sort for subreddit URLs",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "Sort used for subreddit listing URLs when the URL itself does not already pick a sort (e.g. `/r/programming/` vs `/r/programming/top/`).",
            "default": "hot"
          },
          "crawlComments": {
            "title": "Scrape comments for each post",
            "type": "boolean",
            "description": "When enabled, the actor also expands each post's comment tree (multiple comment pages). Full post bodies are always fetched for listing items regardless of this flag. Leave off for faster scrapes that only need post content.",
            "default": false
          },
          "includeNsfw": {
            "title": "Include NSFW (18+) content",
            "type": "boolean",
            "description": "When disabled, NSFW posts are filtered out before storage and never billed.",
            "default": true
          },
          "maxItems": {
            "title": "Max items in dataset",
            "minimum": 1,
            "type": "integer",
            "description": "Global cap across the whole run. Each stored dataset item counts against this. Free Apify users are additionally capped at 500 total results across all runs.",
            "default": 100
          },
          "maxPosts": {
            "title": "Max posts",
            "minimum": 0,
            "type": "integer",
            "description": "Cap for post-style listings: subreddit feeds, popular, user posts, and keyword post search.",
            "default": 25
          },
          "maxComments": {
            "title": "Max comments per run",
            "minimum": 0,
            "type": "integer",
            "description": "Global cap on nested comments stored across all full-post fetches. Also used as the listing cap for user comment pages.",
            "default": 100
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Per-post cap on nested comments stored inside each full post result.",
            "default": 20
          },
          "maxCommunities": {
            "title": "Max communities",
            "minimum": 0,
            "type": "integer",
            "description": "Cap for community-style listings: community search and leaderboard.",
            "default": 10
          },
          "maxUsers": {
            "title": "Max users",
            "minimum": 0,
            "type": "integer",
            "description": "Cap for user search results.",
            "default": 25
          },
          "pages": {
            "title": "Pages per listing",
            "minimum": 1,
            "type": "integer",
            "description": "Listing pages to follow. For posts and comment permalinks, this controls how many extra comment expansion rounds the scraper runs.",
            "default": 1
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}