← Back to all free guides

I Built an AI Agent
to Grow My Social Media

An actual agent that scrapes top creators overnight, analyzes my own videos, tracks what’s working and sends me content ideas every morning with hooks, formats and confidence scores. Here’s the full technical breakdown.

I named my agent Chloe and gave her one job: help me grow on social media. I built her in my first months of posting, and I’ve since grown from zero to 300,000 followers in six months. Here’s what she ran every day without me touching anything.

  1. Overnight she scraped top creators in my niche on Instagram and TikTok, pulled the day’s AI news, and pulled my own video stats.
  2. Each new video got transcribed so she could study my hooks, and every thumbnail got a score.
  3. At 7:30 AM I woke up to a Telegram message with 3 to 5 ideas, each with a hook, a format and a confidence score. If a carousel fit best, she built every slide.
  4. On Sundays she sent a report on what worked, what flopped and what to change.

Heads Up

This is a technical build. You need a Linux server, OpenClaw, API keys for Apify, Anthropic and OpenAI, and a Telegram account. Never set up a server? It’s doable, with a learning curve.

The Stack And What It Costs

01

OpenClaw

The open-source agent framework where the agent lives. It handles identity, memory, skills and scheduled jobs. It runs on Claude through an Anthropic API key (pay per use), not your Claude subscription login. (OpenClaw install docs)

02

A server that never sleeps

I used an AWS EC2 instance running Ubuntu. A small one runs roughly $8 to $15 a month, and new AWS accounts get up to $200 in credits on the free plan. (AWS free plan) DigitalOcean or any Ubuntu VPS works too.

03

Apify

Pre-built scrapers that pull public post data like views, likes, captions and timestamps. I used apify/instagram-profile-scraper and clockworks/free-tiktok-scraper. The free plan includes $5 of usage a month, and Starter is $19. (Apify pricing)

04

Transcription

I used OpenAI Whisper at $0.006 a minute. Whisper retires from the API on February 26, 2027, and OpenAI names gpt-transcribe as the replacement, so start a new build there. (OpenAI deprecations)

05

Thumbnail scoring

I used GPT-4o Vision to score thumbnails on scroll-stopping power, text overlay, energy and composition. The GPT-4o API snapshots shut down January 14, 2027. For a new build, let Claude score them, since it reads images and you already pay for it.

06

Telegram

Free. It’s how the agent talks to you, and you can message it back anytime.

Ballpark Total

Server $8 to $15, Apify $0 to $19, transcription a few dollars, plus Claude API usage for the daily ideas and weekly report. Most months land around $15 to $40, depending on how much you post and scrape.

Set Up The Server And Agent

01

Launch the server

In AWS, go to EC2, then Launch instance. Pick Ubuntu Server 24.04 LTS and a small instance like t3.small. Create a key pair and save the .pem file. Allow SSH (port 22) from your IP only, then launch and note the public IP.

ssh -i your-key.pem ubuntu@YOUR-SERVER-IP

02

Install OpenClaw

On the server, run the official installer. It installs Node if needed and walks you through onboarding, including adding your Anthropic API key.

curl -fsSL https://openclaw.ai/install.sh | bash

03

Connect Telegram

In Telegram, message @BotFather, send /newbot, name it and copy the bot token. Add the token to OpenClaw’s Telegram channel settings, then DM your bot and approve the pairing. (Telegram setup)

04

Keep keys out of the agent’s files

Your Apify token (in Apify under Settings, then API & Integrations) and your OpenAI key go in environment variables on the server. OpenClaw’s docs say never to store keys in the workspace files. (Workspace docs)

Build The Data Pipeline

Three scripts run every night before the agent wakes up. They’re plain bash and Python, so they cost nothing in AI tokens.

01

Pull the data

Calls Apify for your latest posts, capped at 30 per platform to keep costs near zero, and saves the raw JSON with the date in the filename.

02

Update the tracker

One master JSON file holds every video plus a daily snapshot of its views, likes, comments, shares and saves. This is the secret. Total views can’t tell you if a video is still growing. A video that gained 3,000 of its 5,000 views in the last 3 days needs a different next move than one that peaked in hour one.

03

Analyze new videos

For each video not analyzed yet, it transcribes the audio, saves the first 5 seconds as the hook, scores the thumbnail and marks it done so nothing gets paid for twice.

Don’t write these by hand. Paste this into Claude Code or a Claude chat and it builds all three with you.

Build My Pipeline Scripts
You are a senior engineer helping me build the data pipeline for a social media research agent that runs on an Ubuntu server under OpenClaw. I am not a developer, so explain each step in plain English and give me complete files, never fragments. WHAT TO BUILD (3 scripts): 1. pull-social-data.sh: calls the Apify API with my APIFY_API_TOKEN (read from an environment variable, never hardcoded). Use the actor apify/instagram-profile-scraper for Instagram @[HANDLE] and clockworks/free-tiktok-scraper for TikTok @[HANDLE]. Hard limit of 30 posts per platform. Save the raw JSON to data/raw/ with the date in the filename. Then run update-tracker.py. 2. update-tracker.py: parses both platforms' JSON (their formats differ) into one file, data/content-tracker.json. One entry per video: id, platform, url, posted date, caption, hook, thumbnail scores, analyzed flag, and an array of daily snapshots (date, views, likes, comments, shares, saves). Append a snapshot each run. Never overwrite history. 3. analyze-new-videos.sh: for each video where analyzed is false, transcribe the audio with [TRANSCRIPTION MODEL, e.g. OpenAI gpt-transcribe] and save it to data/transcripts/[id].json, save the first 5 seconds of speech as the hook, score the thumbnail 1-10 on scroll-stopping power, text overlay, energy, composition and overall impact using [VISION MODEL, e.g. Claude], save to data/vision/[id].json, then set analyzed to true. STEPS: 1. Ask me for my handles and which models I have keys for before writing code. 2. Write each file in full with comments. 3. Give me the exact commands to install anything needed, make the scripts executable and test each one by hand. 4. Show me how to schedule them daily with OpenClaw's scheduler (openclaw automations create, also available as openclaw cron create) at 7:00 AM in my timezone, and the 7:30 AM agent turn that reads the data. GUARDRAILS: - Keys come from environment variables only. Add a .gitignore for anything secret. - Delete downloaded video files after transcription. - If an API call fails, log it and keep going. Never crash the whole run over one video. - Only scrape public data, and stay within each platform's and Apify's terms.
Schedule The Jobs

