{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper - Posts, Comments & Community Data",
    "description": "Collect public Reddit posts by subreddit, keyword or topic. Add comment, community and author rows, then export the results. Pay per delivered row plus a start fee.",
    "version": "0.4",
    "x-build-id": "KNmw7LaERVBTCZ6Kb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lentic_clockss~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lentic_clockss-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/lentic_clockss~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-lentic_clockss-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/lentic_clockss~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-lentic_clockss-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": {
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddit names to scrape (with or without r/). Example: [\"forhire\", \"freelance\"]. Fill this, Search Queries, or Subreddit catalog topic — any one is enough. Explicitly pass an empty array (subreddits=[]) with searchQueries for a site-wide Reddit search. Omitting subreddits and all other targets defaults to r/forhire; a searchQueries-only input also runs a site-wide search.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search Queries",
            "type": "array",
            "description": "Keywords to search. With subreddits set, searches inside each subreddit. With subreddits empty, runs a site-wide Reddit search. If empty while subreddits are set, scrapes the subreddit feed (new/hot/top) without keyword filtering.",
            "items": {
              "type": "string"
            }
          },
          "subredditCatalog": {
            "title": "Subreddit catalog topic",
            "enum": [
              "hiring",
              "programming",
              "housing",
              "tickets",
              "local",
              "classifieds",
              "remote_jobs",
              "startups"
            ],
            "type": "string",
            "description": "Pick a built-in topic instead of naming subreddits. Its subreddit list is merged with Subreddits (deduplicated). Enough on its own to start a run."
          },
          "postIds": {
            "title": "Post IDs or URLs",
            "type": "array",
            "description": "Collect specific posts by id or link instead of a feed: t3_ fullnames, bare ids, or reddit.com/r/<sub>/comments/<id> permalinks. Detail mode returns one row per post with the full post record and is not combined with Subreddits or Search Queries.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results per subreddit",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Most rows for each subreddit (or for each search query when no subreddit is given). Default 70; larger numbers are collected in parts of 70. Posts and optional comment, community and user rows share this limit and are billed at the same price per row. The whole run stops at your maximum total charge. Free Apify plan: up to 200 rows per run and 10 runs of this Actor (limits set by the Actor developer).",
            "default": 70
          },
          "sort": {
            "title": "Sort Order",
            "enum": [
              "new",
              "hot",
              "top",
              "relevance"
            ],
            "type": "string",
            "description": "How to sort results. 'new' for latest, 'hot' for trending, 'top' for highest scored, 'relevance' for search relevance (only with searchQueries — listing mode falls back to 'new').",
            "default": "new"
          },
          "timeFilter": {
            "title": "Time Filter",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time range filter. Applies to 'top' sort and search results.",
            "default": "week"
          },
          "includeComments": {
            "title": "Include Comments",
            "type": "boolean",
            "description": "Add available comments and nested replies as separate billed rows. Comments share the maxResults limit with posts and other enabled rows; complete threads are not guaranteed.",
            "default": false
          },
          "maxComments": {
            "title": "Max Comments Per Post",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum comment rows per post, including available nested replies, when includeComments is enabled. The remaining maxResults limit can reduce this number.",
            "default": 10
          },
          "expandCommentSubtrees": {
            "title": "Expand Missing Comment Replies",
            "minimum": 0,
            "maximum": 25,
            "type": "integer",
            "description": "When includeComments is on, spend up to this many extra requests filling replies that the comment page left out. Each expansion is one request and still counts against maxComments. Set 0 to turn it off.",
            "default": 0
          },
          "allowListingFallback": {
            "title": "Allow top/week fallback",
            "type": "boolean",
            "description": "Allow an empty top/week subreddit feed to retry as new, without a time restriction. Leave off to keep the requested sort and time range.",
            "default": false
          },
          "includeSubredditMeta": {
            "title": "Include community details",
            "type": "boolean",
            "description": "Add public details for communities found in collected posts as separate subreddit rows. Each row is billed at the same price and counts toward maxResults.",
            "default": false
          },
          "includeUserMeta": {
            "title": "Include author details",
            "type": "boolean",
            "description": "Add available public details for post authors as separate user rows, such as karma and account creation time. Each row is billed at the same price and counts toward maxResults.",
            "default": false
          },
          "expandRelatedSubreddits": {
            "title": "Expand related subreddits",
            "type": "boolean",
            "description": "When a subreddits entry names a catalog topic (hiring, programming, housing, tickets, local, classifieds, remote_jobs, startups), expand it into the full subreddit list for that topic. Without this flag a topic token is passed through verbatim.",
            "default": false
          },
          "workerBaseUrl": {
            "title": "Developer testing",
            "type": "string",
            "description": "Leave empty. Used only by the developer for testing."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}