# Reddit competitor analysis API skill Human Guide

## What This Is For
Reddit Competitor Analysis API Skill 📖 Introduction This skill uses the BrowserAct Reddit Competitor Analysis API template to provide users with a one-stop Reddit data collection service. It gives the agent a clearer input/output frame for competitive research: what context to ask for, what decisions to make, and what usable artifact to return.

Use this as a human-readable version of the Reddit competitor analysis API skill agent skill. It is meant for marketers, operators, founders, and other non-coders who want the workflow without reading agent-specific implementation instructions.

## When To Use This
- Use this when you need a repeatable process for Reddit competitor analysis API skill.
- Use this when the task needs judgment, examples, constraints, or a clear output format rather than a one-off prompt.
- Use this when you want to hand an AI assistant enough context to produce a usable marketing artifact.

## When Not To Use This
- Do not use this when you only need a quick factual answer.
- Do not use this when the work depends on private data you cannot share with the assistant.
- Do not use this as a replacement for legal, compliance, financial, or medical review.

## What You Need Before Starting
- The goal or business outcome you want.
- The audience, customer segment, or market context.
- Any source material the assistant should respect, such as notes, briefs, examples, URLs, or brand guidance.
- Constraints such as tone, length, channel, deadline, region, or approval requirements.
- A clear definition of what a good final answer should look like.

## Step-By-Step Workflow
1. State the job clearly: "Use the Reddit competitor analysis API skill guide to help me with..."
2. Add context: audience, goal, offer, channel, source material, and constraints.
3. Ask the assistant to identify missing inputs before producing the final output.
4. Have the assistant follow the skill-specific guidance below.
5. Review the result against the final checklist and ask for revisions where needed.

## Skill-Specific Guidance
- **No hallucinations, ensuring stable and precise data extraction**: Pre-set workflows avoid AI generative hallucinations.
- **No CAPTCHA issues**: No need to handle reCAPTCHA or other verification challenges.
- **No IP access restrictions or geofencing**: No need to handle regional IP limitations.
- **Faster execution**: Compared to pure AI-driven browser automation solutions, task execution is faster.
- **Extremely high cost-effectiveness**: Significantly reduces data acquisition costs compared to highly token-consuming AI solutions.
- **Description**: Search keywords for Reddit posts.
- Publication_date (Publication date)
- **Description**: Filter posts by publication date range.
- **Options**: `All time`, `Past year`, `Past month`, `Past week`, `Today`, `Past hour`
- **Description**: Sort Reddit post search results by selected criteria.
- **Options**: `Relevance`, `Hot`, `Top`, `New`, `Comment count`
- Comment_sort_by (Comment sort)

## Decision Points And Nuance
The original skill emphasizes: 📖 Introduction, ✨ Features, 🔑 API Key Guide, 🛠️ Input Parameters, 🚀 Usage (Recommended), ⏳ Task Status Monitoring, 🔧 OpenClaw Adaptation Guide, 📊 Data Output Description, ⚠️ Error Handling & Retry.

Use these questions to steer the work:
- What is the intended audience or buyer?
- What source material must be preserved?
- What should the assistant optimize for: clarity, persuasion, accuracy, speed, creativity, or conversion?
- What examples represent the desired quality bar?
- What should the assistant avoid?

## Common Mistakes
- **No hallucinations, ensuring stable and precise data extraction**: Pre-set workflows avoid AI generative hallucinations.
- Before running, you must check the `BROWSERACT_API_KEY` environment variable. If it is not set, do not take any other actions; you should request and wait for the user to provide it collaboratively.
- **The Agent must inform the user at this time**:
- As long as the terminal is still outputting new status logs, it means the task is running normally. Please do not mistakenly judge it as a deadlock or unresponsiveness.
- If the output **contains** `"Invalid authorization"`, it means the API Key is invalid or expired. At this time, **do not retry**, but guide the user to recheck and provide the correct API Key.

## Copy-And-Paste Prompt
```text
Use the Reddit competitor analysis API skill human guide.

My goal:
[Describe the business outcome]

Audience:
[Describe who this is for]

Context and source material:
[Paste notes, examples, links, or existing copy]

Constraints:
[Tone, length, channel, timeline, must-include items, must-avoid items]

Before producing the final output, ask me for any missing information that would materially improve the result.
```

