Skill: seomikewaltman/yoinkit (version 1.0.8)

--- name: yoinkit description: Search, analyze, and transcribe content across 13 social platforms — trending topics, video transcripts, post metadata, and multi-platform research workflows. --- # Yoinkit — OpenClaw Skill Search, analyze, and transcribe content across 13 social platforms — trending topics, video transcripts, post metadata, creator feeds, and multi-platform research workflows. ## Platform Reference **Before running commands**, check [references/platforms.md](references/platforms.md) for: - Which platforms support transcript/trending/search/user feed - Platform-specific parameters and options - How to handle unsupported operations ## Requirements - **Yoinkit subscription** with API access enabled - **API Token** from Yoinkit Settings → OpenClaw ## Configuration Set your API token in OpenClaw config: ```bash # Via chat command /config set skills.entries.yoinkit.env.YOINKIT_API_TOKEN="your-token-here" ``` Or edit `~/.openclaw/openclaw.json`: ```json { "skills": { "entries": { "yoinkit": { "env": { "YOINKIT_API_TOKEN": "your-token-here", "YOINKIT_API_URL": "https://yoinkit.ai/api/v1/openclaw" } } } } } ``` > **Local testing:** Set `YOINKIT_API_URL` to `http://localhost:8000/api/v1/openclaw` to test against a local server. Defaults to production if not set. ## Commands ### `yoinkit transcript <url> [options]` Extract transcript from video URL. **Supported:** YouTube, TikTok, Instagram, Twitter/X, Facebook **Options:** - `--language CODE` — 2-letter language code (YouTube, TikTok only). Example: `en`, `es`, `fr` ```bash yoinkit transcript https://youtube.com/watch?v=abc123 yoinkit transcript https://youtube.com/watch?v=abc123 --language es yoinkit transcript https://tiktok.com/@user/video/123 yoinkit transcript https://instagram.com/reel/abc123 ``` --- ### `yoinkit content <url>` Get full content and metadata from a social post. **Supported:** YouTube, TikTok, Instagram, Twitter/X, Facebook, LinkedIn, Reddit, Pinterest, Threads, Bluesky, Truth Social, Twitch, Kick ```bash yoinkit content https://youtube.com/watch?v=abc123 yoinkit content https://twitter.com/user/status/123 yoinkit content https://reddit.com/r/technology/comments/abc yoinkit content https://bsky.app/profile/user.bsky.social/post/abc ``` --- ### `yoinkit search <platform> "<query>" [options]` Search content on a platform. Each platform has different params — use the ones that apply. **Supported:** YouTube, TikTok, Instagram, Reddit, Pinterest **Common options:** - `--sort TYPE` — Sort results (platform-specific values, see below) - `--time PERIOD` — Filter by time (platform-specific values, see below) - `--cursor TOKEN` — Pagination cursor from previous response - `--continuation TOKEN` — YouTube pagination token - `--page N` — Page number (Instagram only) **Platform-specific sort values:** - YouTube: `relevance`, `popular` - TikTok: `relevance`, `most-liked`, `date-posted` - Reddit: `relevance`, `new`, `top`, `comment_count` **Platform-specific time values:** - YouTube: `today`, `this_week`, `this_month`, `this_year` - TikTok: `yesterday`, `this-week`, `this-month`, `last-3-months`, `last-6-months`, `all-time` - Reddit: `all`, `day`, `week`, `month`, `year` ```bash yoinkit search youtube "AI tools for creators" yoinkit search youtube "AI tools" --sort popular --time this_week yoinkit search tiktok "productivity tips" --sort most-liked yoinkit search reddit "home automation" --sort top --time month yoinkit search instagram "fitness motivation" --page 2 yoinkit search pinterest "Italian recipes" ``` --- ### `yoinkit trending <platform> [options]` Get currently trending content. **Supported:** YouTube, TikTok **Options:** - `--type TYPE` — TikTok only: `trending` (default), `popular`, or `hashtags` - `--country CODE` — TikTok only: 2-letter country code (default: US) - `--period DAYS` — TikTok popular/hashtags: `7`, `30`, or `120` - `--page N` — TikTok popular/hashtags: page number - `--order TYPE` — TikTok popular only: `hot`, `like`, `comment`, `repost` **Note:** YouTube trending takes no parameters — it returns currently trending shorts. ```bash yoinkit trending youtube yoinkit trending tiktok yoinkit trending tiktok --type popular --country US --period 7 --order like yoinkit trending tiktok --type hashtags --period 30 ``` --- ### `yoinkit feed <platform> <handle> [options]` Get a user's recent posts/videos. **Supported:** YouTube, TikTok, Instagram, Twitter/X, Facebook, Threads, Bluesky, Truth Social **Options:** - `--type posts|reels|videos` — Content type (Instagram, Facebook). Default: `posts` - `--sort latest|popular` — Sort order (YouTube only) - `--cursor TOKEN` — Pagination cursor ```bash yoinkit feed youtube MrBeast yoinkit feed youtube @mkbhd --sort latest yoinkit feed tiktok garyvee yoinkit feed instagram ali-abdaal --type reels yoinkit feed twitter elonmusk yoinkit feed threads zuck yoinkit feed bluesky user.bsky.social ``` **Note:** Handles work with or without the `@` prefix. --- ### `yoinkit research "<topic>" [options]` Automated research workflow — combines search and trending across platforms. **Options:** - `--platforms LIST` — Comma-separated platforms (default: youtube,tiktok) - `--transcripts` — Also fetch transcripts from top trending results ```bash yoinkit research "home automation" yoinkit research "AI tools" --platforms youtube,tiktok,reddit yoinkit research "productivity" --transcripts ``` **What it does:** 1. Searches each platform for the topic 2. Gets trending content from supported platforms 3. Optionally fetches transcripts from top video results 4. Returns combined JSON results for analysis --- ## Natural Language You don't need exact command syntax. The LLM will map natural requests to the right command: > "What's trending on TikTok?" → `yoinkit trending tiktok` > "Pull the transcript from this YouTube video: [url]" → `yoinkit transcript <url>` > "Find popular Reddit posts about home automation from this week" → `yoinkit search reddit "home automation" --sort top --time week` > "What has MrBeast posted this week?" → `yoinkit feed youtube MrBeast` > "Check @garyvee's latest TikToks" → `yoinkit feed tiktok garyvee` > "Research what creators are doing with AI tools" → `yoinkit research "AI tools" --platforms youtube,tiktok,reddit` --- ## API Base URL All requests go through your Yoinkit subscription: ``` https://yoinkit.ai/api/v1/openclaw ``` --- ## Output Formatting A Yoinkit logo is included at `assets/yoinkit-logo.png` (200x200, transparent background, gradient icon). When the platform supports images/media, send the logo alongside the first result in a conversation. When presenting Yoinkit results to the user: - Prefix output with **🟣 Yoinkit** as a header or label - Format video/post results as clean cards: title, views/engagement, date, link - Highlight key metadata (views, likes, publish date) — hide raw JSON noise - For transcript results, provide a concise summary first, then offer the full transcript if asked - For trending results, present as a numbered list with platform and engagement stats - For research results, organize by platform with clear section headers - Include a subtle footer: `Powered by Yoinkit · yoinkit.ai` - When results are empty or a platform isn't supported, suggest alternatives naturally --- ## Support - Issues: https://github.com/seomikewaltman/yoinkit-openclaw-skill/issues - Yoinkit: https://yoinkit.ai

