{
  "openapi": "3.0.1",
  "info": {
    "title": "Best Time to Post: Instagram, TikTok & YouTube Analyzer",
    "description": "Ranks the best weekday and hour to post for each Instagram, TikTok, YouTube, X or Facebook account from post scraper rows, a CSV or a Sheet, in your time zone, with a heatmap. No scraping or login. Charged per account analysed. Agent-ready: MCP, x402.",
    "version": "0.1",
    "x-build-id": "096NFhUy6aLolZBs7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nerolabs~best-time-to-post/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nerolabs-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/nerolabs~best-time-to-post/runs": {
      "post": {
        "operationId": "runs-sync-nerolabs-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/nerolabs~best-time-to-post/run-sync": {
      "post": {
        "operationId": "run-sync-nerolabs-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",
        "properties": {
          "datasetIds": {
            "title": "Datasets",
            "type": "array",
            "description": "One or more post scraper datasets: Instagram post, reel or profile scrapers (apify/instagram-scraper and look-alikes), TikTok scrapers (clockworks/tiktok-scraper), YouTube scrapers (streamers/youtube-scraper), X (Twitter) scrapers (apidojo/tweet-scraper) or Facebook page post scrapers (apify/facebook-posts-scraper). Your own account or rivals'. Scrape 50 to 100 posts per account. In a scraper's Integrations tab, set this to {{resource.defaultDatasetId}}."
          },
          "fileUrl": {
            "title": "File or Google Sheet URL",
            "type": "string",
            "description": "A public link to a CSV, Excel, JSON or JSON Lines file: scraper rows, or your own sheet with an account (username) and a post date and time column, plus likes, comments, shares, saves or views. Google Sheets share links work (set 'Anyone with the link can view')."
          },
          "fileFormat": {
            "title": "File format",
            "enum": [
              "auto",
              "csv",
              "tsv",
              "json",
              "jsonl",
              "xlsx"
            ],
            "type": "string",
            "description": "Leave on 'Detect automatically' unless the link has no file extension.",
            "default": "auto"
          },
          "sheetName": {
            "title": "Excel sheet name",
            "type": "string",
            "description": "Which sheet to read from an Excel workbook. Defaults to the first sheet."
          },
          "data": {
            "title": "Post rows",
            "type": "array",
            "description": "Rows as JSON objects, for a quick run or an AI agent call, e.g. [{\"account\": \"...\", \"platform\": \"instagram\", \"date\": \"2026-10-20T18:30:00Z\", \"likes\": 900, \"comments\": 40}]. Dates need a clock time (with Z or an offset) to rank hours; a bare date counts for the weekday only."
          },
          "timeZone": {
            "title": "Time zone",
            "type": "string",
            "description": "The time zone the best times are given in, as a name: America/New_York, America/Los_Angeles, Europe/London, Europe/Madrid, Asia/Tokyo, Australia/Sydney. Use your audience's time zone. Default UTC.",
            "default": "UTC"
          },
          "blockHours": {
            "title": "Hour block size",
            "minimum": 1,
            "maximum": 6,
            "type": "integer",
            "description": "How many hours each slot covers: 1, 2, 3, 4 or 6. Wider blocks need fewer posts per slot. 3 suits 50 to 100 posts per account.",
            "default": 3
          },
          "metric": {
            "title": "Rank posts by",
            "enum": [
              "engagement",
              "views",
              "likes",
              "comments",
              "engagement_rate"
            ],
            "type": "string",
            "description": "Which result a good post is judged on. Engagement = likes + comments + shares + saves (works for photos, videos and text posts). Views suits TikTok, Reels and YouTube. Engagement rate = engagement per view (or per follower when there are no views).",
            "default": "engagement"
          },
          "minPostsPerSlot": {
            "title": "Posts needed per slot",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "A weekday and hour slot (and a day or hour block on its own) is only ranked when it holds at least this many posts. Higher is safer, lower finds more slots.",
            "default": 3
          },
          "minPostsPerAccount": {
            "title": "Posts needed per account",
            "minimum": 5,
            "maximum": 1000,
            "type": "integer",
            "description": "Accounts with fewer dated posts with results are written with the reason and not charged (minimum 5).",
            "default": 10
          },
          "lookbackDays": {
            "title": "Only posts from the last (days)",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Use only posts from this many days, so old habits do not count. 0 = every post given.",
            "default": 0
          },
          "excludePinned": {
            "title": "Leave pinned posts out",
            "type": "boolean",
            "description": "Pinned posts are usually old hits kept on top of the profile; leaving them out keeps the account's normal honest.",
            "default": true
          },
          "groupBy": {
            "title": "Group posts by",
            "enum": [
              "auto",
              "owner"
            ],
            "type": "string",
            "description": "'The profile that was scraped' puts collab posts that appear on a profile with that profile (what you asked the scraper for). 'The account that posted it' groups by the real owner instead.",
            "default": "auto"
          },
          "includeCombined": {
            "title": "Add an all-accounts row",
            "type": "boolean",
            "description": "When 2 or more accounts are analysed, add one free row pooling them (each post still measured against its own account's normal): the best times for a niche, a client roster or a set of rivals.",
            "default": true
          },
          "exportFormats": {
            "title": "Also save as a file",
            "type": "array",
            "description": "Also save the results as CSV or Excel in the run's key-value store (charged once per file).",
            "items": {
              "type": "string",
              "enum": [
                "csv",
                "xlsx"
              ],
              "enumTitles": [
                "CSV",
                "Excel (xlsx)"
              ]
            }
          },
          "outputDatasetName": {
            "title": "Also append to a named dataset",
            "type": "string",
            "description": "Name of a dataset to append the results to, to track how an account's best times change month by month."
          },
          "maxItems": {
            "title": "Max input rows",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Stop reading after this many input rows.",
            "default": 200000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}