184 lines
4.9 KiB
Markdown
184 lines
4.9 KiB
Markdown
---
|
|
name: x-via-kimi
|
|
description: Access X (Twitter) content through Kimi AI using web search or browser automation. No X API key needed - Kimi can search and summarize X posts in real-time.
|
|
---
|
|
|
|
# X via Kimi - No API Key Needed
|
|
|
|
Access X (Twitter) content through Kimi AI without needing X API access.
|
|
|
|
## Why This Works
|
|
|
|
Kimi has **real-time web search** capabilities and can access X content directly:
|
|
- ✅ No X API key required
|
|
- ✅ No X API costs ($200-5000/month)
|
|
- ✅ Real-time access to public posts
|
|
- ✅ Can search by user, hashtag, topic
|
|
- ✅ Summarizes and analyzes content
|
|
|
|
## Method 1: Kimi API (Recommended)
|
|
|
|
### Step 1: Get Kimi API Key
|
|
|
|
1. Go to https://platform.moonshot.cn/console/api-keys
|
|
2. Create a new API key
|
|
3. **Free credits**: 15 CNY (~$2) for testing
|
|
|
|
### Step 2: Query X Content
|
|
|
|
```bash
|
|
export KIMI_API_KEY="your-api-key"
|
|
|
|
curl https://api.moonshot.cn/v1/chat/completions \
|
|
-H "Content-Type: application/json" \
|
|
-H "Authorization: Bearer $KIMI_API_KEY" \
|
|
-d '{
|
|
"model": "kimi-k2.5",
|
|
"messages": [
|
|
{
|
|
"role": "user",
|
|
"content": "Search X (Twitter) for recent posts from @alexmikhalev in the last 30 days. List the main topics they discussed and any interesting insights they shared."
|
|
}
|
|
],
|
|
"tools": [{
|
|
"type": "builtin_function",
|
|
"function": {
|
|
"name": "web_search"
|
|
}
|
|
}]
|
|
}'
|
|
```
|
|
|
|
### Example Queries
|
|
|
|
**Get posts from specific user:**
|
|
```
|
|
Search X for posts by @alexmikhalev from the last 30 days.
|
|
What topics did they discuss? What links did they share?
|
|
```
|
|
|
|
**Find trending topics:**
|
|
```
|
|
What are the trending topics on X (Twitter) in AI/ML space
|
|
from the last 7 days? Who are the key voices?
|
|
```
|
|
|
|
**Research specific topic:**
|
|
```
|
|
Search X for discussions about "knowledge graphs" and "AI agents"
|
|
from the last 30 days. Summarize the key insights and debates.
|
|
```
|
|
|
|
## Method 2: Kimi.com Web Interface
|
|
|
|
### Using Browser Relay
|
|
|
|
1. **Open Chrome with Kimi:**
|
|
```bash
|
|
google-chrome "https://kimi.com" &
|
|
```
|
|
|
|
2. **Attach Browser Relay:**
|
|
- Click OpenClaw Browser Relay extension icon
|
|
- Wait for `cdpReady: true`
|
|
|
|
3. **Query X through Kimi:**
|
|
```javascript
|
|
// Type query
|
|
browser action=act profile=chrome targetId=<id> request={
|
|
"kind": "evaluate",
|
|
"fn": "(() => { const ed = document.querySelector('textarea'); if(ed) { ed.focus(); ed.value = 'Search X for @alexmikhalev posts from last 30 days'; return 'ok'; } return 'not found'; })()"
|
|
}
|
|
|
|
// Submit
|
|
browser action=act profile=chrome targetId=<id> request={"kind":"press","key":"Enter"}
|
|
```
|
|
|
|
## Method 3: Kimi Claw (Native Integration)
|
|
|
|
If you have access to Kimi Claw (https://kimi.com/bot):
|
|
|
|
1. Go to https://kimi.com/bot
|
|
2. Ask directly: "Search X for posts from @alexmikhalev last 30 days"
|
|
3. Kimi Claw has built-in web search and X access
|
|
|
|
## Cost Comparison
|
|
|
|
| Method | Cost | Setup | Reliability |
|
|
|--------|------|-------|-------------|
|
|
| **X API v2** | $200-5000/mo | Developer account | High |
|
|
| **xAI Grok API** | $0-10/mo | API key | High |
|
|
| **Kimi API** | ~$0.01/query | API key | Medium |
|
|
| **Kimi Browser** | Free | Chrome + relay | Medium |
|
|
| **Kimi Claw** | Free | Web access | High |
|
|
|
|
## Limitations
|
|
|
|
1. **Public posts only** - Can't access private accounts
|
|
2. **Search-dependent** - Relies on X's search indexing
|
|
3. **Rate limits** - Kimi API has usage limits
|
|
4. **Not real-time** - Slight delay vs direct API
|
|
|
|
## Recommended Approach
|
|
|
|
For your use case (fetching posts from people you follow):
|
|
|
|
**Option A: Kimi API (Best Balance)**
|
|
- Cost: ~$5-10/month for regular use
|
|
- Setup: Simple API key
|
|
- Reliability: Good
|
|
|
|
**Option B: Kimi Claw (If Available)**
|
|
- Cost: Free
|
|
- Setup: None (web-based)
|
|
- Reliability: Best
|
|
|
|
**Option C: Grok API (Alternative)**
|
|
- Cost: $0 (with free credits)
|
|
- Setup: xAI account
|
|
- Reliability: Good
|
|
|
|
## Quick Start Script
|
|
|
|
```bash
|
|
#!/bin/bash
|
|
# x-via-kimi.sh - Search X through Kimi
|
|
|
|
KIMI_API_KEY="${KIMI_API_KEY:-}"
|
|
USER="${1:-alexmikhalev}"
|
|
DAYS="${2:-30}"
|
|
|
|
if [ -z "$KIMI_API_KEY" ]; then
|
|
echo "Error: Set KIMI_API_KEY environment variable"
|
|
exit 1
|
|
fi
|
|
|
|
curl -s https://api.moonshot.cn/v1/chat/completions \
|
|
-H "Content-Type: application/json" \
|
|
-H "Authorization: Bearer $KIMI_API_KEY" \
|
|
-d "{
|
|
\"model\": \"kimi-k2.5\",
|
|
\"messages\": [{
|
|
\"role\": \"user\",
|
|
\"content\": \"Search X (Twitter) for posts from @$USER in the last $DAYS days. Summarize the main topics, insights, and any shared links.\"
|
|
}]
|
|
}" | jq -r '.choices[0].message.content'
|
|
```
|
|
|
|
Usage:
|
|
```bash
|
|
chmod +x x-via-kimi.sh
|
|
KIMI_API_KEY="your-key" ./x-via-kimi.sh alexmikhalev 30
|
|
```
|
|
|
|
## Next Steps
|
|
|
|
1. **Get Kimi API key**: https://platform.moonshot.cn/console/api-keys
|
|
2. **Test query**: Try searching for your X handle
|
|
3. **Automate**: Set up cron job for daily/weekly digest
|
|
|
|
**Want me to:**
|
|
- Create a skill for automated X research via Kimi?
|
|
- Set up a cron job for daily X digest?
|
|
- Create a comparison of all X access methods?
|