path: README.md
content: # YoinkIt — OpenClaw Skill

Search, analyze, and transcribe content across 13 social platforms — trending topics, video transcripts, post metadata, and multi-platform research workflows.

## Features

- **Content** — Pull post/video metadata from 13 platforms (YouTube, TikTok, Instagram, Twitter/X, Facebook, LinkedIn, Reddit, Pinterest, Threads, Bluesky, Truth Social, Twitch, Kick)
- **Transcripts** — Extract video transcripts (YouTube, TikTok, Instagram, Twitter/X, Facebook)
- **Search** — Find content across YouTube, TikTok, Instagram, Reddit, Pinterest
- **Trending** — See what's trending on YouTube and TikTok (including popular creators and hashtags)
- **User Feeds** — Get recent posts/videos from specific creators (YouTube, TikTok, Instagram, Twitter/X, Facebook, Threads, Bluesky, Truth Social)
- **Research** — Automated workflows combining search + trending + transcripts across platforms

## Requirements

- [OpenClaw](https://openclaw.ai) installed
- Active [Yoinkit](https://yoinkit.ai) subscription
- API token from Yoinkit Settings → OpenClaw

## Installation

```bash
npx clawhub install yoinkit
```

Then set your API token in OpenClaw config:

```json
{
  "skills": {
    "entries": {
      "yoinkit": {
        "env": {
          "YOINKIT_API_TOKEN": "your-token-here"
        }
      }
    }
  }
}
```

### Local Development

To test against a local server, add `YOINKIT_API_URL`:

```json
{
  "skills": {
    "entries": {
      "yoinkit": {
        "env": {
          "YOINKIT_API_TOKEN": "your-token-here",
          "YOINKIT_API_URL": "http://localhost:8000/api/v1/openclaw"
        }
      }
    }
  }
}
```

## Usage

### Commands

```bash
# Get content/metadata from any platform
yoinkit content https://youtube.com/watch?v=abc123
yoinkit content https://twitter.com/user/status/123
yoinkit content https://reddit.com/r/tech/comments/abc/post

# Get a video transcript
yoinkit transcript https://youtube.com/watch?v=abc123
yoinkit transcript https://youtube.com/shorts/abc123
yoinkit transcript https://tiktok.com/@user/video/123 --language en

# Search a platform
yoinkit search youtube "AI tools for creators"
yoinkit search youtube "AI tools" --sort relevance --time this_week
yoinkit search tiktok "productivity" --sort most-liked
yoinkit search reddit "home automation" --sort top --time month

# Get a creator's recent uploads
yoinkit feed youtube MrBeast
yoinkit feed tiktok @garyvee
yoinkit feed instagram ali-abdaal --type reels

# Get trending content
yoinkit trending youtube
yoinkit trending tiktok
yoinkit trending tiktok --type popular --order like --period 7
yoinkit trending tiktok --type hashtags --period 30

# Multi-platform research workflow
yoinkit research "AI tools" --platforms youtube,tiktok,reddit
yoinkit research "home automation" --platforms youtube,reddit --transcripts
```

### Natural Language

Just ask your assistant naturally:

> "What's trending on YouTube right now?"

> "Search TikTok for productivity tips from this week, sorted by most liked"

> "Pull the transcript from this YouTube video and summarize it"

> "Research what people are saying about AI tools across YouTube, TikTok, and Reddit"

> "What has MrBeast posted this week?"

> "Check @garyvee's latest TikToks"

> "Get me the details on this Instagram post"

## Platform Support

| Platform | Content | Transcript | Search | Trending | User Feed |
|----------|:-------:|:----------:|:------:|:--------:|:---------:|
| YouTube | ✅ | ✅ | ✅ | ✅ | ✅ |
| TikTok | ✅ | ✅ | ✅ | ✅ | ✅ |
| Instagram | ✅ | ✅ | ✅ | — | ✅ |
| Twitter/X | ✅ | ✅ | — | — | ✅ |
| Facebook | ✅ | ✅ | — | — | ✅ |
| LinkedIn | ✅ | — | — | — | — |
| Reddit | ✅ | — | ✅ | — | — |
| Pinterest | ✅ | — | ✅ | — | — |
| Threads | ✅ | — | — | — | ✅ |
| Bluesky | ✅ | — | — | — | ✅ |
| Truth Social | ✅ | — | — | — | ✅ |
| Twitch | ✅ | — | — | — | — |
| Kick | ✅ | — | — | — | — |

## Cron Examples

See the `examples/` directory for ready-to-use OpenClaw cron job configurations:

- **`creator-monitor.json`** — Check creator feeds, pull transcripts, summarize new uploads
- **`obsidian-research-collect.json`** — 7 AM: Scan feeds + trending, save daily collection note to Obsidian
- **`obsidian-research-analyze.json`** — 8 AM: Read collection note, pull transcripts, generate content ideas
- **`daily-trends.json`** — Morning trend check across YouTube and TikTok
- **`weekly-research.json`** — Deep multi-platform research every Monday
- **`viral-alert.json`** — Check for viral content every 2 hours
- **`competitor-watch.json`** — Monitor competitor content weekly
- **`niche-monitor.json`** — Daily cross-platform question/pain-point mining
- **`video-breakdown.json`** — On-demand template for analyzing a specific video

Copy any example and add it via OpenClaw's cron system.

## Documentation

- Platform reference: [references/platforms.md](references/platforms.md)

## License

MIT


path: examples/competitor-watch.json
content: {
  "name": "Competitor Content Watch",
  "schedule": {
    "kind": "cron",
    "expr": "0 8 * * 3",
    "tz": "America/Chicago"
  },
  "payload": {
    "kind": "agentTurn",
    "message": "Use yoinkit to research what my competitors are publishing:\n1. Search YouTube for 'AI tools for creators' and 'creator economy 2026' — sorted by upload date this week\n2. Search TikTok for the same topics, sorted by most-liked\n3. Pull transcripts from the top 2 videos on each platform\n4. Summarize their angles, hooks, and what's getting engagement\n5. Identify anything I should respond to or cover differently.",
    "timeoutSeconds": 300
  },
  "sessionTarget": "isolated",
  "delivery": {
    "mode": "announce"
  }
}


path: examples/creator-monitor.json
content: {
  "name": "Creator Monitor + Transcripts",
  "description": "Single job that checks creator feeds and pulls transcripts from new uploads. No chaining needed.",
  "schedule": {
    "kind": "cron",
    "expr": "0 7 * * *",
    "tz": "America/Chicago"
  },
  "payload": {
    "kind": "agentTurn",
    "message": "Use yoinkit to check for new uploads from these creators:\n- YouTube: @MrBeast, @mkbhd, @ali-abdaal\n- TikTok: @garyvee\n\nFor each creator, pull their recent feed. For anything posted in the last 24 hours:\n1. Note the title, view count, and URL\n2. Pull the transcript\n3. Summarize the video in 3-4 bullet points (main topic, key takeaways, hooks used)\n4. Suggest one content idea I could create in response\n\nIf no new uploads, just say so.",
    "timeoutSeconds": 300
  },
  "sessionTarget": "isolated",
  "delivery": {
    "mode": "announce"
  }
}


path: examples/daily-trends.json
content: {
  "name": "Daily Trend Check",
  "schedule": {
    "kind": "cron",
    "expr": "0 9 * * *",
    "tz": "America/Chicago"
  },
  "payload": {
    "kind": "agentTurn",
    "message": "Use yoinkit to check what's trending on YouTube and TikTok right now. Summarize the top trends and flag any content with over 500K views that's relevant to my content niches. Keep it brief — bullet points are fine."
  },
  "sessionTarget": "isolated",
  "delivery": {
    "mode": "announce"
  }
}


path: examples/niche-monitor.json
content: {
  "name": "Niche Topic Monitor",
  "schedule": {
    "kind": "cron",
    "expr": "0 12 * * *",
    "tz": "America/Chicago"
  },
  "payload": {
    "kind": "agentTurn",
    "message": "Use yoinkit to monitor my content niches:\n1. Search Reddit for 'AI tools' — sort by new, timeframe day. Look for questions people are asking and pain points they mention.\n2. Search TikTok for 'AI tools' — sort by date-posted. See what creators are posting today.\n3. Search YouTube for 'AI tools' — filter by today's uploads.\n\nSummarize: What are people asking about? What are creators making? Any trending questions I could answer with a video?"
  },
  "sessionTarget": "isolated",
  "delivery": {
    "mode": "announce"
  }
}


path: examples/obsidian-research-analyze.json
content: {
  "name": "Research Analyze (Step 2 of 2)",
  "description": "8 AM — Reads today's collection note from Obsidian, pulls transcripts for NEW items, generates content ideas, and updates the note.",
  "schedule": {
    "kind": "cron",
    "expr": "0 8 * * *",
    "tz": "America/Chicago"
  },
  "payload": {
    "kind": "agentTurn",
    "message": "Read today's research collection note from the Obsidian vault:\n`Research/Daily/YYYY-MM-DD-collection.md`\n\nFor every item marked as NEW with `Transcript: PENDING`:\n1. Use yoinkit to pull the transcript\n2. Summarize the video in 3-4 bullet points\n3. Identify the hook, structure, and CTA used\n4. Update the note: change `Transcript: PENDING` to `Transcript: DONE` and add the summary below the entry\n\nAfter processing all items, add a section at the bottom:\n\n## Content Ideas\nBased on today's research, suggest 3-5 content ideas I could create:\n- What angle to take\n- Which platform to target\n- Why it would work (based on what's getting engagement)\n\nSave the updated note back to the same file.",
    "timeoutSeconds": 300
  },
  "sessionTarget": "isolated",
  "delivery": {
    "mode": "announce"
  }
}


path: examples/obsidian-research-collect.json
content: {
  "name": "Research Collect (Step 1 of 2)",
  "description": "7 AM — Scans creator feeds and trending content, saves a daily research note to Obsidian. The 8 AM job reads this note for transcript pulls.",
  "schedule": {
    "kind": "cron",
    "expr": "0 7 * * *",
    "tz": "America/Chicago"
  },
  "payload": {
    "kind": "agentTurn",
    "message": "Use yoinkit to collect today's content research:\n\n1. Check YouTube and TikTok trending\n2. Pull recent feeds from: @MrBeast, @mkbhd, @ali-abdaal (YouTube), @garyvee (TikTok)\n3. Search YouTube and Reddit for 'AI tools' and 'creator economy'\n\nFor each piece of content found, record:\n- Platform, creator, title, URL, view count, publish date\n- Flag anything from the last 24 hours as NEW\n\nSave the results as a markdown note to the Obsidian vault at:\n`Research/Daily/YYYY-MM-DD-collection.md`\n\nUse this format for each item:\n```\n## [Platform] Creator — Title\n- URL: ...\n- Views: ... | Published: ...\n- Status: NEW or EXISTING\n- Transcript: PENDING\n```\n\nDo NOT pull transcripts yet — that's the next job's responsibility.",
    "timeoutSeconds": 180
  },
  "sessionTarget": "isolated",
  "delivery": {
    "mode": "announce"
  }
}


path: examples/video-breakdown.json
content: {
  "name": "Video Breakdown",
  "description": "On-demand — not scheduled. Use as a template for analyzing a specific video.",
  "payload": {
    "kind": "agentTurn",
    "message": "Use yoinkit to break down this video: VIDEO_URL_HERE\n1. Pull the content metadata (views, likes, publish date, channel info)\n2. Pull the full transcript\n3. Analyze the script structure: hook, intro, main points, CTA\n4. What makes this video work? (pacing, topic angle, thumbnail strategy from title)\n5. How could I cover this topic with my own angle?"
  },
  "sessionTarget": "isolated"
}


path: examples/viral-alert.json
content: {
  "name": "Viral Content Alert",
  "schedule": {
    "kind": "every",
    "everyMs": 7200000
  },
  "payload": {
    "kind": "agentTurn",
    "message": "Use yoinkit to check YouTube and TikTok trending right now. Look for anything uploaded in the last 24 hours with unusually high engagement (100K+ views). If you find something noteworthy, summarize it and suggest how I could create a response or reaction video. If nothing stands out, just reply with a one-liner that you checked and it was quiet."
  },
  "sessionTarget": "isolated",
  "delivery": {
    "mode": "announce",
    "channel": "telegram"
  }
}


path: examples/weekly-research.json
content: {
  "name": "Weekly Content Research",
  "schedule": {
    "kind": "cron",
    "expr": "0 10 * * 1",
    "tz": "America/Chicago"
  },
  "payload": {
    "kind": "agentTurn",
    "message": "Do a weekly content research sweep using yoinkit:\n1. Search YouTube, TikTok, and Reddit for 'AI tools', 'productivity', and 'creator economy'\n2. Check what's trending on YouTube and TikTok\n3. Pull transcripts from the top 3 most interesting videos you find\n4. Identify content gaps — what topics are getting views but few creators are covering?\n5. Suggest 3 video ideas based on your findings.\n\nFormat as a report with sections for each platform.",
    "timeoutSeconds": 300
  },
  "sessionTarget": "isolated",
  "delivery": {
    "mode": "announce"
  }
}


path: references/platforms.md
content: # Yoinkit Platform Capabilities

| Platform | Content | Transcript | Search | Trending | User Feed | Notes |
|----------|:-------:|:----------:|:------:|:--------:|:---------:|-------|
| YouTube | ✅ | ✅ | ✅ | ✅ | ✅ | Full support; channel videos via handle or ID |
| TikTok | ✅ | ✅ | ✅ | ✅ | ✅ | trending, popular, hashtags endpoints |
| Instagram | ✅ | ✅ | ✅ | ❌ | ✅ | Search reels; user posts and reels |
| Twitter/X | ✅ | ✅ | ❌ | ❌ | ✅ | Content and user tweets |
| Facebook | ✅ | ✅ | ❌ | ❌ | ✅ | Posts and reels from pages |
| LinkedIn | ✅ | ❌ | ❌ | ❌ | ❌ | Post content only |
| Reddit | ✅ | ❌ | ✅ | ❌ | ❌ | Search + subreddit browsing |
| Pinterest | ✅ | ❌ | ✅ | ❌ | ❌ | Pin content and search |
| Threads | ✅ | ❌ | ❌ | ❌ | ✅ | Post content and user posts |
| Bluesky | ✅ | ❌ | ❌ | ❌ | ✅ | Post content and user posts |
| Truth Social | ✅ | ❌ | ❌ | ❌ | ✅ | Post content and user posts |
| Twitch | ✅ | ❌ | ❌ | ❌ | ❌ | Clips only |
| Kick | ✅ | ❌ | ❌ | ❌ | ❌ | Clips only |

## Endpoint Quick Reference

### Content (single post/video)
All take `url` (required):
- `youtube/video?url=URL`
- `tiktok/video?url=URL` (optional: `get_transcript`, `region`, `trim`)
- `instagram/post?url=URL` (optional: `trim`)
- `twitter/tweet?url=URL` (optional: `trim`)
- `facebook/post?url=URL` (optional: `get_comments`, `get_transcript`)
- `linkedin/post?url=URL`
- `reddit/post?url=URL` (optional: `cursor`, `trim`)
- `pinterest/pin?url=URL` (optional: `trim`)
- `threads/post?url=URL` (optional: `trim`)
- `bluesky/post?url=URL`
- `truthsocial/post?url=URL`
- `twitch/clip?url=URL`
- `kick/clip?url=URL`

### Transcript
All take `url` (required):
- `youtube/transcript?url=URL` (optional: `language`)
- `tiktok/transcript?url=URL` (optional: `language`, `use_ai_as_fallback`)
- `instagram/transcript?url=URL`
- `twitter/transcript?url=URL`
- `facebook/transcript?url=URL`

### Search
- `youtube/search?query=Q` (optional: `sortBy`, `uploadDate`, `filter`, `continuationToken`, `includeExtras`)
- `youtube/search/hashtag?hashtag=H` (optional: `continuationToken`, `type`)
- `tiktok/search?query=Q` (optional: `sort_by`, `date_posted`, `region`, `cursor`, `trim`)
- `tiktok/search/hashtag?hashtag=H` (optional: `cursor`, `trim`)
- `tiktok/search/top?query=Q` (optional: `cursor`, `trim`)
- `instagram/search?query=Q` (optional: `page`)
- `reddit/search?query=Q` (optional: `sort`, `timeframe`, `after`, `trim`)
- `reddit/subreddit?subreddit=NAME` (optional: `sort`, `timeframe`, `cursor`)
- `reddit/subreddit/search?subreddit=NAME` (optional: `query`, `filter`, `sort`, `timeframe`, `cursor`)
- `pinterest/search?query=Q` (optional: `cursor`, `trim`)

### Trending
- `youtube/trending` (no parameters)
- `tiktok/trending?region=CC` (optional: `trim`)
- `tiktok/popular` (optional: `period`, `page`, `orderBy`, `countryCode`)
- `tiktok/hashtags` (optional: `period`, `page`, `countryCode`, `newOnBoard`)

### User Feed
- `youtube/channel/videos` (use `channelId` or `handle`; optional: `sort`, `continuationToken`, `includeExtras`)
- `tiktok/user/videos` (use `handle` or `user_id`; optional: `cursor`, `trim`)
- `instagram/user/posts?handle=H` (optional: `max_id`)
- `instagram/user/reels` (use `handle` or `user_id`; optional: `max_id`)
- `twitter/user/tweets` (use `handle` or `userId`; optional: `cursor`, `trim`)
- `facebook/user/posts` (use `url` or `pageId`; optional: `cursor`)
- `facebook/user/reels` (use `url` or `pageId`; optional: `cursor`)
- `threads/user/posts?handle=H` (optional: `max_id`, `trim`)
- `bluesky/user/posts` (use `handle` or `user_id`; optional: `cursor`)
- `truthsocial/user/posts` (use `handle` or `user_id`; optional: `max_id`)


path: scripts/content.sh
content: #!/bin/bash
# yoinkit content <url>
# Get content and metadata from a social post

set -e

URL="$1"

if [ -z "$URL" ]; then
    echo "Error: URL required"
    echo "Usage: yoinkit content <url>"
    exit 1
fi

if [ -z "$YOINKIT_API_TOKEN" ]; then
    echo "Error: YOINKIT_API_TOKEN not configured"
    exit 1
fi

API_BASE="${YOINKIT_API_URL:-https://yoinkit.ai/api/v1/openclaw}"

# Normalize YouTube short URLs and youtu.be links
if [[ "$URL" == *"youtube.com/shorts/"* ]]; then
    VIDEO_ID=$(echo "$URL" | sed 's|.*youtube.com/shorts/||' | sed 's|[?&].*||')
    URL="https://www.youtube.com/watch?v=$VIDEO_ID"
elif [[ "$URL" == *"youtu.be/"* ]]; then
    VIDEO_ID=$(echo "$URL" | sed 's|.*youtu.be/||' | sed 's|[?&].*||')
    URL="https://www.youtube.com/watch?v=$VIDEO_ID"
fi

# Detect platform and construct endpoint
if [[ "$URL" == *"youtube.com"* ]] || [[ "$URL" == *"youtu.be"* ]]; then
    ENDPOINT="youtube/video?url=$(echo "$URL" | jq -sRr @uri)"
elif [[ "$URL" == *"tiktok.com"* ]]; then
    ENDPOINT="tiktok/video?url=$(echo "$URL" | jq -sRr @uri)"
elif [[ "$URL" == *"twitter.com"* ]] || [[ "$URL" == *"x.com"* ]]; then
    ENDPOINT="twitter/tweet?url=$(echo "$URL" | jq -sRr @uri)"
elif [[ "$URL" == *"instagram.com"* ]]; then
    ENDPOINT="instagram/post?url=$(echo "$URL" | jq -sRr @uri)"
elif [[ "$URL" == *"reddit.com"* ]]; then
    ENDPOINT="reddit/post?url=$(echo "$URL" | jq -sRr @uri)"
elif [[ "$URL" == *"linkedin.com"* ]]; then
    ENDPOINT="linkedin/post?url=$(echo "$URL" | jq -sRr @uri)"
elif [[ "$URL" == *"facebook.com"* ]]; then
    ENDPOINT="facebook/post?url=$(echo "$URL" | jq -sRr @uri)"
elif [[ "$URL" == *"threads.net"* ]]; then
    ENDPOINT="threads/post?url=$(echo "$URL" | jq -sRr @uri)"
elif [[ "$URL" == *"pinterest.com"* ]]; then
    ENDPOINT="pinterest/pin?url=$(echo "$URL" | jq -sRr @uri)"
elif [[ "$URL" == *"bsky.app"* ]]; then
    ENDPOINT="bluesky/post?url=$(echo "$URL" | jq -sRr @uri)"
elif [[ "$URL" == *"truthsocial.com"* ]]; then
    ENDPOINT="truthsocial/post?url=$(echo "$URL" | jq -sRr @uri)"
elif [[ "$URL" == *"twitch.tv"* ]]; then
    ENDPOINT="twitch/clip?url=$(echo "$URL" | jq -sRr @uri)"
elif [[ "$URL" == *"kick.com"* ]]; then
    ENDPOINT="kick/clip?url=$(echo "$URL" | jq -sRr @uri)"
else
    echo "Error: Unsupported platform"
    exit 1
fi

# Make API request
RESPONSE=$(curl -s -H "Authorization: Bearer $YOINKIT_API_TOKEN" \
    "$API_BASE/$ENDPOINT")

# Check for errors
if echo "$RESPONSE" | jq -e '.success == false' > /dev/null 2>&1; then
    ERROR=$(echo "$RESPONSE" | jq -r '.error.message // .error // "Unknown error"')
    echo "Error: $ERROR"
    exit 1
fi

# Output formatted content from data wrapper
echo "$RESPONSE" | jq '.data // .'


path: scripts/feed.sh
content: #!/bin/bash
# yoinkit feed <platform> <handle>
# Get a user's recent posts/videos

set -e

PLATFORM="$1"
HANDLE="$2"
shift 2 2>/dev/null || true

SUPPORTED_PLATFORMS=("youtube" "tiktok" "instagram" "twitter" "facebook" "threads" "bluesky" "truthsocial")

if [[ ! " ${SUPPORTED_PLATFORMS[@]} " =~ " ${PLATFORM} " ]]; then
    echo "Error: Platform $PLATFORM does not support user feeds"
    echo "Supported platforms: ${SUPPORTED_PLATFORMS[*]}"
    exit 1
fi

if [ -z "$HANDLE" ]; then
    echo "Error: Handle/username required"
    echo "Usage: yoinkit feed <platform> <handle> [options]"
    echo ""
    echo "Options:"
    echo "  --type posts|reels|videos   Content type (Instagram/Facebook)"
    echo "  --sort latest|popular       Sort order (YouTube)"
    echo "  --cursor TOKEN              Pagination cursor"
    exit 1
fi

if [ -z "$YOINKIT_API_TOKEN" ]; then
    echo "Error: YOINKIT_API_TOKEN not configured"
    exit 1
fi

API_BASE="${YOINKIT_API_URL:-https://yoinkit.ai/api/v1/openclaw}"

# Strip @ prefix if present
HANDLE="${HANDLE#@}"

# Defaults
TYPE="posts"
SORT=""
CURSOR=""

# Parse additional options
while [[ $# -gt 0 ]]; do
    key="$1"
    case $key in
        --type)
            TYPE="$2"
            shift 2
            ;;
        --sort)
            SORT="$2"
            shift 2
            ;;
        --cursor)
            CURSOR="$2"
            shift 2
            ;;
        *)
            echo "Unknown option: $1"
            exit 1
            ;;
    esac
