# Best Time to Post: Instagram, TikTok, YouTube & LinkedIn (`cygnix_labs/social-best-time-to-post`) Actor

Find the best time to post on Instagram, TikTok, YouTube and LinkedIn from real post data or your analytics CSV export: weekday x hour heatmap in your time zone, engagement rate, best format, caption and hashtag fit, 7-day posting schedule. $0.03 per account report.

- **URL**: https://apify.com/cygnix_labs/social-best-time-to-post.md
- **Developed by:** [Umair Saleem Mohammad Saleem](https://apify.com/cygnix_labs) (community)
- **Categories:** Social media, Agents, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$30.00 / 1,000 account reports

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Best Time to Post Analyzer: Instagram, TikTok, YouTube, LinkedIn

**Answer first:** this actor finds **the best time to post on Instagram, TikTok, YouTube and LinkedIn** from an account's *own* recent posts, not industry averages. Give it public profiles (yours or competitors') **or paste your analytics CSV export** (Meta Business Suite, TikTok Studio, YouTube Studio, LinkedIn, Facebook, X, any sheet). For every account you get a **weekday × 3-hour heatmap in your time zone**, the **top 3 posting slots and the slot to avoid**, **engagement rate**, the winning **format** (Reels, carousels, Shorts, long-form, documents), **caption length and hashtag fit**, **posting cadence**, top and weakest posts, and a **7-day posting schedule**. **$0.03 per account report.** The first account in a run is free when you analyze 12 posts or fewer.

| Quick facts | |
|---|---|
| Best for | Best time to post on Instagram / TikTok / YouTube / LinkedIn, posting schedule, engagement rate, competitor posting-time benchmark, monthly client reports |
| Input | Instagram usernames, TikTok usernames, YouTube handles/URLs, **or your own data**: pasted CSV/TSV/JSON, CSV or Google Sheets links, Apify dataset IDs |
| Output | One row per account: `bestSlots`, `worstSlot`, `heatmap`, `bestDays`, `formatPerformance`, `medianEngagementRateByFollowersPct`, `medianEngagementRateByViewsPct`, `postsPerWeek`, `topPosts`, `recommendations`, `sevenDayPlan`, `summary` |
| Our price | **$0.03** per completed account report. No start fee. Accounts that can't be analyzed are never charged |
| Data cost | Your own CSV/dataset: **$0**. YouTube: **$0** (public feed). Instagram: about **$0.003** per account for a 12-post quick check, about **$0.054** at 30 posts. TikTok: about **$0.09** at 30 posts. Scrapers run on your account under a hard cap you set |
| Needs | No logins, cookies or API keys |

### How it works

1. **Your own data (cheapest, most accurate for your account).** Paste a CSV export or link one. Columns are matched automatically: publish time / post time / created date / date + time, likes / reactions, comments, shares / reposts, saves, views / plays, impressions, reach, engagements, post type, caption/title, link. Title rows above the header, `Total` rows, `1.2K` numbers, `1.234,5` decimals, semicolon or tab delimiters, BOMs, quoted multi-line captions, Unix timestamps and Excel serial dates are handled. US (MM/DD) vs European (DD/MM) dates are detected from the column; times without a zone are read in **`dataTimezone`** (defaults to your time zone).
2. **Public accounts.** Instagram: the profile scraper returns followers + the 12 latest posts for ~$0.0026, so a 12-post quick check costs almost nothing; for more posts the cheaper **apify/instagram-post-scraper** (basic data, $0.0017/post) is used. TikTok uses **clockworks/tiktok-profile-scraper**. All of them run on your account with `maxTotalChargeUsd` set from **Max scraper spend**, and every run and its cost is listed in `SUMMARY`. YouTube is read from the public channel feed (15 latest uploads, exact publish time, views, likes), with Shorts vs long-form detected.
3. Each post gets a **performance index** = its interactions (likes + comments + shares + saves) ÷ the account's median post. 1.0 = typical, 2.0 = twice as good, so a 20M brand and a 2k café compare fairly. If a file only has views or impressions, those are used. Posts younger than 48 h and pinned posts are left out of timing.
4. Slots are ranked on the median index with shrinkage toward 1.0, so one lucky post can't crown a slot. Best slots must beat your typical post; slots resting on a single post are flagged `lowSample`. Each report has `confidence` high (30+ posts), medium (15+) or low.

### Input examples

Public accounts (competitor benchmark in one run):

```json
{
  "instagramProfiles": ["starbucks", "dunkin"],
  "tiktokProfiles": ["duolingo"],
  "youtubeChannels": ["@mkbhd"],
  "postsPerAccount": 30,
  "timezone": "America/New_York",
  "maxScraperSpendUsd": 1
}
```

Your own export (no scraping, no scraper cost):

```json
{
  "csvText": "Publish time,Post type,Likes,Comments,Shares,Saves,Views,Permalink\n10/14/2026 09:01,IG reel,1203,45,30,88,15400,https://www.instagram.com/reel/...\n...",
  "dataTimezone": "America/Los_Angeles",
  "timezone": "Asia/Riyadh"
}
```

Or `"fileUrls": ["https://docs.google.com/spreadsheets/d/<id>/edit#gid=0"]` (share as *Anyone with the link*), or `"datasetIds": ["<dataset from an Instagram/TikTok/YouTube scraper run>"]`. Time zones accept IANA names (`Europe/London`), offsets (`UTC+3`, `+05:30`), abbreviations (`EST`, `PST`, `IST`) and city names (`Riyadh`).

#### Where to get your export

| Platform | Export | Notes |
|---|---|---|
| Instagram / Facebook | Meta Business Suite → Insights → Content → Export (CSV) | Has `Publish time`, `Post type`, likes, comments, shares, saves, views, reach |
| TikTok | TikTok Studio → Analytics → Content → Download data | Use CSV; `Post time` + likes/comments/shares/views |
| YouTube | YouTube Studio → Analytics → Advanced mode → Export (CSV) | Studio exports often have the publish **date only**, so you get best **days**; add `youtubeChannels` for hour-level timing from the public feed |
| LinkedIn | Page → Analytics → Content → Export | Comes as .xls: open and save as CSV (Excel files are detected and you get a clear message) |
| Anything else | Any sheet with a date/time column + at least one engagement column | Set `dataPlatform` and `dataAccount` if the file has no links/usernames |

### Sample output (real run, 19 Oct 2026, times in America/New_York)

