{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk Reddit Search Scraper",
    "description": "Scrape Reddit posts by keyword — run 100+ searches in one job, no Reddit API key needed. Filter by time and sort, tag every post with your own routing ID, export JSON or CSV. Fast Mode cuts compute cost ~45%. Crash-safe with incremental saving. For brand monitoring, social listening, research.",
    "version": "1.0",
    "x-build-id": "3SKAr6aX0qLWKWqey"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/xmolodtsov~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-xmolodtsov-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/xmolodtsov~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-xmolodtsov-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/xmolodtsov~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-xmolodtsov-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",
        "required": [
          "queries"
        ],
        "properties": {
          "queries": {
            "title": "Search Queries",
            "type": "array",
            "description": "Add your search queries here. Each query has a <code>profileUrl</code> (echoed back in results for routing) and a <code>searchQuery</code> (what to search on Reddit).<br><br><strong>Tip:</strong> You can batch hundreds of queries in a single run for maximum cost efficiency.",
            "items": {
              "type": "object",
              "required": [
                "profileUrl",
                "searchQuery"
              ],
              "properties": {
                "profileUrl": {
                  "title": "Profile URL",
                  "type": "string",
                  "description": "Your identifier URL that will be echoed back in every result. Use this to route posts to the correct profile in your system."
                },
                "searchQuery": {
                  "title": "Search Query",
                  "type": "string",
                  "description": "Reddit search query. Supports Reddit's search syntax: quotes for exact match, OR for alternatives."
                }
              }
            }
          },
          "searchTime": {
            "title": "Time Filter",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Filter posts by how recently they were created. Use <strong>Past Week</strong> for fresh content or <strong>All Time</strong> for comprehensive results.",
            "default": "all"
          },
          "sort": {
            "title": "Sort Order",
            "enum": [
              "new",
              "relevance",
              "hot",
              "top",
              "comments"
            ],
            "type": "string",
            "description": "How to sort search results. <strong>Newest</strong> for recent posts, <strong>Top</strong> for highest engagement, <strong>Most Relevant</strong> for best keyword match.",
            "default": "new"
          },
          "includeNSFW": {
            "title": "Include NSFW Content",
            "type": "boolean",
            "description": "Include adult (NSFW) content. When disabled, posts flagged as adult are filtered out. In Fast Mode detection is best-effort (based on the search page), so occasional NSFW items may slip through.",
            "default": true
          },
          "searchMode": {
            "title": "Search Mode",
            "enum": [
              "raw",
              "exact",
              "and",
              "or"
            ],
            "type": "string",
            "description": "How to combine multi-word search terms.<br><br><strong>raw</strong>: Pass as-is (Reddit default, implicit AND).<br><strong>exact</strong>: Wrap in quotes for exact phrase match. <em>Recommended for names/usernames.</em><br><strong>and</strong>: Explicit AND between words.<br><strong>or</strong>: Match any word.",
            "default": "raw"
          },
          "searchType": {
            "title": "Search Type",
            "enum": [
              "posts",
              "all"
            ],
            "type": "string",
            "description": "Filter search results by type.<br><br><strong>posts</strong>: Only search posts (default, recommended).<br><strong>all</strong>: Search without the posts-only filter. Note: the output always contains posts only — comments and communities are never scraped.",
            "default": "posts"
          },
          "maxItemsPerQuery": {
            "title": "Results Per Query",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum posts to return for each search query. Keep low (25-50) for cost efficiency, increase (100-200) for comprehensive coverage.",
            "default": 25
          },
          "maxItems": {
            "title": "Global Results Limit",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on total posts across all queries. Useful for budget control. Leave empty to collect all available results up to per-query limits."
          },
          "fastMode": {
            "title": "Fast Mode",
            "type": "boolean",
            "description": "<strong>Recommended for monitoring use cases.</strong> Extracts data directly from search pages instead of fetching each post individually — about 45% cheaper (measured).<br><br><strong>Trade-off:</strong> post body is not available (always <code>null</code>), username/flair are usually missing, video fields are not detected, and vote/comment counts are approximate.<br><br>Use Standard Mode when you need post text, author data, or exact counts.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Parallel Queries",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many queries to process simultaneously. Higher = faster but uses more memory.<br><br><strong>Recommended:</strong> 2 for 1GB memory, 3 for 2GB memory.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings. <strong>Residential proxies are required</strong> - Reddit blocks datacenter IPs. The default setting uses Apify's residential proxy group.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}