done

ENCODED_HANDLE=$(echo "$HANDLE" | jq -sRr @uri)

case "$PLATFORM" in
    youtube)
        # Params: handle or channelId (required), sort, continuationToken, includeExtras
        ENDPOINT="youtube/channel/videos?handle=$ENCODED_HANDLE"
        [ -n "$SORT" ] && ENDPOINT+="&sort=$SORT"
        [ -n "$CURSOR" ] && ENDPOINT+="&continuationToken=$CURSOR"
        ;;
    tiktok)
        # Params: handle or user_id (required), cursor, trim
        ENDPOINT="tiktok/user/videos?handle=$ENCODED_HANDLE"
        [ -n "$CURSOR" ] && ENDPOINT+="&cursor=$CURSOR"
        ;;
    instagram)
        # Params: handle (required), max_id
        if [[ "$TYPE" == "reels" ]]; then
            ENDPOINT="instagram/user/reels?handle=$ENCODED_HANDLE"
        else
            ENDPOINT="instagram/user/posts?handle=$ENCODED_HANDLE"
        fi
        [ -n "$CURSOR" ] && ENDPOINT+="&max_id=$CURSOR"
        ;;
    twitter)
        # Params: handle or userId (required), cursor, trim
        ENDPOINT="twitter/user/tweets?handle=$ENCODED_HANDLE"
        [ -n "$CURSOR" ] && ENDPOINT+="&cursor=$CURSOR"
        ;;
    facebook)
        # Params: url or pageId (required), cursor
        # Facebook uses page URLs or IDs, not handles — pass as-is
        if [[ "$TYPE" == "reels" ]]; then
            ENDPOINT="facebook/user/reels?url=$(echo "https://facebook.com/$HANDLE" | jq -sRr @uri)"
        else
            ENDPOINT="facebook/user/posts?url=$(echo "https://facebook.com/$HANDLE" | jq -sRr @uri)"
        fi
        [ -n "$CURSOR" ] && ENDPOINT+="&cursor=$CURSOR"
        ;;
    threads)
        # Params: handle (required), max_id, trim
        ENDPOINT="threads/user/posts?handle=$ENCODED_HANDLE"
        [ -n "$CURSOR" ] && ENDPOINT+="&max_id=$CURSOR"
        ;;
    bluesky)
        # Params: handle or user_id (required), cursor
        ENDPOINT="bluesky/user/posts?handle=$ENCODED_HANDLE"
        [ -n "$CURSOR" ] && ENDPOINT+="&cursor=$CURSOR"
        ;;
    truthsocial)
        # Params: handle or user_id (required), max_id
        ENDPOINT="truthsocial/user/posts?handle=$ENCODED_HANDLE"
        [ -n "$CURSOR" ] && ENDPOINT+="&max_id=$CURSOR"
        ;;
