{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Media Downloader",
    "description": "Download Reddit-hosted images, galleries, GIFs, and video/audio streams from public post URLs. Saves media files to KV and returns clean MCP-ready rows.",
    "version": "0.1",
    "x-build-id": "IRE3azqZgayhjITpj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~reddit-media-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-reddit-media-downloader",
        "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/khadinakbar~reddit-media-downloader/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-reddit-media-downloader",
        "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/khadinakbar~reddit-media-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-reddit-media-downloader",
        "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": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "Reddit post URLs",
            "type": "array",
            "description": "Use this when you have public Reddit post URLs and need downloadable media files or direct media links. Accepts full URLs such as https://www.reddit.com/r/ChatGPT/comments/1iic23b/who_said_ai_videos_cant_do_physics/. Defaults to one sample video post. Not for private, deleted, login-only, or non-Reddit URLs.",
            "items": {
              "type": "string"
            }
          },
          "maxMediaItems": {
            "title": "Max media items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Use this as the hard cap on billable media rows returned across all URLs. Default is 100, range is 1 to 10000, and the actor stops as soon as the cap is reached. At $0.005 per media item, maxMediaItems=100 means about $0.50 maximum PPE spend. Not a per-post limit.",
            "default": 100
          },
          "downloadMedia": {
            "title": "Save media files",
            "type": "boolean",
            "description": "Use this when you want the actor to download media bytes into the default key-value store. True saves images, GIFs, primary video streams, and optionally audio streams, then returns file keys and API URLs. False returns direct source URLs only. Not a video-audio merge option.",
            "default": true
          },
          "downloadAudio": {
            "title": "Save Reddit video audio",
            "type": "boolean",
            "description": "Use this when downloadMedia is true and you want the separate v.redd.it audio stream saved when Reddit exposes one. Reddit often stores video and audio separately, so this creates audioFileKey fields on video records. Defaults to true. Not used for image or gallery posts.",
            "default": true
          },
          "maxFileSizeMb": {
            "title": "Max file size MB",
            "minimum": 1,
            "maximum": 2048,
            "type": "integer",
            "description": "Use this to stop very large files from being saved to key-value store. Default is 250 MB per media or audio file, range is 1 to 2048. Oversized files still produce metadata rows with downloadStatus=skipped_too_large. Not a total run storage cap.",
            "default": 250
          },
          "includeVideoVariants": {
            "title": "Include video manifest links",
            "type": "boolean",
            "description": "Use this when you need DASH and HLS manifest URLs for advanced video processing. Defaults to true and adds dashUrl, hlsUrl, scrubberMediaUrl, and audioUrl when Reddit exposes them. The actor still saves only the primary MP4 and audio stream by default. Not a transcoding feature.",
            "default": true
          },
          "includeNsfw": {
            "title": "Include NSFW posts",
            "type": "boolean",
            "description": "Use this only when you intentionally want media from posts marked NSFW by Reddit. Defaults to false for business, research, and AI-agent workflows. NSFW posts are skipped with a clear summary reason when disabled. Not a content moderation classifier.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Use this to route Reddit metadata and media downloads through Apify Proxy. The default uses residential proxies because Reddit web endpoints can block datacenter networks. Keep the default unless your account has a specific proxy policy. Not required for provider-only fallback metadata.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "redditClientId": {
            "title": "Reddit client ID",
            "type": "string",
            "description": "Optional Reddit app client ID for the official OAuth metadata path. Leave blank to use the owner-managed REDDIT_CLIENT_ID secret when configured. Example format is the app client ID from reddit.com/prefs/apps. Not your Reddit username."
          },
          "redditClientSecret": {
            "title": "Reddit client secret",
            "type": "string",
            "description": "Optional Reddit app client secret paired with redditClientId. Leave blank to use the owner-managed REDDIT_CLIENT_SECRET secret when configured. This lets the actor resolve public post metadata without scraping Reddit HTML. Not your Reddit password."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}