{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Posts Scraper ($0.99/1k posts)",
    "description": "Scrape Reddit posts from any subreddit or keyword search: title, body, score, upvote ratio, flair, media, author, and community — as structured JSON. No login or Reddit API key needed.",
    "version": "1.0",
    "x-build-id": "qSH7VoX1QxK7RaeLH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/digispruce~reddit-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-digispruce-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/digispruce~reddit-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-digispruce-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/digispruce~reddit-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-digispruce-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",
        "properties": {
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddit names to scrape, with or without the r/ prefix — e.g. \"python\" or \"r/python\". Names only: to scrape a reddit.com URL you copied from your browser, paste it into Start URLs instead. Join several with a plus — \"python+django\" — to page them as one listing. Each subreddit is scraped as its own source, up to Max posts per subreddit.",
            "items": {
              "type": "string",
              "pattern": "^\\s*$|^\\s*(?:/?[rR]/)?[A-Za-z0-9_]+(?:\\+[A-Za-z0-9_]+)*\\s*$"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Reddit URLs pasted straight from your browser — a subreddit listing such as \"https://www.reddit.com/r/python/new/\", or a search such as \"https://www.reddit.com/r/python/search/?q=asyncio&restrict_sr=1\". The sort in the URL is the one used, so each URL is scraped as its own source; a subreddit URL without a sort is read as Hot, matching reddit.com. Subreddit URLs take Max posts per subreddit, search URLs take Max posts per search term. A link to a single post is not a source: this Actor scrapes a subreddit's posts, not one post's comments.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "hot",
              "new",
              "rising",
              "top_hour",
              "top_day",
              "top_week",
              "top_month",
              "top_year",
              "top_all"
            ],
            "type": "string",
            "description": "Order posts are returned in within each subreddit — the reddit.com tabs. Top carries its own time window, exactly as reddit.com does; the other tabs always span all time.",
            "default": "new"
          },
          "maxPostsPerSubreddit": {
            "title": "Max posts per subreddit",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many posts to scrape from each subreddit. You are charged per post saved, so this is also the cost ceiling for one subreddit. Reddit stops paging a listing at roughly 1,000 posts, often fewer — removed posts count against that limit without being returned — so a higher value simply returns everything available.",
            "default": 10
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords or phrases to search Reddit for, e.g. \"machine learning\". Each term is scraped as its own source, up to Max posts per search term.",
            "items": {
              "type": "string"
            }
          },
          "searchWithinSubreddits": {
            "title": "Search within subreddits",
            "type": "array",
            "description": "Confine the search terms to these communities, with or without the r/ prefix — e.g. \"python\" or \"r/python\". Names only, not reddit.com URLs. Leave empty to search all of Reddit. Each subreddit and term combination is scraped as its own source.",
            "items": {
              "type": "string",
              "pattern": "^\\s*$|^\\s*(?:/?[rR]/)?[A-Za-z0-9_]+(?:\\+[A-Za-z0-9_]+)*\\s*$"
            }
          },
          "searchSort": {
            "title": "Search sort",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "comments"
            ],
            "type": "string",
            "description": "Order search results are returned in. Applies to the search terms only, not to the subreddit listings above.",
            "default": "relevance"
          },
          "searchTime": {
            "title": "Search time window",
            "enum": [
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only return search results posted within this window. Works with every search sort.",
            "default": "all"
          },
          "maxPostsPerSearchTerm": {
            "title": "Max posts per search term",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many posts to scrape for each search term, and the cost ceiling for it. When the search is confined to subreddits, this applies to each subreddit and term combination. Reddit stops paging results at roughly 1,000 posts, often fewer, so a higher value simply returns everything available.",
            "default": 10
          },
          "includeNSFW": {
            "title": "Include NSFW posts",
            "type": "boolean",
            "description": "Keep posts marked NSFW (over 18). Off by default, so they are skipped.",
            "default": false
          },
          "postedAfter": {
            "title": "Posted after",
            "type": "string",
            "description": "Only keep posts from this date onwards. The day you pick is included, counted from 00:00 UTC. A timestamp such as \"2026-01-31T12:00:00Z\" cuts at that exact moment instead; times without a zone are read as UTC."
          },
          "postedBefore": {
            "title": "Posted before",
            "type": "string",
            "description": "Only keep posts up to this date. The day you pick is included in full, so picking the same day here and above scrapes that one day. A timestamp such as \"2026-02-28T12:00:00Z\" cuts at that exact moment instead; times without a zone are read as UTC."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}