esac

# Make API request
RESPONSE=$(curl -s -H "Authorization: Bearer $YOINKIT_API_TOKEN" \
    "$API_BASE/$ENDPOINT")

# Check for errors
if echo "$RESPONSE" | jq -e '.success == false' > /dev/null 2>&1; then
    ERROR=$(echo "$RESPONSE" | jq -r '.error.message // .error // "Unknown error"')
    echo "Error: $ERROR"
    exit 1
fi

# Output formatted results from data wrapper
echo "$RESPONSE" | jq '.data // .'


path: scripts/research.sh
content: #!/bin/bash
# yoinkit research <topic>
# Automated research workflow — combines search and trending across platforms

set -e

TOPIC="$1"
shift 2>/dev/null || true

if [ -z "$TOPIC" ]; then
    echo "Error: Topic required"
    echo "Usage: yoinkit research \"<topic>\" [options]"
    exit 1
fi

if [ -z "$YOINKIT_API_TOKEN" ]; then
    echo "Error: YOINKIT_API_TOKEN not configured"
    exit 1
fi

API_BASE="${YOINKIT_API_URL:-https://yoinkit.ai/api/v1/openclaw}"

# Default parameters
PLATFORMS=("youtube" "tiktok")
TRANSCRIPTS=false

# Parse additional options
while [[ $# -gt 0 ]]; do
    key="$1"
    case $key in
        --platforms)
            IFS=',' read -r -a PLATFORMS <<< "$2"
            shift 2
            ;;
        --transcripts)
            TRANSCRIPTS=true
            shift
            ;;
        *)
            echo "Unknown option: $1"
            exit 1
            ;;
    esac
