{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Search Scraper: Keywords & Mentions, $2/1K Posts",
    "description": "Input: keywords, optionally in one subreddit, with sort order and time window. Output: one JSON row per matching post with title, author, subreddit, score, comment count, permalink and UTC date. Monitoring mode returns only posts new since your last run. $2 per 1,000 posts.",
    "version": "0.1",
    "x-build-id": "QWLjIU4aTyuuOX2Gz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/actorforgehq~reddit-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-actorforgehq-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/actorforgehq~reddit-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-actorforgehq-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/actorforgehq~reddit-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-actorforgehq-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": "Keywords",
            "type": "array",
            "description": "Search phrases, one per line, for example web scraping. Each phrase is a separate search with the sort order and time window below.",
            "items": {
              "type": "string"
            }
          },
          "searchCommunityName": {
            "title": "Subreddit (optional)",
            "type": "string",
            "description": "Limit the search to one subreddit, name without r/, for example webdev. Leave empty to search all of Reddit."
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "new",
              "relevance",
              "hot",
              "top",
              "comments"
            ],
            "type": "string",
            "description": "The order Reddit uses to rank results: new (default), relevance, hot, top or most comments. With new, a date in Posts after also stops paging early.",
            "default": "new"
          },
          "time": {
            "title": "Time window",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Keep only results from the past hour, day, week, month, year or all time (default). Reddit applies it to its own ranking.",
            "default": "all"
          },
          "maxItems": {
            "title": "Max posts per keyword",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many posts to keep per keyword (default 100, hard cap 1,000). One search request returns about 7 posts, and Reddit's search itself ends after a few hundred results. With Search comments on, the same limit applies separately to comments per keyword.",
            "default": 100
          },
          "postedAfter": {
            "title": "Posts after (ISO date)",
            "type": "string",
            "description": "Keep only posts submitted on or after this date (UTC). With sort New the Actor also stops paging at the first result older than this date, so a narrow window costs fewer requests. With other sorts the date is applied after fetching."
          },
          "postedBefore": {
            "title": "Posts before (ISO date)",
            "type": "string",
            "description": "Keep only posts submitted on or before this date (UTC). Applied after fetching."
          },
          "searchComments": {
            "title": "Search comments too",
            "type": "boolean",
            "description": "Off by default. Turn it on to also search comments for the same keywords and save the matching comments as rows with type \"comment\" (author, body, score, date, permalink), charged as comments.",
            "default": false
          },
          "includeNSFW": {
            "title": "Include NSFW",
            "type": "boolean",
            "description": "Off by default: results from posts marked NSFW are skipped unless you turn this on.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new since last run",
            "type": "boolean",
            "description": "Skip posts and comments this Actor already gave you in earlier runs with the same keywords, subreddit, sort and time window: they are not saved again and not charged. New means not delivered to you before, not newer by time. With this on, Max posts counts new rows only, and paging stops at the first page where everything was already delivered. The list of delivered rows is kept in a key-value store in your own Apify account named reddit-search-only-new- plus a code made from your searches (the run log shows the exact name). It does not expire. To start over, delete that store in Storage.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Residential proxies are the default and the supported configuration. No country pin is needed. The run rotates proxy sessions and visitor cookies whenever Reddit refuses one.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}