Public sample dataset from run `OpQ9wfdP5ZJ6H7wNj`: [JSON](https://api.apify.com/v2/datasets/jK40C4eew8vMJdB25/items?format=json\&clean=1) · [CSV](https://api.apify.com/v2/datasets/jK40C4eew8vMJdB25/items?format=csv\&clean=1) · [Excel](https://api.apify.com/v2/datasets/jK40C4eew8vMJdB25/items?format=xlsx\&clean=1)

| Account | Posts | Best slots (New York time) | Avoid | Best format | Engagement | Confidence |
|---|---|---|---|---|---|---|
| Instagram @starbucks | 30 | Mon 09-12 (3.38x, 5 posts), Thu 09-12 (3.12x, 2 posts), Tue 12-15 (1.89x, 2 posts) | Wed 09-12 (0.61x) | reel | 3.9% of views | high |
| TikTok @duolingo | 29 | Fri 09-12 (5.18x, 3 posts), Thu 12-15 (2.49x, 4 posts), Wed 09-12 (2.84x, 2 posts) | Wed 12-15 (0.31x) | video <=60s | 0.56% of followers | medium |
| YouTube @mkbhd | 15 | Thu 03-06 (2.36x, 2 posts), Fri 21-24 (1.39x, 1 post), Wed 06-09 (1.32x, 1 post) | – | short | 0.58% of followers | medium |

Instagram and TikTok rows were analyzed from existing scraper datasets (18 Oct 2026 scrapes), so this run spent $0 on scrapers; the Instagram dataset came from a posts-only scrape, so its engagement is shown per view.

```json
{
  "platform": "tiktok",
  "account": "duolingo",
  "status": "ANALYZED",
  "dataSource": "your data",
  "followers": 18300000,
  "postsAnalyzed": 29,
  "periodDays": 27.04,
  "postsPerWeek": 7.51,
  "medianEngagementRateByFollowersPct": 0.56,
  "medianEngagementRateByViewsPct": 14.8,
  "engagementRateBase": "views",
  "confidence": "medium",
  "timeOfDayAvailable": true,
  "bestSlots": [
    {
      "day": "Fri",
      "timeBlock": "09-12",
      "posts": 3,
      "medianIndex": 5.18,
      "score": 3.51
    },
    {
      "day": "Thu",
      "timeBlock": "12-15",
      "posts": 4,
      "medianIndex": 2.49,
      "score": 1.99
    },
    {
      "day": "Wed",
      "timeBlock": "09-12",
      "posts": 2,
      "medianIndex": 2.84,
      "score": 1.92
    }
  ],
  "worstSlot": {
    "day": "Wed",
    "timeBlock": "12-15",
    "posts": 3,
    "medianIndex": 0.31,
    "score": 0.59
  },
  "formatPerformance": [
    {
      "format": "video <=60s",
      "posts": 24,
      "medianIndex": 1.04,
      "score": 1.04
    },
    {
      "format": "slideshow",
      "posts": 4,
      "medianIndex": 0.81,
      "score": 0.87
    },
    {
      "format": "video >60s",
      "posts": 1,
      "medianIndex": 0.05,
      "score": 0.68
    }
  ],
  "recommendations": [
    "Post on Fri 09-12, Thu 12-15, Wed 09-12 (America/New_York): these slots beat your typical post by 5.18x / 2.49x / 2.84x.",
    "Avoid Wed 12-15: 0.31x of median.",
    "video <=60s performs best (1.04x median over 24 posts) vs slideshow (0.81x). Shift the mix toward video <=60s.",
    "short (<70 chars) captions work best (1.03x).",
    "Posts with 0 hashtags perform best (1.03x).",
    "Cadence 7.51x/week. Keep it and move posts into the best slots."
  ],
  "sevenDayPlan": [
    {
      "day": "Mon",
      "timeBlock": "15-18",
      "format": "video <=60s"
    },
    {
      "day": "Tue",
      "timeBlock": "12-15",
      "format": "video <=60s"
    },
    {
      "day": "Wed",
      "timeBlock": "09-12",
      "format": "video <=60s"
    },
    {
      "day": "Thu",
      "timeBlock": "12-15",
      "format": "video <=60s"
    },
    {
      "day": "Fri",
      "timeBlock": "09-12",
      "format": "video <=60s"
    },
    {
      "day": "Sat",
      "timeBlock": "15-18",
      "format": "video <=60s"
    },
    {
      "day": "Sun",
      "timeBlock": "15-18",
      "format": "video <=60s"
    }
  ],
  "summary": "tiktok @duolingo: 29 posts over 27 days, 7.51/week. Best slots (America/New_York): Fri 09-12 (5.18x, 3 posts), Thu 12-15 (2.49x, 4 posts), Wed 09-12 (2.84x, 2 posts). Best format: video <=60s. Median engagement 0.56% of followers. Confidence: medium.",
  "charged": true
}
```

Each row also has `heatmap` (7 days × 8 three-hour blocks), `bestDays`, `bestTimeBlocks`, `captionLengthPerformance`, `hashtagCountPerformance`, `topPosts`/`weakestPosts` with URLs, `timeOfDayAvailable`, `dataSource`, `notes` and `method`. The key-value store has `SUMMARY` (charges, every scraper run and its cost, how each file's columns were read) and a Markdown `REPORT`.

### Pricing and total cost

| What | Price | Billed by |
|---|---|---|
| Account report (this actor) | **$0.03** each; first account free when `postsPerAccount` ≤ 12 | This actor |
| Your CSV / file / dataset | $0 | None |
| YouTube channel | $0 (public feed) | None |
| Instagram, ≤ 12 posts | $0.0026 per account (profile scraper; followers + posts) | apify/instagram-profile-scraper |
| Instagram, more posts | $0.0017 per post + $0.0026 per account for followers | apify/instagram-post-scraper (basic data) |
| TikTok | $0.003 per video | clockworks/tiktok-profile-scraper |

Scraper prices are Apify FREE-plan list prices on 19 Oct 2026 (lower on paid plans).

| Typical job | Scraper cost | Our fee | Total |
|---|---|---|---|
| Your own CSV export, 1 account | $0 | $0.03 | **$0.03** |
| YouTube channel | $0 | $0.03 | **$0.03** |
| Instagram quick check (12 posts), first account | ~$0.003 | free | **~$0.003** |
| Instagram, 30 posts | ~$0.054 (estimate from list prices) | $0.03 | **~$0.084** |
| TikTok, 30 videos (measured 18 Oct: $0.09) | ~$0.09 | $0.03 | **~$0.12** |
| You + 4 competitors on Instagram, 30 posts each | ~$0.27 | $0.15 | **~$0.42** |

Two hard caps: **Max scraper spend** (`maxScraperSpendUsd`) for scraper runs, and Apify's **Max cost per run** for our fee. If your max cost per run covers fewer reports than the accounts you list, the extra accounts are **not scraped at all** (no scraper money spent) and come back as `NOT_ANALYZED` with the reason. If Instagram blocks the scrapers (it happens), the account comes back `NOT_ANALYZED`, our fee is $0 and only the small scraper attempt (~$0.002–0.005) is billed by the scraper.

### How it compares (Apify Store, verified 19 Oct 2026)

| Actor | Price (FREE plan) | Platforms | Your own CSV? |
|---|---|---|---|
| **cygnix_labs/social-best-time-to-post** (this) | **$0.03 / report** + scraper cost ($0 for CSV/YouTube) | Instagram, TikTok, YouTube, LinkedIn/Facebook/X via CSV | **Yes** |
| seemuapps/instagram-active-hours-analyzer | $0.10 / report | Instagram | No |
| seemuapps/youtube-channel-growth-analyzer | $0.02 / channel | YouTube (growth metrics + posting time) | No |
| apricot_blackberry/tiktok-content-optimizer | $0.05 start + $0.01 / result | TikTok | No |
| apt_marble/reddit-subreddit-analytics-best-time-to-post | $0.05 / subreddit + $0.001 / item | Reddit | No |
| seemuapps/tiktok-engagement-rate-calculator | $0.035 / creator | TikTok (engagement rate only) | No |
| zaver.api/instagram-engagement-rate-calculator | $0.0479 / creator | Instagram (engagement rate only) | No |

**Honest take.** For Instagram at 30 posts our all-in cost (~$0.084) is below the $0.10 dedicated Instagram best-time report, and a 12-post quick check is nearly free. For YouTube a pure growth analyzer is $0.01 cheaper per channel. TikTok at 30 videos (~$0.12) is close to rivals because the TikTok scraper is the main cost; use `postsPerAccount: 12` (~$0.036) or your TikTok Studio export ($0.03) to cut it. Off Apify, scheduling suites (Later, Buffer, Sprout and others) show best times only for accounts you connect, on a monthly plan; this actor works on competitors and on any export, pay per use.

### For AI agents / MCP

**When to call it:** the user asks *when should I post* on Instagram, TikTok, YouTube or LinkedIn, wants a posting schedule, an engagement rate, a content performance report, or a competitor's posting pattern; or the user has an analytics export file and asks what it says about timing.

Connect the Apify MCP server with only this actor (Claude, ChatGPT, Cursor, VS Code, Codex, any MCP client):

```
https://mcp.apify.com?tools=cygnix_labs/social-best-time-to-post
```

Or with the default server, `search-actors` for `best time to post`, `instagram best time to post`, `tiktok posting schedule`.

Example `call-actor` input when the user pasted or attached an export: put the file text in `csvText` (or a link in `fileUrls`), set `timezone` to the user's zone and `dataTimezone` to the export's zone if known. For public accounts:

```json
{ "instagramProfiles": ["ourcafe", "bluebottle"], "timezone": "America/New_York", "postsPerAccount": 12 }
```

**Read the result:** keep rows with `status == "ANALYZED"`. `summary` is a quotable one-liner, `bestSlots[]` has `day`, `timeBlock` (null when the data had dates only), `posts`, `medianIndex`, `lowSample`; `sevenDayPlan[]` is ready for a calendar. `NOT_ANALYZED` rows have a plain-English `reason` and `charged: false`. **Cost control:** tell the user the estimate first (table above), pass `maxTotalChargeUsd` in call options to cap our fee and `maxScraperSpendUsd` to cap scraping. Pay-per-event with limited permissions, so it suits autonomous agents and Apify agentic payments.

Example prompt: *"Here is my TikTok Studio export. When should I post next week in Riyadh time, and which format should I make more of?"*

### FAQ

**What is the best time to post on Instagram / TikTok / LinkedIn?** It depends on your audience, which is why this actor measures it per account. Generic charts average millions of accounts; your own posts (and your competitors') show when *your* audience responds. Run it on your account and 2–4 competitors to see both.

**Can I analyze my own analytics export instead of scraping?** Yes, and it's the cheapest and most accurate route for your own account (your export has saves, shares, reach and impressions that public scrapers can't see). Paste it in `csvText` or link it in `fileUrls`.

**My file has dates but no times.** You get the best **weekdays** (`timeOfDayAvailable: false`, `timeBlock: null`), never invented hours. Add a time column, or for YouTube add the channel in `youtubeChannels` for exact upload times.

**Which time zone are my file's times in?** Times with `Z`/`+03:00` and Unix timestamps are exact. Times without a zone are read in `dataTimezone` (default: your `timezone`). Exports differ by platform and settings, so if you're unsure, set `dataTimezone` to the zone your analytics dashboard shows.

**How many posts do I need?** 30+ for high confidence, 15–29 medium. At least 3 usable posts are required; fewer is `NOT_ANALYZED` and free.

**Do I need to log in?** No. Public profiles only, no cookies or keys. Private or missing accounts return `NOT_ANALYZED` and aren't charged.

**Why are Instagram and TikTok fetched by other actors?** They block logged-out scraping from datacenter IPs; the official and leading scrapers maintain proxies full-time. Calling them with a hard cap keeps this actor reliable and transparent: each run and its cost is in your Console and in `SUMMARY`.

**What counts as engagement?** Likes + comments + shares + saves (reposts count as shares). Engagement rate is shown per follower (when followers are known) and per view/impression/reach (`engagementRateBase`).

**I left the example "natgeo" in the form and added my CSV.** When you supply your own data, the pre-filled example is ignored, so you're not billed for it.

### Changelog

- **0.1.6–0.1.9** (2026-10-19): CSV/TSV/JSON export input (`csvText`, `fileUrls` incl. Google Sheets/Drive/Dropbox links) for Instagram, TikTok, YouTube, LinkedIn, Facebook, X and any sheet; date-only exports give weekday results instead of fake hours; time zones accept offsets, abbreviations and city names (unknown zones are reported); Instagram quick checks use only the profile scraper (~$0.003 instead of ~$0.035) and longer pulls use the cheaper post scraper; max-cost-per-run is checked **before** scraping; accounts with all-zero engagement or under 3 posts are free; best slots must beat your typical post (`lowSample` flag); scheme-less URLs (`instagram.com/x`, `youtube.com/@x`) and @handles work; the free quick check now analyzes at most 12 posts for every source.
- **0.1** (2026-10-18): First release.

### More tools by Cygnix Labs

- [Hashtag Research & Generator: Instagram + TikTok Sets](https://apify.com/cygnix_labs/hashtag-research-strategy)
- [Website SEO Audit + AEO/GEO Checker](https://apify.com/cygnix_labs/site-seo-aeo-audit)
- [Keyword Clustering + Content Briefs](https://apify.com/cygnix_labs/keyword-clusterer-brief)

Questions or a feature request? Open an issue on this actor's Issues tab. We answer within 24 hours.

# Actor input Schema

## `instagramProfiles` (type: `array`):

Public Instagram usernames or profile URLs (yours or competitors'). Example: natgeo, @natgeo or instagram.com/natgeo. 12 posts or fewer use only the profile scraper (about $0.0026 per account).

## `tiktokProfiles` (type: `array`):

Public TikTok usernames or profile URLs. Example: khaby.lame or tiktok.com/@khaby.lame

## `youtubeChannels` (type: `array`):

YouTube handles or channel URLs. Example: @mkbhd or youtube.com/channel/UC... YouTube uses the free public channel feed (15 most recent uploads), so it adds no scraper cost.

## `postsPerAccount` (type: `integer`):

Most recent posts to analyze per account. Scraping is capped at 100 (YouTube feed: 15); your own exports can use up to 500. 12 or less = quick check: the first account in the run is free.

## `timezone` (type: `string`):

Posting times are reported in this zone. IANA names (America/New_York, Europe/London, Asia/Riyadh, Asia/Kolkata), offsets (UTC+3, GMT-5, +05:30), abbreviations (EST, PST, IST) and city names (Riyadh, New York) all work.

## `maxScraperSpendUsd` (type: `number`):

Hard cap for the Instagram/TikTok scraper runs this actor starts on your account (billed by those scrapers, separate from our report fee). The log shows the estimate before anything runs.

## `includeFollowers` (type: `boolean`):

Adds one profile lookup per Instagram account (about $0.0026 each) so engagement rate by followers can be computed. Always on for quick checks (12 posts or fewer), because that lookup also returns the posts.

## `csvText` (type: `string`):

Paste a CSV/TSV export from Instagram (Meta Business Suite), TikTok Studio, YouTube Studio, LinkedIn page analytics, Facebook, X or any sheet with a date/time column plus likes, comments, shares, saves, views, impressions or engagements. Headers are matched automatically; extra title rows and Total rows are skipped. JSON arrays also work.

## `fileUrls` (type: `array`):

Public links to CSV, TSV or JSON files. Google Sheets (shared as 'Anyone with the link'), Google Drive and Dropbox share links are converted to downloads automatically. Excel files: save as CSV first.

## `dataPlatform` (type: `string`):

Used for your CSV/JSON rows when the file has no post links to detect it from.

## `dataAccount` (type: `string`):

Label for your rows when the file has no username/account column. Example: mybrand

## `dataTimezone` (type: `string`):

Only for times without a zone (like 10/18/2026 14:05). Defaults to 'Your time zone'. Times with Z or +03:00 and Unix timestamps are always exact.

## `datasetIds` (type: `array`):

Datasets from apify/instagram-scraper, instagram-post-scraper, instagram-profile-scraper, clockworks/tiktok-profile-scraper / tiktok-scraper or streamers/youtube-scraper runs, or any dataset with a date column and engagement columns. No new scraping, no scraper cost.

## `items` (type: `array`):

Post objects (scraper output or your own rows such as {"date":"2026-10-18 14:05","likes":120,"comments":8}). For API and AI-agent use.

## Actor input object example

```json
{
  "instagramProfiles": [
    "natgeo"
  ],
  "postsPerAccount": 30,
  "timezone": "UTC",
  "maxScraperSpendUsd": 1,
  "includeFollowers": true,
  "dataPlatform": "auto"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `report` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "instagramProfiles": [
        "natgeo"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("cygnix_labs/social-best-time-to-post").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "instagramProfiles": ["natgeo"] }

# Run the Actor and wait for it to finish
run = client.actor("cygnix_labs/social-best-time-to-post").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "instagramProfiles": [
    "natgeo"
  ]
}' |
apify call cygnix_labs/social-best-time-to-post --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cygnix_labs/social-best-time-to-post"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/6yGHROqw3tT9yfnMo/builds/XMWEMse7oa3RQxAap/openapi.json