done

# Platforms that support search
SEARCH_PLATFORMS=("youtube" "tiktok" "instagram" "reddit" "pinterest")
# Platforms that support trending
TRENDING_PLATFORMS=("youtube" "tiktok")
# Platforms that support transcripts
TRANSCRIPT_PLATFORMS=("youtube" "tiktok" "instagram" "twitter" "facebook")

echo "{"
echo "  \"topic\": \"$TOPIC\","
echo "  \"results\": {"

FIRST_PLATFORM=true

for platform in "${PLATFORMS[@]}"; do
    if [ "$FIRST_PLATFORM" = false ]; then
        echo ","
    fi
    FIRST_PLATFORM=false

    echo "    \"$platform\": {"

    # Search if platform supports it
    if [[ " ${SEARCH_PLATFORMS[@]} " =~ " ${platform} " ]]; then
        ENCODED_QUERY=$(echo "$TOPIC" | jq -sRr @uri)
        SEARCH_RESPONSE=$(curl -s -H "Authorization: Bearer $YOINKIT_API_TOKEN" \
            "$API_BASE/$platform/search?query=$ENCODED_QUERY")

        if echo "$SEARCH_RESPONSE" | jq -e '.success == false' > /dev/null 2>&1; then
            echo "      \"search\": null,"
        else
            echo "      \"search\": $(echo "$SEARCH_RESPONSE" | jq '.data // []'),"
        fi
    else
        echo "      \"search\": null,"
    fi

    # Trending if platform supports it
    if [[ " ${TRENDING_PLATFORMS[@]} " =~ " ${platform} " ]]; then
        if [[ "$platform" == "youtube" ]]; then
            # YouTube trending takes NO parameters
            TRENDING_RESPONSE=$(curl -s -H "Authorization: Bearer $YOINKIT_API_TOKEN" \
                "$API_BASE/youtube/trending")
        else
            # TikTok trending: region (required)
            TRENDING_RESPONSE=$(curl -s -H "Authorization: Bearer $YOINKIT_API_TOKEN" \
                "$API_BASE/tiktok/trending?region=US")
        fi

        if echo "$TRENDING_RESPONSE" | jq -e '.success == false' > /dev/null 2>&1; then
            echo "      \"trending\": null"
        else
            TRENDING_DATA=$(echo "$TRENDING_RESPONSE" | jq '.data // .')

            # Check if we need transcripts
            if [ "$TRANSCRIPTS" = true ] && [[ " ${TRANSCRIPT_PLATFORMS[@]} " =~ " ${platform} " ]]; then
                # Extract URLs based on platform response structure
                if [[ "$platform" == "youtube" ]]; then
                    URLS=$(echo "$TRENDING_DATA" | jq -r '.shorts[0:3]? // .[0:3]? | .[]? | .url // empty' 2>/dev/null)
                elif [[ "$platform" == "tiktok" ]]; then
                    URLS=$(echo "$TRENDING_DATA" | jq -r '.aweme_list[0:3]? // .[0:3]? | .[]? | .video.play_addr.url_list[0]? // empty' 2>/dev/null)
                fi

                TRANSCRIPTS_JSON="["
                FIRST_TRANSCRIPT=true
                for url in $URLS; do
                    if [ -n "$url" ]; then
                        if [ "$FIRST_TRANSCRIPT" = false ]; then
                            TRANSCRIPTS_JSON+=","
                        fi
                        FIRST_TRANSCRIPT=false

                        ENCODED_URL=$(echo "$url" | jq -sRr @uri)
                        TRANSCRIPT_RESPONSE=$(curl -s -H "Authorization: Bearer $YOINKIT_API_TOKEN" \
                            "$API_BASE/$platform/transcript?url=$ENCODED_URL")

                        if echo "$TRANSCRIPT_RESPONSE" | jq -e '.success != false' > /dev/null 2>&1; then
                            TRANSCRIPT_TEXT=$(echo "$TRANSCRIPT_RESPONSE" | jq -r '.data.transcript_only_text // .data.transcript // null')
                            TRANSCRIPTS_JSON+="{\"url\":\"$url\",\"transcript\":$(echo "$TRANSCRIPT_TEXT" | jq -Rs .)}"
                        fi
                    fi
                done
                TRANSCRIPTS_JSON+="]"

                echo "      \"trending\": $TRENDING_DATA,"
                echo "      \"transcripts\": $TRANSCRIPTS_JSON"
            else
                echo "      \"trending\": $TRENDING_DATA"
            fi
        fi
    else
        echo "      \"trending\": null"
    fi

    echo -n "    }"
