{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Subreddit Analytics & Best Time to Post",
    "description": "Analyse any public subreddit in one row: members, real posts per day, median and top-10% engagement, self-post vs link winners, top flairs, domains and authors — plus the best day and hour to post, in your timezone. Qualify a community and time your launch before you write a single word.",
    "version": "0.0",
    "x-build-id": "ZmKeZpRjAfRWULxcQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/apt_marble~reddit-subreddit-analytics-best-time-to-post/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-apt_marble-reddit-subreddit-analytics-best-time-to-post",
        "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/apt_marble~reddit-subreddit-analytics-best-time-to-post/runs": {
      "post": {
        "operationId": "runs-sync-apt_marble-reddit-subreddit-analytics-best-time-to-post",
        "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/apt_marble~reddit-subreddit-analytics-best-time-to-post/run-sync": {
      "post": {
        "operationId": "run-sync-apt_marble-reddit-subreddit-analytics-best-time-to-post",
        "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": [
          "subreddits"
        ],
        "properties": {
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Communities to analyse. Paste them however you like: `python`, `r/python` or a full link such as https://www.reddit.com/r/python/. One report is produced per community.",
            "default": [
              "python"
            ],
            "items": {
              "type": "string"
            }
          },
          "sampleSize": {
            "title": "Posts to analyse per subreddit",
            "minimum": 10,
            "maximum": 1000,
            "type": "integer",
            "description": "How many posts to read before computing the report. More posts means steadier averages and a fuller best-time matrix; 250 is a good balance, 1000 is the maximum Reddit will return for one listing.",
            "default": 50
          },
          "sampleSort": {
            "title": "Which posts to sample",
            "enum": [
              "new",
              "top",
              "hot"
            ],
            "type": "string",
            "description": "`Newest` gives an unbiased picture of everyday posting and the most reliable best-time advice. `Top` samples the highest-scoring posts, which is better for studying what wins. `Hot` samples what is currently getting traction.",
            "default": "new"
          },
          "time": {
            "title": "Time range for top posts",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Only used when sampling top posts — how far back the ranking should look.",
            "default": "year"
          },
          "timezoneOffset": {
            "title": "Your timezone (hours from UTC)",
            "minimum": -12,
            "maximum": 14,
            "type": "integer",
            "description": "The best-time-to-post report is expressed in this timezone. Use 0 for UTC/London winter time, -5 for New York, -8 for Los Angeles, 1 for Berlin, 5 for Karachi, 8 for Singapore.",
            "default": 0
          },
          "topAuthorsLimit": {
            "title": "Top authors to list",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "How many authors to include in the two leaderboards (most posts, and most upvotes earned). Set to 0 to leave authors out.",
            "default": 20
          },
          "topFlairsLimit": {
            "title": "Top flairs and domains to list",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "How many post flairs to include — the same limit also caps the list of most-shared link domains. Set to 0 to leave both out.",
            "default": 15
          },
          "includeSamplePosts": {
            "title": "Also output the analysed posts",
            "type": "boolean",
            "description": "Adds every post used in the calculation to the dataset alongside the report, so you can check the maths or reuse the raw posts. This multiplies the number of result rows.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Communities analysed in parallel",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many subreddits to work on at the same time. Higher is faster for long lists; lower is gentler and steadier.",
            "default": 5
          },
          "country": {
            "title": "Browse from",
            "enum": [
              "us",
              "gb",
              "ca",
              "au",
              "de",
              "fr",
              "es",
              "it",
              "nl",
              "ie",
              "in",
              "sg",
              "br",
              "jp",
              "pl",
              "se",
              "mx"
            ],
            "type": "string",
            "description": "Which country's view of Reddit to use. Reddit content is the same almost everywhere, so the default suits nearly every run.",
            "default": "us"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}