{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Posts & Search Scraper",
    "description": "Search public Reddit posts by keyword, scrape subreddit feeds, or paste post and search URLs. One deduplicated row per post with title, text, author, community, score, comments, flair, media, timestamps and source lineage. One global limit. No Reddit login or API key.",
    "version": "1.0",
    "x-build-id": "gx5an8TQIgOK7qUWQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/coregent~reddit-posts-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-coregent-reddit-posts-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/coregent~reddit-posts-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-coregent-reddit-posts-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/coregent~reddit-posts-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-coregent-reddit-posts-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": {
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Communities to scrape, one per line: python, r/Python, or https://www.reddit.com/r/python/. A subreddit URL with a sort segment (https://www.reddit.com/r/python/top/?t=week) keeps that sort and time window. r/all and r/popular are aggregate feeds, not communities, and are not supported.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Keywords or Reddit search syntax, one per line — best CRM, \"HubSpot alternative\", subreddit:python asyncio. Each query is a site-wide Reddit search.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Reddit URLs",
            "type": "array",
            "description": "Direct post URLs (any host, redd.it short links, share links, t3_ IDs or bare IDs), subreddit URLs, or Reddit search URLs (https://www.reddit.com/search/?q=vector+database, https://www.reddit.com/r/python/search/?q=asyncio&restrict_sr=1). User profiles belong to the Reddit User Scraper; comment threads to the Reddit Comments Scraper.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results (whole run)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Global ceiling on unique posts delivered by this run, across every subreddit, query and URL. The run stops as soon as this many posts have been saved. Posts beyond it are never fetched and never charged.",
            "default": 500
          },
          "sortBy": {
            "title": "Sort",
            "enum": [
              "new",
              "hot",
              "top",
              "relevance",
              "comments",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "Order in which each source is read — and therefore which posts a limit keeps. 'new' is chronological and the right choice for scheduled runs. 'relevance' and 'comments' are search orderings; 'rising' and 'controversial' exist on subreddit feeds only and are substituted with 'hot' / 'top' where a surface lacks them (the run log says so).",
            "default": "new"
          },
          "timeFilter": {
            "title": "Time window",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Reddit's own time window for 'top', 'relevance' and 'comments' sorts.",
            "default": "all"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Keep only posts created on or after this moment. ISO date (2026-09-01, 2026-09-01T12:00:00Z) or a relative window: 24h, 7d, 2w, 3m, 1y. On a 'new'-sorted source the run stops paging as soon as it reaches older posts, which is what makes scheduled incremental runs cheap."
          },
          "includeNsfw": {
            "title": "Include NSFW posts",
            "type": "boolean",
            "description": "Include posts flagged over-18. Off by default.",
            "default": false
          },
          "minScore": {
            "title": "Minimum score",
            "type": "integer",
            "description": "Keep only posts with at least this score (upvotes minus downvotes)."
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only posts with at least this many comments."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Keep only posts created on or before this moment (ISO date, or a relative window such as 7d)."
          },
          "flairs": {
            "title": "Only these flairs",
            "type": "array",
            "description": "Keep only posts whose flair matches one of these values (case-insensitive). Posts with no flair are dropped; posts whose flair is unknown are kept.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "authors": {
            "title": "Only these authors",
            "type": "array",
            "description": "Keep only posts by these usernames (case-insensitive, with or without u/).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeKeywords": {
            "title": "Title or text must contain",
            "type": "array",
            "description": "Keep only posts whose title or body contains at least one of these terms (case-insensitive substring match).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Title or text must not contain",
            "type": "array",
            "description": "Drop posts whose title or body contains any of these terms.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "postTypes": {
            "title": "Post types",
            "type": "array",
            "description": "Keep only these kinds of post. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "link",
                "image",
                "video",
                "gallery",
                "poll",
                "crosspost"
              ],
              "enumTitles": [
                "Text",
                "Link",
                "Image",
                "Video",
                "Gallery",
                "Poll",
                "Crosspost"
              ]
            },
            "default": []
          },
          "skipPostIds": {
            "title": "Skip these post IDs",
            "type": "array",
            "description": "Post IDs (with or without the t3_ prefix) already collected by an earlier run. They are neither saved nor charged.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "skipUrls": {
            "title": "Skip these post URLs",
            "type": "array",
            "description": "Post URLs already collected by an earlier run, in any form. Neither saved nor charged.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "enrichPostDetails": {
            "title": "Fetch full post details",
            "type": "boolean",
            "description": "Reddit's public listing carries title, author, community, score, comment count and timestamp. Leave this on to add the body text, flair, post type, media, outbound link, upvote ratio and edited/locked/stickied flags to every row, at no extra charge. With it on, the 'rising' and 'controversial' sorts are substituted with 'hot' / 'top'. Switch off for listing fields only.",
            "default": true
          },
          "maxResultsPerSource": {
            "title": "Max results per source",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Fairness cap so one broad subreddit or query cannot fill the whole run. Reddit's public search returns at most ~250 posts per query or subreddit for a given sort and time window; split a source by time window to go deeper.",
            "default": 250
          },
          "maxPagesPerSource": {
            "title": "Max pages per source",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Crawl ceiling per source. A page is 7 posts on Reddit's public search surface.",
            "default": 20
          },
          "maxConcurrency": {
            "title": "Sources in parallel",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many sources to page at once (1–5). Each runs on its own proxy session with its own Reddit rate budget.",
            "default": 3
          },
          "requestDelayMs": {
            "title": "Minimum delay between requests (ms)",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Extra pacing on top of the built-in rate control. Raise it if Reddit starts answering with 429s."
          },
          "debugMode": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Verbose logging of pages, cursors and skips.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Datacenter proxy (the default) or no proxy both work. Apify RESIDENTIAL proxy is refused and fails the run at startup: residential bandwidth is billed to the Actor, while Reddit serves the same search results to datacenter addresses. To route through your own residential provider, use Custom proxy URLs — that traffic goes through your account and is honoured.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}