{
  "openapi": "3.0.1",
  "info": {
    "title": "reddit-posts-scraper-by-keyword-score-filter",
    "description": "Scrape Reddit posts from any subreddit with ease. This actor collects titles, upvotes, timestamps, authors, comment counts, and post URLs. Perfect for research, trend tracking, content analysis, and automations that rely on fresh Reddit data.",
    "version": "0.1",
    "x-build-id": "B6Y2F5b8SwteLrjJU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scraper-engine~reddit-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scraper-engine-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/scraper-engine~reddit-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scraper-engine-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/scraper-engine~reddit-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scraper-engine-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",
        "required": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "📡 Subreddits, URLs or search terms",
            "type": "array",
            "description": "Mix any of:\n• 📌 Subreddit — `news` or `r/technology`\n• 🌐 Full URL — `https://www.reddit.com/r/news/`\n• 🔍 Search term — `artificial intelligence` (runs a Reddit search)\n\nDuplicate entries are merged. At least one line is required.",
            "items": {
              "type": "string"
            }
          },
          "filterKeywords": {
            "title": "🔑 Watchlist keywords",
            "type": "array",
            "description": "Words/phrases to match against each post. Matching is case-insensitive. Example: `[\"layoffs\", \"acquisition\"]` with mode Any keeps posts mentioning either. Leave empty to disable keyword filtering.",
            "items": {
              "type": "string"
            }
          },
          "filterKeywordMode": {
            "title": "🧮 Keyword match mode",
            "enum": [
              "any",
              "all",
              "titleOnly",
              "exactPhrase"
            ],
            "type": "string",
            "description": "How the watchlist keywords must match. Any = at least one term (title + body). All = every term must appear. Title only = match the title text only. Exact phrase = the terms must appear together as one phrase.",
            "default": "any"
          },
          "minScore": {
            "title": "👍 Minimum score (upvotes)",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep posts whose upvote score is at least this value. Example: `500` skips everything under 500 upvotes. Set `0` to keep all scores.",
            "default": 0
          },
          "excludeNsfw": {
            "title": "🚫 Exclude NSFW posts",
            "type": "boolean",
            "description": "When on, posts flagged NSFW (over_18) are dropped and never charged.",
            "default": false
          },
          "restrictToSubreddit": {
            "title": "📍 Search inside one subreddit only",
            "type": "boolean",
            "description": "When on (and a subreddit is set below), any search-term source is run as an in-subreddit search (restrict_sr=1) instead of a global Reddit search.",
            "default": false
          },
          "searchSubreddit": {
            "title": "📂 Subreddit to search within",
            "type": "string",
            "description": "Subreddit name used when 'Search inside one subreddit only' is on. Example: `technology`. Ignored when that toggle is off."
          },
          "sortOrder": {
            "title": "📋 Sort order",
            "enum": [
              "hot",
              "new",
              "top",
              "rising"
            ],
            "type": "string",
            "description": "How Reddit sorts the feed. Hot = trending now, New = latest, Top = most upvoted, Rising = gaining traction.",
            "default": "top"
          },
          "timeFilter": {
            "title": "⏱️ Time range",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window for results. ⚠️ Applies only when Sort order is Top or Rising; ignored for Hot and New.",
            "default": "week"
          },
          "maxPosts": {
            "title": "📄 Max matching posts per source",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum posts to keep per source AFTER filtering (1–1000). The actor paginates until it has this many matches or runs out of posts.",
            "default": 10
          },
          "maxComments": {
            "title": "💬 Max comments per post",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Comments to fetch for each kept post (0–1000). Set 0 to skip comments and only collect post metadata (faster).",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "🔐 Proxy configuration",
            "type": "object",
            "description": "Proxy for the requests. If Reddit blocks a request the actor auto-escalates: none → datacenter → residential. ✅ Residential recommended for large runs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}