I Built a TikTok Analytics Agent That Tells Me Exactly What Content to Make Next
Most B2B SaaS marketers treat TikTok like a guessing game. Post something, check the views, feel good or feel bad, then guess again. There is no system. No pattern recognition. No feedback loop that tells you why one video hit 50,000 views and another one died at 200.
I was doing the same thing. I was posting consistently, building an audience, getting traction. But I had no idea which variables were actually driving performance. Was it the topic? The hook style? The duration? The time I posted? I had opinions. I did not have data.
So I built an AI agent that scrapes my TikTok data, categorizes every video by topic and hook style, surfaces the performance patterns, and tells me exactly what to make next. Then it generates an interactive dashboard where I can explore the data myself.
What the TikTok analytics agent does
This is not a vanity metrics dashboard. It is a performance intelligence system built with Claude Code and Python that turns your raw TikTok data into a content strategy.
Step 1: Scrape your data. The agent pulls every public video from any TikTok profile using the Apify API. Views, likes, comments, shares, saves, duration, posting time. Everything the platform makes available. It assigns each video a performance tier: viral (10K+ views), strong (5K to 10K), average (1K to 5K), or low (under 1K).
Step 2: Categorize every video. This is the part that would take a human analyst hours. The agent categorizes each video into one of 13 content categories:
- Product demo or feature walkthrough
- Industry hot take or opinion
- How-to or tutorial
- Behind the scenes or day in the life
- Customer story or case study
- Trend, meme, or pop culture reference
- Q&A or audience response
- Announcement or launch
- Pain point or problem agitation
- Results, proof, or data
- Culture, team, or hiring
- Educational or thought leadership
- Collaboration, duet, or stitch
Then it assigns one of 12 hook styles to each video. Bold claim. Question. Pattern interrupt. Story open. Stat lead. Direct address. Controversial take. How-to promise. Before and after. Trend ride. Problem statement. Social proof.
Every video now has a category, a hook style, a performance tier, and all its engagement metrics attached.
Step 3: Find the patterns. This is where the agent earns its keep. It generates a full performance report that answers the questions every content creator actually cares about:
- Which content categories get the most views? Not which ones you post the most. Which ones actually perform.
- Which hook styles drive the highest engagement? Maybe bold claims get views but questions get comments. Now you know.
- What is the duration sweet spot? The agent breaks videos into six duration buckets and shows you exactly where performance peaks and drops off.
- When should you post? Performance by day of week and time of day, based on your actual data. Not generic "best times to post" advice from a blog post written in 2023.
- What is the winners formula? The specific combination of content category, hook style, duration, and posting time that produces your best results. This is the money insight. It tells you exactly what to replicate.
- What should you stop doing? Three to five underperforming patterns that are dragging down your average. Most creators keep making content that does not work because they never look at the data this way.
Step 4: The interactive dashboard. The agent generates a dark-mode HTML dashboard that you can open in any browser. Drag in your data file and explore it yourself. Filter by category, sort by engagement, compare hook styles. It is a local tool that runs on your machine with no backend required.
The report finishes with a two-week content calendar that mixes your proven winning formula with strategic tests to expand what works.
What I learned from running it on my own account
I had assumptions about what was working. Some of them were right. Most of them were wrong.
I thought my hot takes were my best content. The data showed that my educational and tactical content actually drove more engagement per view. The hot takes got more initial views but fewer saves and shares. The educational content had a longer tail.
I thought posting in the morning was better. The data showed my best-performing videos were posted between 6 PM and 9 PM. That one change in posting time improved my average views by over 30%.
I thought shorter was always better. The data showed a sweet spot between 45 and 60 seconds. Videos under 30 seconds got views but low engagement. Videos over 90 seconds underperformed across the board. But that 45 to 60 second window was where the algorithm and the audience both showed up.
None of these insights are universal. They are specific to my account, my audience, and my content style. That is the whole point. Generic TikTok advice is useless. Your data tells you what works for you.
Why this matters for B2B SaaS marketing teams
Short-form video is not optional anymore for B2B companies. Your buyers are on TikTok. Your competitors are starting to show up there. The companies that figure out their formula first will own the attention in their category.
But most B2B marketing teams are treating TikTok like they treated blogging in 2015. Post and pray. No measurement framework. No pattern recognition. No systematic approach to finding what works and doubling down on it.
This agent gives you the measurement framework. Run it monthly. Track how your patterns shift. Build a data-driven content strategy instead of guessing.
Try it yourself
The TikTok analytics agent is available in the public repo at github.com/Laura-Beaulieu/growthloops-claude-skills. You will need a free Apify API token and Python installed. The setup takes about five minutes.
Run /tiktok-analytics @yourhandle and let the data tell you what to make next.
Where it fits in the system
Once you know what content performs, the rest of the marketing operating system kicks in. Feed your winning topics into the content repurposing engine and multiply them across LinkedIn, email, and blog. Use the competitive ads agent to see if competitors are running paid behind similar topics. Run the strategy audit to make sure your short-form content maps back to your positioning and revenue goals.
Every agent in the system makes the others more effective. That is the compounding advantage of building a marketing operating system instead of collecting disconnected tools.