{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Subreddits V1 — Info, Browse, Join, Create (12 ops)",
    "description": "Reddit subreddit toolkit — 8 anonymous lookups (info, rules, sidebar, browse, autocomplete, search names, popular feed, post listings) + 4 auth ops (my subreddits, join/leave, post requirements, create new). Use Reddit Vault or paste Token V2 + proxy.",
    "version": "0.8",
    "x-build-id": "CUZaKhA6M33caNZ1h"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/red_crawler~reddit-subreddits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-red_crawler-reddit-subreddits",
        "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/red_crawler~reddit-subreddits/runs": {
      "post": {
        "operationId": "runs-sync-red_crawler-reddit-subreddits",
        "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/red_crawler~reddit-subreddits/run-sync": {
      "post": {
        "operationId": "run-sync-red_crawler-reddit-subreddits",
        "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": [
          "endpoint"
        ],
        "properties": {
          "endpoint": {
            "title": "What to fetch",
            "enum": [
              "subreddit_info",
              "subreddit_rules",
              "subreddit_sidebar",
              "browse_subreddits",
              "autocomplete",
              "popular_posts",
              "search_names",
              "post_listings",
              "my_subreddits",
              "membership",
              "post_requirements",
              "create_subreddit"
            ],
            "type": "string",
            "description": "Choose which kind of subreddit lookup to run.",
            "default": "subreddit_info"
          },
          "info_subreddit": {
            "title": "Subreddit",
            "type": "string",
            "description": "Subreddit name (e.g. AskReddit). Used by: Subreddit Info."
          },
          "rules_subreddit": {
            "title": "Subreddit",
            "type": "string",
            "description": "Subreddit name (e.g. AskReddit). Used by: Subreddit Rules."
          },
          "sidebar_subreddit": {
            "title": "Subreddit",
            "type": "string",
            "description": "Subreddit name (e.g. AskReddit). Used by: Subreddit Sidebar."
          },
          "browse_directory": {
            "title": "Directory",
            "enum": [
              "popular",
              "new",
              "default"
            ],
            "type": "string",
            "description": "Which directory to browse. Used by: Browse Subreddits.",
            "default": "popular"
          },
          "browse_limit": {
            "title": "Limit",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Max subreddits to return (1–100). Used by: Browse Subreddits.",
            "default": 25
          },
          "autocomplete_q": {
            "title": "Query",
            "type": "string",
            "description": "Prefix to match against subreddit names. Used by: Autocomplete."
          },
          "autocomplete_limit": {
            "title": "Limit",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Max suggestions (1–10). Used by: Autocomplete.",
            "default": 10
          },
          "autocomplete_include_over_18": {
            "title": "Include NSFW results",
            "type": "boolean",
            "description": "If on, NSFW (over-18) subreddits are returned in autocomplete results. Default: off.",
            "default": false
          },
          "popular_sort": {
            "title": "Sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "best",
              "controversial"
            ],
            "type": "string",
            "description": "Sort order. Used by: Popular Posts.",
            "default": "hot"
          },
          "popular_time_filter": {
            "title": "Time filter (only for sort = top or controversial)",
            "enum": [
              "",
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window — IGNORED unless sort is 'top' or 'controversial'. Leave as '—' for other sort orders.",
            "default": ""
          },
          "popular_geo_filter": {
            "title": "Location (only for sort = best or hot)",
            "enum": [
              "",
              "GLOBAL",
              "US",
              "GB",
              "CA",
              "AU",
              "DE",
              "FR",
              "ES",
              "IT",
              "JP",
              "IN",
              "BR",
              "MX",
              "PL",
              "NL",
              "SE",
              "NO",
              "FI",
              "DK",
              "IE",
              "NZ",
              "ZA",
              "TR",
              "RU",
              "AR",
              "CL",
              "CO",
              "PE",
              "VE",
              "UA",
              "GR",
              "PT",
              "CH",
              "AT",
              "BE",
              "CZ",
              "HU",
              "RO",
              "IL",
              "AE",
              "SA",
              "EG",
              "NG",
              "KR",
              "TW",
              "TH",
              "MY",
              "SG",
              "PH",
              "ID",
              "VN"
            ],
            "type": "string",
            "description": "Country filter — IGNORED unless sort is 'best' or 'hot'. Leave as '—' for everywhere.",
            "default": ""
          },
          "popular_limit": {
            "title": "Limit",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Max posts (1–100). Used by: Popular Posts.",
            "default": 25
          },
          "search_names_q": {
            "title": "Search query",
            "type": "string",
            "description": "Text to search for in subreddit names. Used by: Search Names."
          },
          "search_names_include_over_18": {
            "title": "Include NSFW results",
            "type": "boolean",
            "description": "If on, NSFW (over-18) subreddits are included in results. Default: off.",
            "default": false
          },
          "post_listings_subreddit": {
            "title": "Subreddit",
            "type": "string",
            "description": "Subreddit name (e.g. AskReddit). Used by: Post Listings."
          },
          "post_listings_sort": {
            "title": "Sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "best",
              "controversial"
            ],
            "type": "string",
            "description": "Sort order. Used by: Post Listings.",
            "default": "hot"
          },
          "post_listings_time_filter": {
            "title": "Time filter (only for sort = top or controversial)",
            "enum": [
              "",
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window — IGNORED unless sort is 'top' or 'controversial'. Leave as '—' for other sort orders.",
            "default": ""
          },
          "post_listings_limit": {
            "title": "Limit",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Max posts (1–1000). Used by: Post Listings.",
            "default": 25
          },
          "my_subreddits_where": {
            "title": "Which list",
            "enum": [
              "subscriber",
              "contributor",
              "moderator",
              "streams"
            ],
            "type": "string",
            "description": "subscriber = communities you've joined; contributor = where you can post; moderator = where you have mod rights. Used by: My Subreddits.",
            "default": "subscriber"
          },
          "my_subreddits_limit": {
            "title": "Limit",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Max items (1–100). Used by: My Subreddits.",
            "default": 25
          },
          "membership_action": {
            "title": "Action",
            "enum": [
              "join",
              "leave"
            ],
            "type": "string",
            "description": "Whether to join or leave the target subreddit. Used by: Membership.",
            "default": "join"
          },
          "membership_subreddit": {
            "title": "Subreddit",
            "type": "string",
            "description": "Subreddit name to join or leave (with or without `r/`). Used by: Membership."
          },
          "post_requirements_subreddit": {
            "title": "Subreddit",
            "type": "string",
            "description": "Subreddit name (e.g. AskReddit). Used by: Post Requirements."
          },
          "create_subreddit_name": {
            "title": "New subreddit name",
            "pattern": "^[A-Za-z0-9_]{3,21}$",
            "type": "string",
            "description": "Name for the new subreddit (no `r/` prefix). Used by: Create Subreddit."
          },
          "credentialSource": {
            "title": "Credential source",
            "enum": [
              "vault",
              "manual"
            ],
            "type": "string",
            "description": "Used by all auth-required endpoints (My Subreddits, Membership, Post Requirements, Create Subreddit). Anonymous endpoints ignore this section. **Use saved account (vault)** loads your stored Token V2 + proxy from the **reddit-vault** actor (auto-refreshed if you saved a Reddit Session) — only the 'Saved account name' field below is used. **Paste Token V2 + proxy** uses the values you paste below — the 'Saved account name' field is ignored.",
            "default": "vault"
          },
          "accountName": {
            "title": "Saved account name (used when source = vault)",
            "pattern": "^[A-Za-z0-9_-]{1,32}$",
            "maxLength": 32,
            "type": "string",
            "description": "The name you used in the **reddit-vault** actor when you stored this account. Your Token V2 + proxy load automatically from the vault. Ignored when 'Credential source' = manual."
          },
          "bearer": {
            "title": "Token V2 (used when source = manual)",
            "type": "string",
            "description": "Your Reddit `token_v2` cookie value (`eyJ...`). Lifetime ~24 h. Encrypted at rest by Apify. Ignored when 'Credential source' = vault."
          },
          "proxy": {
            "title": "Proxy (used when source = manual)",
            "type": "string",
            "description": "Proxy in `ip:port:user:pass` format. MUST be the same IP that originally minted the Token V2. Ignored when 'Credential source' = vault."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}