## Final Checklist
- [ ] The output matches the original goal.
- [ ] The audience and context are reflected in the answer.
- [ ] Important constraints and source material were preserved.
- [ ] The assistant made the relevant decisions explicit.
- [ ] The final artifact is ready to use, review, or hand to the next person.

## Source
This guide was generated from the browser-act/skills skill entry for `reddit-competitor-analysis-api-skill`.

## Source Skill Notes
These notes preserve the nuance from the original skill. Use them as supporting reference when the workflow above feels too generic.

# Reddit Competitor Analysis API Skill

## 📖 Introduction
This skill uses the BrowserAct Reddit Competitor Analysis API template to provide users with a one-stop Reddit data collection service. It can extract full post details and comments from Reddit search results. Just input search keywords and filtering conditions to directly get clean and usable Reddit data.

## ✨ Features
1. **No hallucinations, ensuring stable and precise data extraction**: Pre-set workflows avoid AI generative hallucinations.
2. **No CAPTCHA issues**: No need to handle reCAPTCHA or other verification challenges.
3. **No IP access restrictions or geofencing**: No need to handle regional IP limitations.
4. **Faster execution**: Compared to pure AI-driven browser automation solutions, task execution is faster.
5. **Extremely high cost-effectiveness**: Significantly reduces data acquisition costs compared to highly token-consuming AI solutions.

## 🔑 API Key Guide
Before running, you must check the `BROWSERACT_API_KEY` environment variable. If it is not set, do not take any other actions; you should request and wait for the user to provide it collaboratively.
**The Agent must inform the user at this time**:
> "Since you have not configured the BrowserAct API Key, please go to the [BrowserAct Console](https://www.browseract.com/reception/integrations) to get your Key first."

## 🛠️ Input Parameters
When calling the script, the Agent should flexibly configure the following parameters based on user needs:

1. **Keywords (Search keywords)**
   - **Type**: `string`
   - **Description**: Search keywords for Reddit posts.
   - **Example**: `openclaw`

2. **Publication_date (Publication date)**
   - **Type**: `string`
   - **Description**: Filter posts by publication date range.
   - **Options**: `All time`, `Past year`, `Past month`, `Past week`, `Today`, `Past hour`
   - **Default**: `Past week`

3. **Post_sort_by (Search sort)**
   - **Type**: `string`
   - **Description**: Sort Reddit post search results by selected criteria.
   - **Options**: `Relevance`, `Hot`, `Top`, `New`, `Comment count`
   - **Default**: `Relevance`

4. **Comment_sort_by (Comment sort)**
   - **Type**: `string`
   - **Description**: Sort extracted comments by.
   - **Options**: `Best`, `Top`, `New`, `Controversial`, `Q&A`
   - **Default**: `Best`

5. **Data_limit (Comments per post)**
   - **Type**: `number`
   - **Description**: Maximum number of comments to extract per post.
   - **Default**: `10`

## 🚀 Usage (Recommended)
The Agent should execute the following independent script to achieve "one-line command to get results". Note that the script path `./scripts/...` is relative to this skill's directory:

```bash
# Example invocation
python3 -u ./scripts/reddit_competitor_analysis_api.py "keywords" "publication_date" "post_sort_by" "comment_sort_by" data_limit
```

### ⏳ Task Status Monitoring
Since this task involves automated browser operations, it may take a long time (several minutes). The script will **continuously output status logs with timestamps** (e.g., `[14:30:05] Task Status: running`) while running.
**Agent Must Know**:
- While waiting for the script to return results, please keep an eye on the terminal output.
- As long as the terminal is still outputting new status logs, it means the task is running normally. Please do not mistakenly judge it as a deadlock or unresponsiveness.
- Only if the status remains unchanged for a long time or the script stops outputting and no result is returned, you can consider triggering the retry mechanism.

## 🔧 OpenClaw Adaptation Guide
Since BrowserAct tasks may take a long time to run (5-20 minutes), when the Agent executes in the OpenClaw environment, it needs to:

1. **Run in background mode (using JSON parameters for `exec` tool):**
   - `command`: `"python3 -u ./scripts/reddit_competitor_analysis_api.py ..."`
   - `background`: `true`
   - `timeout`: `1800`

2. **Or increase yieldMs:**
   - `command`: `"python3 -u ./scripts/reddit_competitor_analysis_api.py ..."`
   - `yieldMs`: `600000`
   - `timeout`: `1800`

3. **Use process poll to monitor:**
   - `action`: `"poll"`
   - `sessionId`: `"xxx"`
   - `timeout`: `300000`
