SociaHive Docs

Cookbook

Three end-to-end SociaHive recipes — auto-reply to Instagram comments, schedule a week of posts from a CSV, and a daily performance recap from Claude.

Three task-oriented recipes you can copy and run today.


Auto-reply to Instagram comments mentioning "price"

Persona: AI user (Claude.ai, Claude Desktop, Cursor) Time: 2 minutes Code: none — pure prompt via MCP

What you'll build: a SociaHive automation flow that DMs anyone who comments "price", "cost", or "how much" on your Instagram posts. You do it by talking to your AI assistant — no SociaHive UI clicking.

Prerequisites: an MCP client connected to SociaHive — see the MCP setup guide.

The prompt:

Using SociaHive, build me an Instagram comment auto-reply flow:

  1. Trigger on comments containing "price", "cost", or "how much"
  2. Reply publicly with "DMing you now! 📩"
  3. Send the commenter a DM with our pricing link: https://example.com/pricing
  4. Activate the flow when done

Use my first Instagram account. Show me the final flow before activating.

What the AI does under the hood:

1. list_accounts                  → find your Instagram account
2. generate_flow (15 AI credits)  → AI builds the entire flow graph
3. get_flow                       → show you the result
4. activate_flow                  → after you confirm

Variations:

TweakAdd to your prompt
Multiple keyword branches"If they say 'price' send pricing; if they say 'demo' send a Calendly link"
AI-personalized replies"Reply with an AI-generated message that matches my brand voice — use my knowledge base"
Tag the contact"...and tag the contact with 'price-curious'"
Restrict to one post"Only on Instagram post 18234567890123456"

Cost: 15 AI credits one-time (generate_flow); 0 credits per future auto-reply (template messages are free; AI-personalized replies cost 5 credits each).


Schedule a week of posts from a CSV

Persona: Developer Time: 5 minutes Code: Python + Node

Prerequisites: a SociaHive API key (see the developer quickstart) and either the Python or Node SDK installed.

CSV format:

text,platform,scheduled_at,image_url
"Monday motivation 💪",instagram,2026-06-01T09:00:00Z,https://cdn.example.com/mon.jpg
"Tuesday tip: keep it short",twitter,2026-06-02T09:00:00Z,
"Wednesday wisdom",linkedin,2026-06-03T09:00:00Z,
import csv
import os
import sys
from sociahive import SociaHive
 
sh = SociaHive(api_key=os.environ["SOCIAHIVE_API_KEY"])
 
with open(sys.argv[1]) as f:
    rows = list(csv.DictReader(f))
 
account_cache = {}
for platform in {r["platform"] for r in rows}:
    accounts = sh.accounts.list(platform=platform).get("data", [])
    if not accounts:
        sys.exit(f"No connected account for {platform}")
    account_cache[platform] = accounts[0]["id"]
 
payloads = [{
    "text": r["text"],
    "platforms": [{"platform": r["platform"], "account_id": account_cache[r["platform"]]}],
    "schedule_type": "scheduled",
    "scheduled_at": r["scheduled_at"],
    "timezone": "UTC",
    **({"media": [{"type": "image", "url": r["image_url"]}]} if r["image_url"] else {}),
} for r in rows]
 
# Use bulk endpoint when >10 posts; otherwise loop
if len(payloads) > 10:
    result = sh.posts.bulk(payloads)
    for post in result["data"]:
        print(f'scheduled {post["id"]} on {post["platforms"][0]["platform"]}')
else:
    for p in payloads:
        post = sh.posts.create(**p)
        print(f'scheduled {post["id"]} on {p["platforms"][0]["platform"]}')

CLI one-shot (no scripting needed):

sociahive posts create \
  --text "Monday motivation 💪" \
  --platforms '[{"platform":"instagram","account_id":"…"}]' \
  --schedule-type scheduled \
  --scheduled-at "2026-06-01T09:00:00Z" \
  --media '[{"type":"image","url":"https://cdn.example.com/mon.jpg"}]'

cURL — single call:

curl -X POST https://www.sociahive.com/api/v1/posts \
  -H "X-API-Key: $SOCIAHIVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Monday motivation 💪",
    "platforms": [{"platform":"instagram","account_id":"…"}],
    "schedule_type": "scheduled",
    "scheduled_at": "2026-06-01T09:00:00Z"
  }'

Error tips:

  • 413 on /posts/bulk — batch cap is 100 rows; chunk your CSV.
  • 400 platform_user_id required — account-id lookup matched the wrong account; pass platform_user_id explicitly.
  • 429 — default 1000 req/hr per key; cache account IDs and use the bulk endpoint.

Verify: sociahive posts list --status scheduled --limit 20.

Cost: $0 in AI credits.


Daily performance recap with Claude

Persona: Power user / agency operator Time: 2 minutes Code: none — pure prompt via MCP

What you'll get: a one-screen morning brief — which flows underperformed, which posts overperformed, what's queued for today, and where attention is needed. No clicks, no SQL, no dashboard hunting.

Prerequisites: an MCP client connected to SociaHive — see the MCP setup guide.

The prompt:

Give me a brief on yesterday's SociaHive performance. Steps:

  1. List my flows with stats for the last 24 hours.
  2. Pull analytics overview for the same window across all platforms.
  3. List anything scheduled to publish today.
  4. Output a 6-line summary:
    • Top performing flow (by completions) and why
    • Worst performing flow (by error rate) and what to investigate
    • Top post (by engagement) and what it had in common
    • Total reach / impressions across platforms vs the previous day
    • Anything queued for today I should review before it ships
    • One concrete action you'd recommend

Be concise — under 200 words total. Do not modify anything.

What the AI does under the hood:

1. list_flows_with_stats     → flow performance + error counts
2. get_analytics_overview    → cross-platform impressions / engagement
3. list_scheduled_posts      → today's queue

All three are read-only tools — no risk of accidental changes, no confirmation prompts.

Variations:

TweakAdd to your prompt
Weekly instead of daily"...for the last 7 days instead of 24 hours"
Per-platform"Split the summary per platform — Instagram / Facebook / LinkedIn"
Cron-stylePut it in a 9am calendar invite that says "ask Claude" — same prompt
Slack-able"Format the summary as a Slack message with emoji headings"

Cost:

  • 0 SociaHive AI credits — all three tools are read-only metrics endpoints, not metered.
  • Whatever your AI assistant charges for its own tokens (usually pennies per run with Claude Haiku or GPT-4o-mini).

Why this beats the dashboard:

The dashboard shows you data. The AI tells you what to do about it — which is what you actually wanted when you opened the dashboard at 9am.


  • Flow patterns — the seven shapes most SociaHive flows take, so you can describe what you want to build.
  • Developer quickstart — REST, SDKs, and CLI reference if you want to wire SociaHive into a larger application.
  • MCP setup guide — the AI-assistant integration that unlocks recipe #1 and #3.

On this page