{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Search Scraper",
    "description": "Search public Reddit posts by keyword, phrase or subreddit, with title, body, subreddit, author, score, comment count and date. Sort by relevance, new, top or comments. Works with Apify MCP and the API.",
    "version": "1.0",
    "x-build-id": "4oklrbcIyS1g3fR7r"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~reddit-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-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/khadinakbar~reddit-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-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/khadinakbar~reddit-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-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": {
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Use this when the user wants to search public Reddit posts by keyword, topic, brand, phrase, or question. Plain text such as 'OpenAI API pricing', a quoted exact phrase, or operators like OR / AND / -word. Give this or the queries list. Do not put subreddit URLs here; use withinSubreddit to scope a search."
          },
          "queries": {
            "title": "More search terms",
            "type": "array",
            "description": "Optional extra search terms searched in the same run, up to 25 in total with searchQuery. Posts found by several terms are saved and charged once. Leave empty to search only searchQuery.",
            "items": {
              "type": "string"
            }
          },
          "withinSubreddit": {
            "title": "Limit search to subreddit",
            "type": "string",
            "description": "Optional subreddit scope for the search query. Accepts a subreddit name with or without r/ prefix, such as 'learnpython' or 'r/MachineLearning'. Leave blank to search across Reddit. This is not a post URL field."
          },
          "maxResults": {
            "title": "Maximum search results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of distinct Reddit posts to save across all search terms. Each saved post is charged as one result event; repeated posts are never saved or charged. Defaults to 25. One search ends near 200 distinct posts (Reddit search depth); use several terms or deepSearch to go further. Maximum 10000.",
            "default": 25
          },
          "sortBy": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "new",
              "top",
              "comments"
            ],
            "type": "string",
            "description": "How to sort Reddit search results. Use 'relevance' for the closest keyword match, 'new' for recent posts, 'top' for highly scored posts, or 'comments' for heavily discussed posts. Defaults to relevance. This affects search ranking only, not comment extraction.",
            "default": "relevance"
          },
          "timeFilter": {
            "title": "Time filter",
            "enum": [
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window for Reddit search results. Use 'day', 'week', 'month', 'year', or 'all'. Defaults to month for useful recent monitoring results. This is a search filter, not a post creation date guarantee.",
            "default": "month"
          },
          "postDateLimit": {
            "title": "Ignore posts older than date",
            "type": "string",
            "description": "Optional post creation cutoff applied after provider search results are returned. Use ISO 8601 format such as '2026-01-01' or '2026-01-01T00:00:00Z'. Leave blank to keep all provider results. Invalid dates are ignored and reported as a PARTIAL warning."
          },
          "deepSearch": {
            "title": "Deep search (more posts)",
            "type": "boolean",
            "description": "When on, and one sort order runs out before maxResults is reached, the Actor also searches the other sort orders (new, top, comments) and merges only posts it has not saved yet. Use it to collect more than about 200 posts per term. Rows show sortUsed. Off by default.",
            "default": false
          },
          "onlyNewSinceLastRun": {
            "title": "Only new posts since last run",
            "type": "boolean",
            "description": "When on, posts saved by an earlier run with the same search terms and subreddit are skipped and not charged. Good for scheduled monitoring. The seen-post list is kept in a named store in your account (reddit-search-seen-ids).",
            "default": false
          },
          "excludePostIds": {
            "title": "Posts to skip",
            "type": "array",
            "description": "Optional list of Reddit post IDs (such as 1xl3evj or t3_1xl3evj) to skip without charge, for example posts you already have.",
            "items": {
              "type": "string"
            }
          },
          "includeNsfw": {
            "title": "Include NSFW results",
            "type": "boolean",
            "description": "When enabled, includes Reddit posts marked NSFW in the dataset. Disabled by default to keep monitoring and business research outputs safer. This does not bypass private, quarantined, deleted, or login-only content. NSFW filtering depends on provider metadata.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}