done

echo ""
echo "  }"
echo "}"


path: scripts/search.sh
content: #!/bin/bash
# yoinkit search <platform> <query>
# Search content across social platforms

set -e

PLATFORM="$1"
QUERY="$2"
shift 2 2>/dev/null || true

# Supported platforms with search
SUPPORTED_PLATFORMS=("youtube" "tiktok" "instagram" "reddit" "pinterest")

# Validate platform
if [[ ! " ${SUPPORTED_PLATFORMS[@]} " =~ " ${PLATFORM} " ]]; then
    echo "Error: Platform $PLATFORM does not support search or is not supported"
    echo "Supported platforms: ${SUPPORTED_PLATFORMS[*]}"
    exit 1
fi

if [ -z "$QUERY" ]; then
    echo "Error: Query required"
    echo "Usage: yoinkit search <platform> \"<query>\" [options]"
    exit 1
fi

if [ -z "$YOINKIT_API_TOKEN" ]; then
    echo "Error: YOINKIT_API_TOKEN not configured"
    exit 1
fi

API_BASE="${YOINKIT_API_URL:-https://yoinkit.ai/api/v1/openclaw}"

# Platform-specific defaults
SORT=""
TIME=""
CONTINUATION=""
CURSOR=""
PAGE=""

# Parse additional options
while [[ $# -gt 0 ]]; do
    key="$1"
    case $key in
        --sort)
            SORT="$2"
            shift 2
            ;;
        --time)
            TIME="$2"
            shift 2
            ;;
        --continuation)
            CONTINUATION="$2"
            shift 2
            ;;
        --cursor)
            CURSOR="$2"
            shift 2
            ;;
        --page)
            PAGE="$2"
            shift 2
            ;;
        *)
            echo "Unknown option: $1"
            exit 1
            ;;
    esac
