{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Search Scraper - Posts by Keyword, Subreddit & Date",
    "description": "Reddit Search Scraper: search Reddit posts by keyword, in all of Reddit or one subreddit, by relevance, new, top or comments, any date range: title, votes, author, subreddit and date, plus full text and comments if you want. No login or API key. $1.10 per 1,000 posts.",
    "version": "0.1",
    "x-build-id": "SLN9KOPe1Mwgiaibt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/socialscrapers~reddit-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-socialscrapers-reddit-search-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/socialscrapers~reddit-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-socialscrapers-reddit-search-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/socialscrapers~reddit-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-socialscrapers-reddit-search-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": {
          "searches": {
            "title": "Search keywords",
            "type": "array",
            "description": "Keywords to search Reddit posts for, one per line, for example \"standing desk\" or \"best budget headphones\". Each keyword is its own search and returns up to \"Max posts per keyword\" posts.",
            "items": {
              "type": "string"
            }
          },
          "searchSort": {
            "title": "Sort results by",
            "enum": [
              "relevance",
              "new",
              "top",
              "comments"
            ],
            "type": "string",
            "description": "Order of the results, as on Reddit. When you ask for more posts than one search returns (about 250), the scraper also reads the other orders within your time range and removes duplicates.",
            "default": "relevance"
          },
          "searchTime": {
            "title": "Time range",
            "enum": [
              "all",
              "year",
              "month",
              "week",
              "day"
            ],
            "type": "string",
            "description": "Only find posts from this period, for example the past week.",
            "default": "all"
          },
          "searchSubreddit": {
            "title": "Search in one subreddit (optional)",
            "type": "string",
            "description": "Leave empty to search all of Reddit. Give one subreddit, like Coffee or r/Coffee, to search only its posts."
          },
          "maxItemsPerSource": {
            "title": "Max posts per keyword",
            "minimum": 0,
            "type": "integer",
            "description": "Most posts to take from each keyword. 0 = no limit: the scraper keeps going while Reddit has more, reading other orders and narrower time ranges once one search ends. Comments do not count here. Example: 1000.",
            "default": 100
          },
          "searchMatchAllWords": {
            "title": "Only posts that mention every keyword word",
            "type": "boolean",
            "description": "Keep only posts whose title or text mentions every word of the keyword (plurals and accents count). Reddit's search also returns posts that match only in their comments. With this on, Reddit is first asked for posts with every word, so results are more relevant. Turn off to keep every post the search returns.",
            "default": true
          },
          "searchIncludePostDetails": {
            "title": "Full post text",
            "type": "boolean",
            "description": "Off by default: each result comes with its title, votes, comment count, author, subreddit and date. Turn on to also read each result's post page, for its full text, link, flair, upvote ratio, images and video. A result read this way is priced as \"Search result with full text\" ($1.45 per 1,000) instead of as a post.",
            "default": false
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Also collect each result's comments: one result per comment, right after its post, with its depth and parent.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Most comments to collect for each post when \"Include comments\" is on. 0 = every comment, including the replies Reddit folds behind \"more replies\". Example: 200.",
            "default": 50
          },
          "commentSort": {
            "title": "Sort comments by",
            "enum": [
              "best",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "The order comments are collected in, as on Reddit: Best (Reddit's default), Top, New, Controversial, Old or Q&A.",
            "default": "best"
          },
          "maxItems": {
            "title": "Max results in total",
            "minimum": 0,
            "type": "integer",
            "description": "Overall cap on results (posts plus comments) for the whole run. The run stops once it is reached. Leave empty (or 0) for no cap. Example: 10000."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Keep the default: Apify Proxy with the RESIDENTIAL group. Reddit refuses most datacenter IPs: with another Apify Proxy group, sessions Reddit refuses are retried on RESIDENTIAL (same country).",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}