Credential configuration
API keys, tokens, and cookies are all recommended to be written in the repository root directory .env(refer to .env.example), and loaded by the runtime or the user as environment variables with the same names before execution. Scripts still only read credentials from environment variables or explicit CLI parameters; do not write real keys into skill payloads, reports, logs, or commits.
Search the three English social platforms Reddit, Twitter/X, and YouTube.
Available scripts
| Script | Platform | Purpose | API key |
|---|---|---|---|
reddit_search.py |
Post and discussion search | Not required | |
twitter_search.py |
Twitter/X | Tweet search | Required TIKHUB_TOKEN |
youtube_search.py |
YouTube | Video search | Required YOUTUBE_API_KEY |
Dependencies
On first run or when a script prompts that a library is missing, use this skill's dependency manifest to install into the current Python environment:
python3 -m pip install -r requirements.txt
Do not automatically install dependencies inside scripts. If installation fails, the network is unavailable, or a package is unavailable, stop using the corresponding script and switch to web search, explaining the missing dependency.
Parameter description
reddit_search.py
python3 scripts/reddit_search.py <query> [选项]
| Parameter | Description | Default value |
|---|---|---|
query |
Search keyword (required) | — |
--limit, -n |
Number of results to return | 10 |
--subreddit, -r |
Limit to a subreddit (e.g. python, machinelearning) |
— |
--sort |
Sort method:relevance, hot, top, new, comments |
relevance |
--time, -t |
Time range:hour, day, week, month, year, all |
all |
python3 scripts/reddit_search.py "machine learning projects" --limit 5
python3 scripts/reddit_search.py "async python" --subreddit python --sort top --time month --limit 5
twitter_search.py
python3 scripts/twitter_search.py <query> [选项]
| Parameter | Description | Default value |
|---|---|---|
query |
Search keyword (required) | — |
--limit, -n |
Number of results to return | 10 |
--token |
TikHub Token (can also be set via the TIKHUB_TOKEN environment variable, required) |
— |
python3 scripts/twitter_search.py "AI agents" --limit 10
python3 scripts/twitter_search.py "LLM" --token your_tikhub_token --limit 5
youtube_search.py
python3 scripts/youtube_search.py <query> [选项]
| Parameter | Description | Default value |
|---|---|---|
query |
Search keyword (required) | — |
--limit, -n |
Number of results to return | 10 |
--api-key |
YouTube API key (can also be set via the YOUTUBE_API_KEY environment variable, required) |
— |
--order |
Sort method:relevance, date, viewCount, rating |
relevance |
python3 scripts/youtube_search.py "transformer explained" --limit 5
python3 scripts/youtube_search.py "python tutorial" --order viewCount --limit 10
Output format
Standard JSON:{"success": true, "query": "...", "provider": "reddit|twitter|youtube", "items": [...], "error": null}