done

# Build endpoint with platform-specific params
ENCODED_QUERY=$(echo "$QUERY" | jq -sRr @uri)

case "$PLATFORM" in
    youtube)
        # Params: query (required), uploadDate, sortBy, filter, continuationToken, includeExtras
        QUERY_PARAMS="query=$ENCODED_QUERY"
        [ -n "$SORT" ] && QUERY_PARAMS+="&sortBy=$SORT"           # relevance, popular
        [ -n "$TIME" ] && QUERY_PARAMS+="&uploadDate=$TIME"       # today, this_week, this_month, this_year
        [ -n "$CONTINUATION" ] && QUERY_PARAMS+="&continuationToken=$CONTINUATION"
        ;;
    tiktok)
        # Params: query (required), date_posted, sort_by, region, cursor, trim
        QUERY_PARAMS="query=$ENCODED_QUERY"
        [ -n "$SORT" ] && QUERY_PARAMS+="&sort_by=$SORT"          # relevance, most-liked, date-posted
        [ -n "$TIME" ] && QUERY_PARAMS+="&date_posted=$TIME"      # yesterday, this-week, this-month, last-3-months, last-6-months, all-time
        [ -n "$CURSOR" ] && QUERY_PARAMS+="&cursor=$CURSOR"
        ;;
    instagram)
        # Params: query (required), page
        QUERY_PARAMS="query=$ENCODED_QUERY"
        [ -n "$PAGE" ] && QUERY_PARAMS+="&page=$PAGE"
        ;;
    reddit)
        # Params: query (required), sort, timeframe, after, trim
        QUERY_PARAMS="query=$ENCODED_QUERY"
        [ -n "$SORT" ] && QUERY_PARAMS+="&sort=$SORT"             # relevance, new, top, comment_count
        [ -n "$TIME" ] && QUERY_PARAMS+="&timeframe=$TIME"        # all, day, week, month, year
        [ -n "$CURSOR" ] && QUERY_PARAMS+="&after=$CURSOR"
        ;;
    pinterest)
        # Params: query (required), cursor, trim
        QUERY_PARAMS="query=$ENCODED_QUERY"
        [ -n "$CURSOR" ] && QUERY_PARAMS+="&cursor=$CURSOR"
        ;;
esac

# Make API request
RESPONSE=$(curl -s -H "Authorization: Bearer $YOINKIT_API_TOKEN" \
    "$API_BASE/$PLATFORM/search?$QUERY_PARAMS")

# Check for errors
if echo "$RESPONSE" | jq -e '.success == false' > /dev/null 2>&1; then
    ERROR=$(echo "$RESPONSE" | jq -r '.error.message // .error // "Unknown error"')
    echo "Error: $ERROR"
    exit 1
fi

# Output formatted results from data wrapper
echo "$RESPONSE" | jq '.data // .'


path: scripts/transcript.sh
content: #!/bin/bash
# yoinkit transcript <url>
# Extract transcript from video URL

set -e

URL="$1"
shift 2>/dev/null || true

if [ -z "$URL" ]; then
    echo "Error: URL required"
    echo "Usage: yoinkit transcript <url> [--language en]"
    exit 1
fi

if [ -z "$YOINKIT_API_TOKEN" ]; then
    echo "Error: YOINKIT_API_TOKEN not configured"
    exit 1
fi

API_BASE="${YOINKIT_API_URL:-https://yoinkit.ai/api/v1/openclaw}"

# Optional parameters
LANGUAGE=""

# Parse additional options
while [[ $# -gt 0 ]]; do
    key="$1"
    case $key in
        --language)
            LANGUAGE="$2"
            shift 2
            ;;
        *)
            echo "Unknown option: $1"
            exit 1
            ;;
    esac
done

# Normalize YouTube short URLs and youtu.be links
if [[ "$URL" == *"youtube.com/shorts/"* ]]; then
    VIDEO_ID=$(echo "$URL" | sed 's|.*youtube.com/shorts/||' | sed 's|[?&].*||')
    URL="https://www.youtube.com/watch?v=$VIDEO_ID"
elif [[ "$URL" == *"youtu.be/"* ]]; then
    VIDEO_ID=$(echo "$URL" | sed 's|.*youtu.be/||' | sed 's|[?&].*||')
    URL="https://www.youtube.com/watch?v=$VIDEO_ID"
fi

