{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Posts Scraper — Subreddits, Search & Links",
    "description": "Get Reddit posts from subreddit names, keyword searches and Reddit links in one form. Filter by score, comments, flair, author and date; optionally add comments. No login or API key.",
    "version": "1.0",
    "x-build-id": "mC8tCYUYPCbDVrPNj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~reddit-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-reddit-posts-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/khadinakbar~reddit-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-reddit-posts-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/khadinakbar~reddit-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-reddit-posts-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": "Use this field when the user gives subreddit names (with or without r/). Each subreddit returns posts using Sort By and Time Filter. Examples: 'programming', 'r/learnpython'. Leave empty if you use Search Queries or Reddit Links.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search Queries",
            "type": "array",
            "description": "Use this field when the user describes a topic or keyword to search across all of Reddit. Do not use it for a subreddit name (use Subreddits). Examples: 'best laptop 2026', 'side hustle ideas'.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Reddit Links",
            "type": "array",
            "description": "Use this field when the user gives specific Reddit links: a subreddit page (https://www.reddit.com/r/datascience/top/), a Reddit search link, or a single post link. User profile links are not supported and are skipped.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "sort": {
            "title": "Sort By",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial",
              "relevance"
            ],
            "type": "string",
            "description": "How to sort posts. 'hot' = currently popular, 'new' = most recent, 'top' = highest score (use with Time Filter), 'rising' = gaining momentum, 'controversial' = most debated (returned as top), 'relevance' = best match for searches.",
            "default": "hot"
          },
          "time": {
            "title": "Time Filter",
            "enum": [
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Time range for 'top' and for searches. 'hour' keeps only posts from the last hour. Ignored for hot, new and rising listings.",
            "default": "all"
          },
          "maxResults": {
            "title": "Max Posts",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum posts to save in total across all sources. Up to 500 per run (0 also means 500). Free plan runs are capped at 25. Only saved posts are charged. Default: 50.",
            "default": 50
          },
          "includeComments": {
            "title": "Include Comments",
            "type": "boolean",
            "description": "If on, also saves comments for the first 20 posts of the run as separate rows with data_type 'comment'. Comment rows are not charged separately. Comments need a post with at least one comment.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max Comments Per Post",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum comments saved per post (only when Include Comments is on). Nested replies are flattened. Default: 20.",
            "default": 20
          },
          "includeNSFW": {
            "title": "Include NSFW Content",
            "type": "boolean",
            "description": "Include posts marked as adult content (NSFW / 18+). Off by default; leave it off unless you need it.",
            "default": false
          },
          "minScore": {
            "title": "Minimum Score (Upvotes)",
            "type": "integer",
            "description": "Only include posts with at least this many upvotes. Leave empty for no minimum. Useful for filtering to only high-quality posts."
          },
          "maxScore": {
            "title": "Maximum Score (Upvotes)",
            "type": "integer",
            "description": "Only include posts with at most this many upvotes. Leave empty for no maximum."
          },
          "minComments": {
            "title": "Minimum Comments",
            "type": "integer",
            "description": "Only include posts with at least this many comments. Leave empty for no minimum."
          },
          "flairFilter": {
            "title": "Flair Filter",
            "type": "string",
            "description": "Only include posts with this exact flair text. Case-sensitive. Example: 'Question', 'Discussion', 'Tutorial'. Leave empty to include all flairs."
          },
          "authorFilter": {
            "title": "Author Filter",
            "type": "string",
            "description": "Only include posts from this specific Reddit username (without u/). Leave empty to include all authors."
          },
          "postDateLimit": {
            "title": "Post Date Limit (exclude posts older than)",
            "type": "string",
            "description": "Only include posts created after this date. Format: YYYY-MM-DD or ISO 8601 (e.g., 2025-01-01). Pagination stops automatically when posts older than this date are encountered."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}