Use OpenClaw’s own scheduler (openclaw automations create, or the older alias openclaw cron create), not the system crontab. (Cron docs)

01

7:00 AM data pull

Runs the three scripts back to back. No agent tokens.

02

7:30 AM content ideas

An agent turn. It reads the fresh data and today’s news, skips anything it pitched in the last 7 days and sends you 3 to 5 ideas on Telegram.

03

Sunday 8:00 AM report

An agent turn that reads every video, looks for patterns in what you posted and when, and updates a content playbook file. After three months, that file is a manual for what works on your account specifically.

Give It Its Instructions

An OpenClaw agent is a folder of markdown files. AGENTS.md holds the operating instructions, SOUL.md the personality (I made Chloe direct, data-driven and a little sassy), USER.md who you are and who your audience is, IDENTITY.md its name and vibe, and MEMORY.md the long-term lessons. (Workspace docs)

Here’s my AGENTS.md as a starter. Swap in your handles, niche, news sources and audience.

Template: AGENTS.md
AGENT NAME: [YOUR AGENT NAME, e.g. "Chloe"] ROLE: Social Media Content Strategist OWNER: [YOUR NAME] PLATFORMS: Instagram (@[YOUR HANDLE]) and TikTok (@[YOUR HANDLE]) === YOUR JOB === You are [OWNER]'s social media strategist. Your one job is to help them grow by: 1. Researching what's working in their niche right now 2. Analyzing their own content performance with real data 3. Generating content ideas that are backed by data, not guesses 4. Tracking what works over time and compounding that knowledge === DATA SOURCES (updated daily by scripts) === Content Tracker: data/content-tracker.json - Every video with daily snapshots (views, likes, comments, shares, saves) - Hook text pulled from the transcript - Thumbnail scores Transcripts: data/transcripts/[video_id].json (timestamped) Thumbnail scores: data/vision/[video_id].json (scroll-stopping, text overlay, energy, composition, overall, 1-10) Content Playbook: knowledge/content-playbook.md (updated every Sunday) === SCHEDULE === DAILY 7:00 AM: data scripts run (pull-social-data.sh, then analyze-new-videos.sh). No agent tokens. DAILY 7:30 AM: content ideas 1. Check memory. Do not repeat ideas from the past 7 days. 2. Scan today's news in my niche from: [LIST YOUR SOURCES, e.g. Anthropic, OpenAI and Google blogs, TechCrunch, The Verge, r/ClaudeAI] 3. Review the latest performance data. 4. Write 3 to 5 ideas. For each: - The idea: one clear sentence - The hook: the exact first line (first 3 to 5 seconds) - Why it matters to my audience - Format: talking head / tutorial / carousel / reaction / story time - Confidence: low / medium / high, with the data point behind it 5. Send them to [OWNER] on Telegram. SUNDAY 8:00 AM: weekly report 1. Read all video data. 2. Top 3 and bottom 3 videos (by views, saves and growth curve) and why. 3. Patterns in hooks, formats, topics, posting times and thumbnail scores. 4. Update knowledge/content-playbook.md with what you learned. 5. Send the report on Telegram. === IDEA RULES === - Every idea must pass the test: would [OWNER]'s audience actually care? - My audience: [DESCRIBE THEM, e.g. "beginners, non-technical, 9-5 workers curious about AI but overwhelmed"] - Hooks must be specific. Not "AI is changing everything." More like "This free AI tool just replaced my $200/month subscription." - Mix timely ideas (ride the wave) with evergreen ideas (keep growing). - If a carousel fits best, build it: slide-by-slide outline, caption and design direction. - Never include a link, stat or tool without checking it exists today. === COST CONTROLS === - Scraper: max 30 posts per platform per pull (enforced in the script) - Transcription and thumbnail scoring: only for videos where analyzed is false - Only the daily ideas and the weekly report use agent tokens === HOW TO TALK TO ME === - Telegram messages that are short and scannable. Split long ones. - Never show me file paths, JSON or raw data. - Talk like a person: "Your video about [topic] is still growing. It gained 2,000 views in the last 3 days." - If a video is taking off or big news breaks, message me right away. - End daily ideas with: "Want me to expand one, write a script, or dig into something?" === MEMORY === Daily notes in memory/YYYY-MM-DD.md: ideas sent, my reactions, new data, decisions, trends. Long-term lessons in MEMORY.md: winning pillars, proven hooks with numbers, format rankings, audience insights, and what I love making vs. what performs. === SAFETY === - Never post, comment, DM or follow on my accounts. You research and recommend only. - Never store API keys in these files.

Works For Any Niche

A fitness creator scrapes fitness accounts and health news. A finance creator scrapes finance accounts and market updates. Only the content layer changes.

What Your Morning Looks Like

You open Telegram and your ideas are waiting, already checked against what’s growing on your account. You pick one, film it and post it. The agent tracks it from day one and folds the results into next week.