# Detect platform and construct endpoint
ENCODED_URL=$(echo "$URL" | jq -sRr @uri)

if [[ "$URL" == *"youtube.com"* ]] || [[ "$URL" == *"youtu.be"* ]]; then
    # Params: url (required), language
    ENDPOINT="youtube/transcript?url=$ENCODED_URL"
    [ -n "$LANGUAGE" ] && ENDPOINT+="&language=$LANGUAGE"
elif [[ "$URL" == *"tiktok.com"* ]]; then
    # Params: url (required), language, use_ai_as_fallback
    ENDPOINT="tiktok/transcript?url=$ENCODED_URL"
    [ -n "$LANGUAGE" ] && ENDPOINT+="&language=$LANGUAGE"
elif [[ "$URL" == *"instagram.com"* ]]; then
    # Params: url (required)
    ENDPOINT="instagram/transcript?url=$ENCODED_URL"
elif [[ "$URL" == *"twitter.com"* ]] || [[ "$URL" == *"x.com"* ]]; then
    # Params: url (required)
    ENDPOINT="twitter/transcript?url=$ENCODED_URL"
elif [[ "$URL" == *"facebook.com"* ]]; then
    # Params: url (required)
    ENDPOINT="facebook/transcript?url=$ENCODED_URL"
else
    echo "Error: Platform does not support transcripts or URL not recognized"
    echo "Supported: YouTube, TikTok, Instagram, Twitter/X, Facebook"
    exit 1
fi

# Make API request
RESPONSE=$(curl -s -H "Authorization: Bearer $YOINKIT_API_TOKEN" \
    "$API_BASE/$ENDPOINT")

# Check for errors
if echo "$RESPONSE" | jq -e '.success == false' > /dev/null 2>&1; then
    ERROR=$(echo "$RESPONSE" | jq -r '.error.message // .error // "Unknown error"')
    echo "Error: $ERROR"
    exit 1
fi

# Output transcript — try transcript text first, fall back to full data
echo "$RESPONSE" | jq -r '.data.transcript_only_text // .data.transcript // .data // .'


path: scripts/trending.sh
content: #!/bin/bash
# yoinkit trending <platform>
# Get trending content across platforms

set -e

PLATFORM="$1"
shift 2>/dev/null || true

# Supported platforms with trending
SUPPORTED_PLATFORMS=("youtube" "tiktok")

# Validate platform
if [[ ! " ${SUPPORTED_PLATFORMS[@]} " =~ " ${PLATFORM} " ]]; then
    echo "Error: Platform $PLATFORM does not support trending or is not supported"
    echo "Supported platforms: ${SUPPORTED_PLATFORMS[*]}"
    exit 1
fi

if [ -z "$YOINKIT_API_TOKEN" ]; then
    echo "Error: YOINKIT_API_TOKEN not configured"
    exit 1
fi

API_BASE="${YOINKIT_API_URL:-https://yoinkit.ai/api/v1/openclaw}"

# Default parameters
TYPE="trending"        # For TikTok: trending, popular, hashtags
COUNTRY="US"           # For TikTok trending: region
PERIOD=""              # For TikTok popular/hashtags: 7, 30
PAGE=""                # For TikTok popular/hashtags: page number
ORDER=""               # For TikTok popular: hot, like, comment, repost

# Parse additional options
while [[ $# -gt 0 ]]; do
    key="$1"
    case $key in
        --type)
            TYPE="$2"
            shift 2
            ;;
        --country)
            COUNTRY="$2"
            shift 2
            ;;
        --period)
            PERIOD="$2"
            shift 2
            ;;
        --page)
            PAGE="$2"
            shift 2
            ;;
        --order)
            ORDER="$2"
            shift 2
            ;;
        *)
            echo "Unknown option: $1"
            exit 1
            ;;
    esac
done

# Construct endpoint based on platform and type
if [[ "$PLATFORM" == "youtube" ]]; then
    # YouTube trending takes NO parameters
    ENDPOINT="youtube/trending"
elif [[ "$PLATFORM" == "tiktok" ]]; then
    case "$TYPE" in
        trending)
            # Params: region (required), trim
            ENDPOINT="tiktok/trending?region=$COUNTRY"
            ;;
        popular)
            # Params: period (7|30), page, orderBy (like|hot|comment|repost), countryCode
            ENDPOINT="tiktok/popular?countryCode=$COUNTRY"
            [ -n "$PERIOD" ] && ENDPOINT+="&period=$PERIOD"
            [ -n "$PAGE" ] && ENDPOINT+="&page=$PAGE"
            [ -n "$ORDER" ] && ENDPOINT+="&orderBy=$ORDER"
            ;;
        hashtags)
            # Params: period (7|30|120), page, countryCode, newOnBoard
            ENDPOINT="tiktok/hashtags?countryCode=$COUNTRY"
            [ -n "$PERIOD" ] && ENDPOINT+="&period=$PERIOD"
            [ -n "$PAGE" ] && ENDPOINT+="&page=$PAGE"
            ;;
        *)
            echo "Error: Unknown TikTok trending type: $TYPE"
            echo "Supported types: trending, popular, hashtags"
            exit 1
            ;;
    esac
fi

# Make API request
RESPONSE=$(curl -s -H "Authorization: Bearer $YOINKIT_API_TOKEN" \
    "$API_BASE/$ENDPOINT")

# Check for errors
if echo "$RESPONSE" | jq -e '.success == false' > /dev/null 2>&1; then
    ERROR=$(echo "$RESPONSE" | jq -r '.error.message // .error // "Unknown error"')
    echo "Error: $ERROR"
    exit 1
fi

# Output formatted results from data wrapper
echo "$RESPONSE" | jq '.data // .'


path: templates/research-report.md
content: # Research Report: {{topic}}

**Generated:** {{date}}
**Platforms:** {{platforms}}
**Depth:** {{depth}}

---

## Trending Topics

{{#each platforms}}
### {{name}}
{{#each trending}}
- {{title}} ({{views}} views)
{{/each}}
{{/each}}

---

## Top Content This Week

{{#each top_content}}
### {{rank}}. "{{title}}"
- **Platform:** {{platform}}
- **Views:** {{views}}
- **Published:** {{published}}
- **Key angles:** {{angles}}

{{/each}}

---

## Content Opportunities

{{#each opportunities}}
- **{{type}}:** {{description}}
{{/each}}

---

## Transcript Highlights

{{#if transcripts}}
{{#each transcripts}}
### {{title}}

> {{excerpt}}

**Key themes:** {{themes}}

{{/each}}
{{else}}
*No transcripts pulled (use --depth deep --transcripts)*
{{/if}}

---

*Generated by yoinkit-social skill*


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (HIGH)