search
Search Reddit and YouTube via official APIs using your own credentials, returning structured JSON results for research, monitoring, and compliance review.
Instructions
Search Reddit or YouTube through its official, documented API only (no scraping, no cookie import, no logged-in-human impersonation) using your own BYOK credentials, and return matching posts/videos as structured JSON. Call this whenever an agent needs recent or historical public content from one of these two platforms for research, monitoring, or compliance review; do not call it for platforms other than reddit/youtube (it returns a clear unsupported-platform error rather than guessing) or when you only need to check whether credentials work (use auth_status for that, it's cheaper and makes no search API call). Prerequisite: BYOK credentials for the target platform must already be stored locally via auditreach auth --platform <platform> -- this tool never sets up credentials itself and will fail fast with a 'No credentials found' error if they are missing. Side effects: makes a live network call to Reddit's or YouTube's official API (consuming that platform's rate limit/quota), and on success appends one tamper-evident, hash-chained entry to the local audit log recording platform, endpoint, scope, and timestamp -- this tool is not read-only and not idempotent in the sense that every successful call grows the audit log by one entry, though repeating an identical search is otherwise safe and does not mutate any remote state. If output is given, the full result set is also written to that local file path. Parameters: platform (required, 'reddit' or 'youtube'); query (search terms, required for reddit, optional for youtube); subreddit (reddit only, restrict to one subreddit, e.g. 'MachineLearning'); channel (youtube only, restrict to one channel handle, e.g. '@AnthropicAI'); since (youtube only, ISO date like '2026-06-01', only results published after this date); max_results (int, default 25, capped at 100 for reddit and 50 for youtube); before/after (reddit only, fullname pagination cursors like 't3_abc123'); output (optional local file path to also write the full JSON results to). Example calls: {"platform": "reddit", "query": "prompt injection", "subreddit": "MachineLearning", "max_results": 20}; {"platform": "youtube", "channel": "@AnthropicAI", "since": "2026-06-01", "max_results": 10}. Returns a JSON object with success (bool), exitCode (int), and on success a results array of items shaped like {id, title, url, createdAt, author, score, extra}; on failure an error string explains what went wrong (missing credentials, missing query, unsupported platform, or an upstream API error) instead of raising an exception.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | ||
| query | No | ||
| since | No | ||
| before | No | ||
| output | No | ||
| channel | No | ||
| platform | Yes | ||
| subreddit | No | ||
| max_results | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |