60s站点
第三方 via GitHub60s API 综合技能,提供每日新闻、AI资讯、热搜榜单、天气查询、数据查询、娱乐内容、媒体信息和实用工具。当用户询问新闻、热搜、天气、汇率、农历、笑话、运势、音乐排行、电影票房、翻译、IP查询等中文信息时触发。
vikiboss v1.0.0
# Dependencies
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
env/
venv/
ENV/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# IDEs
.vscode/
.idea/
*.swp
*.swo
*~
.DS_Store
# Logs
logs/
*.log
# Temporary files
tmp/
temp/
*.tmp
*.bak
*.backup
# Test coverage
coverage/
.coverage
.nyc_output
htmlcov/
# Environment variables
.env
.env.local
.env.*.local
# Build outputs
dist/
build/
out/
# Cache
.cache/
.parcel-cache/
MIT License
Copyright (c) 2026 Viki
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# 60s Skills - AI Agent Skills Collection
[](https://opensource.org/licenses/MIT)
[](https://github.com/vikiboss/60s)
A collection of [Agent Skills](https://agentskills.io) for the [60s API](https://github.com/vikiboss/60s).
## About
This repository contains skills that enable AI agents to work with the 60s API, providing access to daily news, weather, trending topics, utilities, entertainment, data queries, and media information.
## What are Agent Skills?
[Agent Skills](https://agentskills.io) are a simple, open format for giving agents new capabilities and expertise. They are folders of instructions, scripts, and resources that agents can discover and use to perform better at specific tasks.
## Repository Structure
```
60s-skills/
├── skills/ # Individual skills directory
│ ├── daily-news-60s/ # Daily news skill
│ ├── weather-query/ # Weather information
│ ├── hot-topics/ # Trending content
│ ├── utility-tools/ # Translation, IP, QR, etc.
│ ├── entertainment/ # Fun content
│ ├── data-query/ # Exchange rates, calendar, etc.
│ └── media-info/ # Music and movie info
├── README.md # This file
└── LICENSE # MIT License
```
## Available Skills
### 1. daily-news-60s
获取每天60秒读懂世界的每日新闻,包含15条精选国内外新闻和每日微语。
Get daily curated news with 15 selected items and a daily quote, updated every 30 minutes.
**Use when**: Users need daily news summaries, current events, or want to stay informed.
### 2. weather-query
查询中国各地实时天气和天气预报,包括温度、湿度、风速、空气质量等信息。
Query real-time weather and forecasts for locations in China including temperature, humidity, wind, and air quality.
**Use when**: Users ask about weather conditions, forecasts, or climate information.
### 3. hot-topics
获取微博、知乎、百度、抖音、今日头条、B站等主流平台的实时热搜榜单。
Get trending topics and hot searches from major Chinese platforms (Weibo, Zhihu, Baidu, Douyin, Toutiao, Bilibili).
**Use when**: Users want to know what's trending on social media.
### 4. utility-tools
提供实用工具功能,包括IP查询、文本翻译、二维码生成、哈希计算、网页元数据提取、WHOIS查询和密码生成。
Utility functions including IP lookup, translation, QR code generation, hashing, OG metadata extraction, WHOIS, and password generation.
**Use when**: Users need translation, IP lookup, QR codes, or other utility functions.
### 5. entertainment
获取娱乐内容,包括一言名句、笑话、段子、运势预测、KFC梗文案和摸鱼日历。
Fun content including quotes, jokes, luck predictions, memes, and slacking calendars.
**Use when**: Users want entertainment, jokes, quotes, or fun content.
### 6. data-query
查询各类数据信息,包括汇率、农历、历史事件、百科、油价、金价和化学元素。
Query various data including exchange rates, lunar calendar, historical events, encyclopedia, fuel/gold prices, and chemical elements.
**Use when**: Users need reference data, currency conversion, calendar info, or encyclopedia lookups.
### 7. media-info
获取音乐和影视信息,包括网易云音乐排行榜、歌词搜索、电影票房、电视剧收视率和网剧排行。
Get music and entertainment information including music charts, lyrics, movie box office, TV ratings, and web series rankings.
**Use when**: Users need music charts, lyrics, movie info, or entertainment rankings.
## Using Skills
Skills in this repository follow the [Agent Skills specification](https://agentskills.io/specification). Each skill:
- Has a unique name following the format: `[a-z0-9-]+`
- Contains a `SKILL.md` file with YAML frontmatter and instructions
- Provides clear guidance on when and how to use the skill
- Includes code examples and use cases
## About 60s API
[60s API](https://github.com/vikiboss/60s) is a collection of high-quality, open-source APIs providing:
- 📰 Daily news (60 seconds to read the world)
- 🌤️ Weather information and forecasts
- 🔥 Trending topics from major platforms
- 🛠️ Utility tools (IP, translation, QR codes, etc.)
- 🎉 Entertainment content (jokes, quotes, memes)
- 📊 Data queries (exchange rates, calendar, encyclopedia)
- 🎵 Music and movie information
**Features:**
- ✅ Free, no authentication required
- ✅ Millisecond-level cached responses
- ✅ Global CDN acceleration
- ✅ Regular updates
- ✅ High-quality curated data
## Quick Start
### For AI Agents
Simply provide agents access to the skills in this repository. Each `SKILL.md` file contains all the information needed to use that skill effectively.
### For Developers
Each skill provides:
- Clear API endpoint documentation
- Python code examples
- Common use cases
- Best practices
- Troubleshooting tips
Example from `daily-news-60s`:
```python
import requests
response = requests.get('https://60s.viki.moe/v2/60s')
news = response.json()
print(f"📰 {news['date']} 新闻简报")
for i, item in enumerate(news['news'], 1):
print(f"{i}. {item['title']}")
```
## Contributing
Contributions are welcome! To add improvements:
1. Fork this repository
2. Make your changes to skills or add new skills
3. Ensure each skill follows the Agent Skills specification
4. Submit a pull request
When creating new skills:
- Use lowercase with hyphens for directory names
- Include YAML frontmatter in SKILL.md
- Provide clear instructions and examples
- Test with actual API endpoints
## Related Resources
- **60s API Project**: https://github.com/vikiboss/60s
- **API Documentation**: https://docs.60s-api.viki.moe
- **Official Instance**: https://60s.viki.moe
- **Agent Skills Specification**: https://agentskills.io/specification
## License
This repository is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
The 60s API project is also licensed under MIT.
---
Made with ❤️ for the AI Agent Community
---
name: daily-news-60s
description: 获取每天60秒读懂世界的每日新闻,包含15条精选国内外新闻和每日微语。Use when users need daily news summaries, current events, or want to stay informed about world news in Chinese.
license: MIT
metadata:
author: vikiboss
version: "1.0"
api_base: https://60s.viki.moe/v2
tags:
- news
- daily
- china
- information
---
# 每天60秒读懂世界 - Daily News Skill
This skill helps AI agents fetch and present daily curated news from the 60s API, which provides 15 selected news items plus a daily quote, updated every 30 minutes.
## When to Use This Skill
Use this skill when users:
- Ask for today's news or current events
- Want a quick daily briefing
- Request news summaries in Chinese
- Need historical news from a specific date
- Want news in different formats (text, markdown, image)
## API Endpoint
**Base URL:** `https://60s.viki.moe/v2/60s`
**Method:** GET
## Parameters
- `date` (optional): Date in YYYY-MM-DD format (e.g., "2024-01-15")
- If not provided, returns the latest available news
- `encoding` (optional): Output format
- `json` (default): Structured JSON data
- `text`: Plain text format
- `markdown`: Formatted markdown
- `image`: Redirect to image URL
- `image-proxy`: Returns image binary data
## How to Use
### Basic Usage - Get Latest News
```bash
curl "https://60s.viki.moe/v2/60s"
```
```python
import requests
response = requests.get('https://60s.viki.moe/v2/60s')
news = response.json()
print(f"📰 {news['date']} 新闻简报")
print(f"农历:{news['lunar_date']} {news['day_of_week']}\n")
for i, item in enumerate(news['news'], 1):
print(f"{i}. {item['title']}")
print(f"\n💭 微语:{news['tip']}")
```
### Get News for Specific Date
```python
response = requests.get('https://60s.viki.moe/v2/60s', params={'date': '2024-01-15'})
```
### Get News as Markdown
```python
response = requests.get('https://60s.viki.moe/v2/60s', params={'encoding': 'markdown'})
markdown_content = response.text
```
### Get News as Plain Text
```python
response = requests.get('https://60s.viki.moe/v2/60s', params={'encoding': 'text'})
text_content = response.text
```
## Response Format (JSON)
```json
{
"date": "2024-01-15",
"day_of_week": "星期一",
"lunar_date": "腊月初五",
"news": [
{
"title": "新闻标题1",
"link": "https://example.com/news1"
},
...
],
"tip": "每日微语内容",
"image": "https://..../image.png",
"updated": "2024-01-15 09:00:00",
"updated_at": 1705280400000,
"api_updated": "2024-01-15 09:00:00",
"api_updated_at": 1705280400000
}
```
## Example Interactions
### User Request: "今天有什么新闻?"
**Agent Response:**
```
📰 2024年1月15日 星期一 农历腊月初五
【今日要闻】
1. 新闻标题1
2. 新闻标题2
3. 新闻标题3
...
💭 微语:[每日微语内容]
```
### User Request: "Get yesterday's news"
```python
from datetime import datetime, timedelta
yesterday = (datetime.now() - timedelta(days=1)).strftime('%Y-%m-%d')
response = requests.get('https://60s.viki.moe/v2/60s', params={'date': yesterday})
```
## Best Practices
1. **Caching**: The API has built-in caching, responses are very fast
2. **Update Frequency**: News updates every 30 minutes, typically by 10 AM
3. **Error Handling**: Always check response status and handle errors gracefully
4. **Format Selection**: Use JSON for structured data, markdown for formatted output, text for simple presentation
5. **Date Validation**: When requesting specific dates, ensure the date format is YYYY-MM-DD
## Common Use Cases
### 1. Daily News Bot
```python
def send_morning_news():
news = requests.get('https://60s.viki.moe/v2/60s').json()
message = f"早安!今天是 {news['date']} {news['day_of_week']}\n\n"
message += "\n".join([f"{i}. {item['title']}" for i, item in enumerate(news['news'][:5], 1)])
message += f"\n\n{news['tip']}"
return message
```
### 2. News Summary for Chatbots
```python
def get_news_summary(count=5):
news = requests.get('https://60s.viki.moe/v2/60s').json()
return {
'date': news['date'],
'headlines': [item['title'] for item in news['news'][:count]],
'quote': news['tip']
}
```
### 3. Historical News Lookup
```python
def get_historical_news(date_str):
response = requests.get('https://60s.viki.moe/v2/60s', params={'date': date_str})
if response.ok:
return response.json()
return None
```
## Troubleshooting
### Issue: No data returned
- **Solution**: Try requesting previous dates (yesterday or the day before)
- The service tries latest 3 days automatically
### Issue: Image not loading
- **Solution**: Use `encoding=image-proxy` instead of `encoding=image`
- The proxy endpoint directly returns image binary data
### Issue: Old date requested
- **Solution**: Data is only available for recent dates
- Check the response status code
## API Characteristics
- ✅ **Free**: No authentication required
- ✅ **Fast**: Millisecond-level cached responses
- ✅ **Reliable**: Global CDN acceleration
- ✅ **Updated**: Every 30 minutes
- ✅ **Quality**: 15 curated news items from authoritative sources
## Related Resources
- [60s API Documentation](https://docs.60s-api.viki.moe)
- [GitHub Repository](https://github.com/vikiboss/60s)
- [Data Source Repository](https://github.com/vikiboss/60s-static-host)
---
name: data-query
description: 查询各类数据信息,包括汇率、农历、历史事件、百科、油价、金价和化学元素。Use when users need exchange rates, lunar calendar, historical events, encyclopedia, commodity prices, or chemical element information.
license: MIT
metadata:
author: vikiboss
version: "1.0"
api_base: https://60s.viki.moe/v2
tags:
- data
- information
- query
- reference
---
# Data Query Skill
Query various data and information including exchange rates, calendar, history, encyclopedia, and prices.
## Available Queries
1. **Exchange Rates** - Currency conversion rates
2. **Lunar Calendar** - Chinese lunar calendar conversion
3. **Today in History** - Historical events
4. **Encyclopedia (Baike)** - Search Chinese encyclopedia
5. **Fuel Prices** - Gasoline/diesel prices in China
6. **Gold Prices** - Current gold prices
7. **Chemical Elements** - Element information
## API Endpoints
| Query Type | Endpoint | Method |
|------------|----------|--------|
| Exchange Rate | `/v2/exchange-rate` | GET |
| Lunar Calendar | `/v2/lunar` | GET |
| History | `/v2/today-in-history` | GET |
| Encyclopedia | `/v2/baike` | GET |
| Fuel Price | `/v2/fuel-price` | GET |
| Gold Price | `/v2/gold-price` | GET |
| Chemical | `/v2/chemical` | GET |
## Quick Examples
### Exchange Rates
```python
import requests
# Get exchange rate
params = {'from': 'USD', 'to': 'CNY'}
response = requests.get('https://60s.viki.moe/v2/exchange-rate', params=params)
rate = response.json()
print(f"💱 1 {rate['from']} = {rate['rate']} {rate['to']}")
print(f"更新时间:{rate['update_time']}")
```
### Lunar Calendar
```python
# Get today's lunar date
response = requests.get('https://60s.viki.moe/v2/lunar')
lunar = response.json()
print(f"📅 公历:{lunar['solar_date']}")
print(f"🏮 农历:{lunar['lunar_date']}")
print(f"🐲 生肖:{lunar['zodiac']}")
print(f"🌾 节气:{lunar['solar_term']}")
# Specific date
params = {'date': '2024-01-15'}
response = requests.get('https://60s.viki.moe/v2/lunar', params=params)
```
### Today in History
```python
# Get today's historical events
response = requests.get('https://60s.viki.moe/v2/today-in-history')
history = response.json()
print(f"📜 历史上的今天 ({history['date']})")
for event in history['events'][:5]:
print(f"{event['year']}年:{event['title']}")
# Specific date
params = {'month': 1, 'day': 15}
response = requests.get('https://60s.viki.moe/v2/today-in-history', params=params)
```
### Encyclopedia Search
```python
# Search encyclopedia
params = {'keyword': 'Python编程'}
response = requests.get('https://60s.viki.moe/v2/baike', params=params)
result = response.json()
print(f"📖 {result['title']}")
print(f"📝 {result['summary']}")
print(f"🔗 {result['url']}")
```
### Fuel Prices
```python
# Get fuel prices
params = {'province': '北京'}
response = requests.get('https://60s.viki.moe/v2/fuel-price', params=params)
prices = response.json()
print(f"⛽ {prices['province']} 油价")
print(f"92号汽油:{prices['92号汽油']} 元/升")
print(f"95号汽油:{prices['95号汽油']} 元/升")
print(f"98号汽油:{prices['98号汽油']} 元/升")
print(f"0号柴油:{prices['0号柴油']} 元/升")
```
### Gold Prices
```python
# Get current gold prices
response = requests.get('https://60s.viki.moe/v2/gold-price')
gold = response.json()
print(f"💰 黄金价格")
print(f"国际金价:{gold['国际金价']} 美元/盎司")
print(f"国内金价:{gold['国内金价']} 元/克")
print(f"更新时间:{gold['update_time']}")
```
### Chemical Elements
```python
# Search chemical element
params = {'query': 'H'} # Can be symbol, name, or atomic number
response = requests.get('https://60s.viki.moe/v2/chemical', params=params)
element = response.json()
print(f"⚛️ {element['name']} ({element['symbol']})")
print(f"原子序数:{element['atomic_number']}")
print(f"原子量:{element['atomic_mass']}")
print(f"元素类别:{element['category']}")
```
## Use Cases
### Currency Converter Bot
```python
def convert_currency(amount, from_currency, to_currency):
params = {'from': from_currency, 'to': to_currency}
response = requests.get('https://60s.viki.moe/v2/exchange-rate', params=params)
rate = response.json()
converted = amount * float(rate['rate'])
return f"{amount} {from_currency} = {converted:.2f} {to_currency}"
# Usage
print(convert_currency(100, 'USD', 'CNY')) # 100 USD = 725.50 CNY
```
### Historical Event Reminder
```python
def get_today_history():
response = requests.get('https://60s.viki.moe/v2/today-in-history')
history = response.json()
message = f"📜 历史上的今天 ({history['date']})\n\n"
for event in history['events'][:3]:
message += f"· {event['year']}年:{event['title']}\n"
return message
```
### Lunar Calendar Widget
```python
def get_lunar_info():
response = requests.get('https://60s.viki.moe/v2/lunar')
lunar = response.json()
return f"""
📅 今日日历
公历:{lunar['solar_date']} {lunar['weekday']}
农历:{lunar['lunar_date']}
生肖:{lunar['zodiac']}
节气:{lunar['solar_term'] or '无'}
"""
```
## Example Interactions
### User: "美元兑人民币汇率是多少?"
```python
params = {'from': 'USD', 'to': 'CNY'}
response = requests.get('https://60s.viki.moe/v2/exchange-rate', params=params)
rate = response.json()
print(f"💱 1 美元 = {rate['rate']} 人民币")
```
### User: "今天农历是几月几号?"
```python
lunar = requests.get('https://60s.viki.moe/v2/lunar').json()
print(f"🏮 今天是农历 {lunar['lunar_date']}")
print(f"🐲 生肖:{lunar['zodiac']}")
```
### User: "查询一下氢元素的信息"
```python
params = {'query': '氢'}
element = requests.get('https://60s.viki.moe/v2/chemical', params=params).json()
print(f"⚛️ {element['name']} (H)")
print(f"原子序数:{element['atomic_number']}")
print(f"元素类别:{element['category']}")
```
## Related Resources
- [60s API Documentation](https://docs.60s-api.viki.moe)
- [GitHub Repository](https://github.com/vikiboss/60s)
---
name: entertainment
description: 获取娱乐内容,包括一言名句、英文笑话、中文段子、运势预测、KFC梗文案和摸鱼日历。Use when users want fun content, jokes, quotes, daily luck predictions, or entertainment.
license: MIT
metadata:
author: vikiboss
version: "1.0"
api_base: https://60s.viki.moe/v2
tags:
- entertainment
- fun
- jokes
- quotes
---
# Entertainment Content Skill
Get fun and entertaining content including quotes, jokes, luck predictions, and memes.
## Available Content
1. **Hitokoto (一言)** - Random meaningful quotes
2. **Dad Jokes** - English dad jokes
3. **Duanzi (段子)** - Chinese jokes/funny stories
4. **Luck Prediction** - Daily fortune telling
5. **KFC Meme** - Crazy Thursday meme text
6. **Moyu Calendar** - Slacking off calendar
## API Endpoints
| Content | Endpoint | Method |
|---------|----------|--------|
| Hitokoto | `/v2/hitokoto` | GET |
| Dad Joke | `/v2/dad-joke` | GET |
| Duanzi | `/v2/duanzi` | GET |
| Luck | `/v2/luck` | GET |
| KFC Meme | `/v2/kfc` | GET |
| Moyu | `/v2/moyu` | GET |
## Quick Examples
### Get Random Quote (Hitokoto)
```python
import requests
# Get random quote
response = requests.get('https://60s.viki.moe/v2/hitokoto')
quote = response.json()
print(f"📖 {quote['hitokoto']}")
print(f" —— {quote['from']}")
# With category
params = {'category': 'anime'} # anime, comic, game, literature, original, internet, other
response = requests.get('https://60s.viki.moe/v2/hitokoto', params=params)
```
### Get Dad Joke
```python
response = requests.get('https://60s.viki.moe/v2/dad-joke')
joke = response.json()
print(f"😄 {joke['setup']}")
print(f" {joke['punchline']}")
```
### Get Chinese Joke (Duanzi)
```python
response = requests.get('https://60s.viki.moe/v2/duanzi')
duanzi = response.json()
print(f"😂 {duanzi['content']}")
```
### Get Daily Luck
```python
response = requests.get('https://60s.viki.moe/v2/luck')
luck = response.json()
print(f"🔮 今日运势")
print(f"综合运势:{luck['总运势']}")
print(f"爱情运势:{luck['爱情运势']}")
print(f"事业运势:{luck['事业运势']}")
print(f"财富运势:{luck['财富运势']}")
print(f"幸运颜色:{luck['幸运颜色']}")
print(f"幸运数字:{luck['幸运数字']}")
```
### Get KFC Meme Text
```python
response = requests.get('https://60s.viki.moe/v2/kfc')
meme = response.json()
print(f"🍗 {meme['text']}")
```
### Get Moyu Calendar
```python
response = requests.get('https://60s.viki.moe/v2/moyu')
# Returns image
with open('moyu.jpg', 'wb') as f:
f.write(response.content)
```
## Use Cases
### Daily Entertainment Bot
```python
def get_morning_entertainment():
quote = requests.get('https://60s.viki.moe/v2/hitokoto').json()
luck = requests.get('https://60s.viki.moe/v2/luck').json()
message = f"""
☀️ 早安!
📖 每日一言
{quote['hitokoto']}
—— {quote['from']}
🔮 今日运势
综合:{luck['总运势']} ⭐
幸运色:{luck['幸运颜色']}
"""
return message
```
### Chatbot Fun Commands
```python
def handle_fun_command(command):
if 'joke' in command or '笑话' in command:
joke = requests.get('https://60s.viki.moe/v2/duanzi').json()
return f"😂 {joke['content']}"
elif 'quote' in command or '名言' in command:
quote = requests.get('https://60s.viki.moe/v2/hitokoto').json()
return f"📖 {quote['hitokoto']} —— {quote['from']}"
elif 'luck' in command or '运势' in command:
luck = requests.get('https://60s.viki.moe/v2/luck').json()
return f"🔮 今日运势:{luck['总运势']}\n幸运色:{luck['幸运颜色']}"
elif 'kfc' in command:
meme = requests.get('https://60s.viki.moe/v2/kfc').json()
return f"🍗 {meme['text']}"
```
## Example Interactions
### User: "讲个笑话"
```python
duanzi = requests.get('https://60s.viki.moe/v2/duanzi').json()
print(f"😂 {duanzi['content']}")
```
### User: "今天运势怎么样?"
```python
luck = requests.get('https://60s.viki.moe/v2/luck').json()
response = f"""
🔮 您今日的运势:
综合运势:{luck['总运势']}
爱情运势:{luck['爱情运势']}
事业运势:{luck['事业运势']}
财富运势:{luck['财富运势']}
💡 幸运提示
幸运颜色:{luck['幸运颜色']}
幸运数字:{luck['幸运数字']}
"""
```
### User: "给我一句励志的话"
```python
params = {'category': 'literature'}
quote = requests.get('https://60s.viki.moe/v2/hitokoto', params=params).json()
print(f"✨ {quote['hitokoto']}\n —— {quote['from']}")
```
## Related Resources
- [60s API Documentation](https://docs.60s-api.viki.moe)
- [GitHub Repository](https://github.com/vikiboss/60s)
---
name: hot-topics
description: 获取微博、知乎、百度、抖音、今日头条、B站等主流中文平台的实时热搜榜单和热门话题。Use when users want to know trending topics, hot searches, or popular content on Chinese social media platforms.
license: MIT
metadata:
author: vikiboss
version: "1.0"
api_base: https://60s.viki.moe/v2
tags:
- trending
- social-media
- hot-search
- china
---
# Hot Topics & Trending Content Skill
This skill helps AI agents fetch trending topics and hot searches from major Chinese social media and content platforms.
## When to Use This Skill
Use this skill when users:
- Want to know what's trending on social media
- Ask about hot topics or viral content
- Need to understand current popular discussions
- Want to track trending topics across platforms
- Research social media trends
## Supported Platforms
1. **Weibo (微博)** - Chinese Twitter equivalent
2. **Zhihu (知乎)** - Chinese Quora equivalent
3. **Baidu (百度)** - China's largest search engine
4. **Douyin (抖音)** - TikTok China
5. **Toutiao (今日头条)** - ByteDance news aggregator
6. **Bilibili (B站)** - Chinese YouTube equivalent
## API Endpoints
| Platform | Endpoint | Description |
|----------|----------|-------------|
| Weibo | `/v2/weibo` | Weibo hot search topics |
| Zhihu | `/v2/zhihu` | Zhihu trending questions |
| Baidu | `/v2/baidu/hot` | Baidu hot searches |
| Douyin | `/v2/douyin` | Douyin trending videos |
| Toutiao | `/v2/toutiao` | Toutiao hot news |
| Bilibili | `/v2/bili` | Bilibili trending videos |
All endpoints use **GET** method and base URL: `https://60s.viki.moe/v2`
## How to Use
### Get Weibo Hot Searches
```python
import requests
def get_weibo_hot():
response = requests.get('https://60s.viki.moe/v2/weibo')
return response.json()
hot_topics = get_weibo_hot()
print("🔥 微博热搜:")
for i, topic in enumerate(hot_topics['data'][:10], 1):
print(f"{i}. {topic['title']} - 热度: {topic['热度']}")
```
### Get Zhihu Hot Topics
```python
def get_zhihu_hot():
response = requests.get('https://60s.viki.moe/v2/zhihu')
return response.json()
topics = get_zhihu_hot()
print("💡 知乎热榜:")
for topic in topics['data'][:10]:
print(f"· {topic['title']}")
```
### Get Multiple Platform Trends
```python
def get_all_hot_topics():
platforms = {
'weibo': 'https://60s.viki.moe/v2/weibo',
'zhihu': 'https://60s.viki.moe/v2/zhihu',
'baidu': 'https://60s.viki.moe/v2/baidu/hot',
'douyin': 'https://60s.viki.moe/v2/douyin',
'bili': 'https://60s.viki.moe/v2/bili'
}
results = {}
for name, url in platforms.items():
try:
response = requests.get(url)
results[name] = response.json()
except:
results[name] = None
return results
# Usage
all_topics = get_all_hot_topics()
```
### Simple bash examples
```bash
# Weibo hot search
curl "https://60s.viki.moe/v2/weibo"
# Zhihu trending
curl "https://60s.viki.moe/v2/zhihu"
# Baidu hot search
curl "https://60s.viki.moe/v2/baidu/hot"
# Douyin trending
curl "https://60s.viki.moe/v2/douyin"
# Bilibili trending
curl "https://60s.viki.moe/v2/bili"
```
## Response Format
Responses typically include:
```json
{
"data": [
{
"title": "话题标题",
"url": "https://...",
"热度": "1234567",
"rank": 1
},
...
],
"update_time": "2024-01-15 14:00:00"
}
```
## Example Interactions
### User: "现在微博上什么最火?"
```python
hot = get_weibo_hot()
top_5 = hot['data'][:5]
response = "🔥 微博热搜 TOP 5:\n\n"
for i, topic in enumerate(top_5, 1):
response += f"{i}. {topic['title']}\n"
response += f" 热度:{topic.get('热度', 'N/A')}\n\n"
```
### User: "知乎上大家在讨论什么?"
```python
zhihu = get_zhihu_hot()
response = "💡 知乎当前热门话题:\n\n"
for topic in zhihu['data'][:8]:
response += f"· {topic['title']}\n"
```
### User: "对比各平台热点"
```python
def compare_platform_trends():
all_topics = get_all_hot_topics()
summary = "📊 各平台热点概览\n\n"
platforms = {
'weibo': '微博',
'zhihu': '知乎',
'baidu': '百度',
'douyin': '抖音',
'bili': 'B站'
}
for key, name in platforms.items():
if all_topics.get(key):
top_topic = all_topics[key]['data'][0]
summary += f"{name}:{top_topic['title']}\n"
return summary
```
## Best Practices
1. **Rate Limiting**: Don't call APIs too frequently, data updates every few minutes
2. **Error Handling**: Always handle network errors and invalid responses
3. **Caching**: Cache results for 5-10 minutes to reduce API calls
4. **Top N**: Usually showing top 5-10 items is sufficient
5. **Context**: Provide platform context when showing trending topics
## Common Use Cases
### 1. Daily Trending Summary
```python
def get_daily_trending_summary():
weibo = get_weibo_hot()
zhihu = get_zhihu_hot()
summary = "📱 今日热点速览\n\n"
summary += "【微博热搜】\n"
summary += "\n".join([f"{i}. {t['title']}"
for i, t in enumerate(weibo['data'][:3], 1)])
summary += "\n\n【知乎热榜】\n"
summary += "\n".join([f"{i}. {t['title']}"
for i, t in enumerate(zhihu['data'][:3], 1)])
return summary
```
### 2. Find Common Topics Across Platforms
```python
def find_common_topics():
all_topics = get_all_hot_topics()
# Extract titles from all platforms
all_titles = []
for platform_data in all_topics.values():
if platform_data and 'data' in platform_data:
all_titles.extend([t['title'] for t in platform_data['data']])
# Simple keyword matching (can be improved)
from collections import Counter
keywords = []
for title in all_titles:
keywords.extend(title.split())
common = Counter(keywords).most_common(10)
return f"🔍 热门关键词:{', '.join([k for k, _ in common])}"
```
### 3. Platform-specific Trending Alert
```python
def check_trending_topic(keyword):
platforms = ['weibo', 'zhihu', 'baidu']
found_in = []
for platform in platforms:
url = f'https://60s.viki.moe/v2/{platform}' if platform != 'baidu' else 'https://60s.viki.moe/v2/baidu/hot'
data = requests.get(url).json()
for topic in data['data']:
if keyword.lower() in topic['title'].lower():
found_in.append(platform)
break
if found_in:
return f"✅ 话题 '{keyword}' 正在以下平台trending: {', '.join(found_in)}"
return f"❌ 话题 '{keyword}' 未在主流平台trending"
```
### 4. Trending Content Recommendation
```python
def recommend_content_by_interest(interest):
"""Recommend trending content based on user interest"""
all_topics = get_all_hot_topics()
recommendations = []
for platform, data in all_topics.items():
if data and 'data' in data:
for topic in data['data']:
if interest.lower() in topic['title'].lower():
recommendations.append({
'platform': platform,
'title': topic['title'],
'url': topic.get('url', '')
})
return recommendations
```
## Platform-Specific Notes
### Weibo (微博)
- Updates frequently (every few minutes)
- Includes "热度" (heat score)
- Some topics may have tags like "热" or "新"
### Zhihu (知乎)
- Focuses on questions and discussions
- Usually more in-depth topics
- Great for understanding what people are curious about
### Baidu (百度)
- Reflects search trends
- Good indicator of mainstream interest
- Includes various categories
### Douyin (抖音)
- Video-focused trending
- Entertainment and lifestyle content
- Young audience interests
### Bilibili (B站)
- Video platform trends
- ACG (Anime, Comic, Games) culture
- Creative content focus
## Troubleshooting
### Issue: Empty or null data
- **Solution**: API might be updating, retry after a few seconds
- Check network connectivity
### Issue: Old timestamps
- **Solution**: Data is cached, this is normal
- Most platforms update every 5-15 minutes
### Issue: Missing platform
- **Solution**: Ensure correct endpoint URL
- Check API documentation for changes
## Related Resources
- [60s API Documentation](https://docs.60s-api.viki.moe)
- [GitHub Repository](https://github.com/vikiboss/60s)
---
name: media-info
description: 获取音乐和影视相关信息,包括网易云音乐排行榜、歌词搜索、电影票房排行、电视剧收视率和网剧排行。Use when users need music charts, lyrics, movie box office, TV ratings, or entertainment rankings.
license: MIT
metadata:
author: vikiboss
version: "1.0"
api_base: https://60s.viki.moe/v2
tags:
- music
- movies
- entertainment
- media
---
# Media Information Skill
Get music and movie information including charts, lyrics, box office, and ratings.
## Available Information
1. **Netease Music Ranks** - Music chart lists
2. **Music Rank Details** - Detailed song lists
3. **Lyrics Search** - Find song lyrics
4. **Movie Information** - All movies database
5. **Movie Box Office** - Real-time box office rankings
6. **TV Ratings** - TV drama ratings
7. **Web Series Rankings** - Online series popularity
## API Endpoints
| Type | Endpoint | Method |
|------|----------|--------|
| Music Ranks | `/v2/ncm-rank/list` | GET |
| Rank Detail | `/v2/ncm-rank/{id}` | GET |
| Lyrics | `/v2/lyric` | POST |
| All Movies | `/v2/maoyan/all/movie` | GET |
| Box Office | `/v2/maoyan/realtime/movie` | GET |
| TV Ratings | `/v2/maoyan/realtime/tv` | GET |
| Web Series | `/v2/maoyan/realtime/web` | GET |
## Quick Examples
### Netease Music Charts
```python
import requests
# Get all music rank lists
response = requests.get('https://60s.viki.moe/v2/ncm-rank/list')
ranks = response.json()
print("🎵 网易云音乐榜单")
for rank in ranks['data']:
print(f"· {rank['name']} (ID: {rank['id']})")
# Get specific rank details
rank_id = '3778678' # 飙升榜
response = requests.get(f'https://60s.viki.moe/v2/ncm-rank/{rank_id}')
songs = response.json()
print(f"\n🎵 {songs['name']}")
for i, song in enumerate(songs['songs'][:10], 1):
print(f"{i}. {song['name']} - {song['artist']}")
```
### Lyrics Search
```python
# Search for lyrics
data = {'keyword': '稻香 周杰伦'}
response = requests.post('https://60s.viki.moe/v2/lyric', json=data)
result = response.json()
print(f"🎤 {result['song']} - {result['artist']}")
print(f"\n{result['lyrics']}")
```
### Movie Box Office
```python
# Get real-time box office
response = requests.get('https://60s.viki.moe/v2/maoyan/realtime/movie')
movies = response.json()
print("🎬 实时电影票房")
for movie in movies['data'][:5]:
print(f"{movie['rank']}. {movie['name']}")
print(f" 票房:{movie['box_office']}")
print(f" 上座率:{movie['attendance_rate']}")
```
### TV Ratings
```python
# Get TV drama ratings
response = requests.get('https://60s.viki.moe/v2/maoyan/realtime/tv')
shows = response.json()
print("📺 电视剧收视率排行")
for show in shows['data'][:5]:
print(f"{show['rank']}. {show['name']}")
print(f" 收视率:{show['rating']}")
```
### Web Series Rankings
```python
# Get web series rankings
response = requests.get('https://60s.viki.moe/v2/maoyan/realtime/web')
series = response.json()
print("📱 网剧热度排行")
for s in series['data'][:5]:
print(f"{s['rank']}. {s['name']}")
print(f" 热度:{s['popularity']}")
```
## Use Cases
### Music Recommendation Bot
```python
def get_trending_music():
# Get soaring charts (飙升榜)
response = requests.get('https://60s.viki.moe/v2/ncm-rank/3778678')
songs = response.json()
message = "🎵 当前最火的歌曲:\n\n"
for i, song in enumerate(songs['songs'][:5], 1):
message += f"{i}. {song['name']} - {song['artist']}\n"
return message
```
### Movie Box Office Tracker
```python
def get_box_office_summary():
response = requests.get('https://60s.viki.moe/v2/maoyan/realtime/movie')
movies = response.json()
top_3 = movies['data'][:3]
summary = "🎬 今日票房TOP3\n\n"
for movie in top_3:
summary += f"🏆 {movie['rank']}. {movie['name']}\n"
summary += f" 💰 票房:{movie['box_office']}\n"
summary += f" 📊 上座率:{movie['attendance_rate']}\n\n"
return summary
```
### Lyrics Finder
```python
def find_lyrics(song_name, artist=''):
keyword = f"{song_name} {artist}".strip()
data = {'keyword': keyword}
response = requests.post('https://60s.viki.moe/v2/lyric', json=data)
result = response.json()
if result.get('lyrics'):
return f"🎤 {result['song']} - {result['artist']}\n\n{result['lyrics']}"
else:
return "未找到歌词"
```
### Entertainment Digest
```python
def get_entertainment_digest():
# Music
music_rank = requests.get('https://60s.viki.moe/v2/ncm-rank/3778678').json()
top_song = music_rank['songs'][0]
# Movies
movies = requests.get('https://60s.viki.moe/v2/maoyan/realtime/movie').json()
top_movie = movies['data'][0]
# TV shows
shows = requests.get('https://60s.viki.moe/v2/maoyan/realtime/tv').json()
top_show = shows['data'][0]
digest = f"""
🎭 娱乐资讯速递
🎵 音乐:{top_song['name']} - {top_song['artist']}
🎬 电影:{top_movie['name']} 票房{top_movie['box_office']}
📺 电视剧:{top_show['name']} 收视率{top_show['rating']}
"""
return digest
```
## Example Interactions
### User: "现在什么歌最火?"
```python
response = requests.get('https://60s.viki.moe/v2/ncm-rank/3778678')
songs = response.json()
print("🎵 网易云飙升榜 TOP 5")
for i, song in enumerate(songs['songs'][:5], 1):
print(f"{i}. {song['name']} - {song['artist']}")
```
### User: "帮我找《稻香》的歌词"
```python
data = {'keyword': '稻香'}
response = requests.post('https://60s.viki.moe/v2/lyric', json=data)
result = response.json()
print(f"🎤 {result['song']} - {result['artist']}\n")
print(result['lyrics'])
```
### User: "今天电影票房排行"
```python
response = requests.get('https://60s.viki.moe/v2/maoyan/realtime/movie')
movies = response.json()
print("🎬 实时票房排行")
for movie in movies['data'][:5]:
print(f"{movie['rank']}. {movie['name']} - {movie['box_office']}")
```
## Best Practices
1. **Music Ranks**: Cache rank lists as they don't change frequently
2. **Lyrics**: Include artist name in search for better accuracy
3. **Box Office**: Data updates frequently, show timestamp
4. **Error Handling**: Handle cases where lyrics or data not found
5. **Formatting**: Present data in a clean, readable format
## Related Resources
- [60s API Documentation](https://docs.60s-api.viki.moe)
- [GitHub Repository](https://github.com/vikiboss/60s)
---
name: utility-tools
description: 提供实用工具功能,包括IP地址查询、文本翻译、二维码生成、哈希计算、网页元数据提取、域名WHOIS查询和密码生成。Use when users need translation, IP lookup, QR codes, hashing, domain info, or password generation.
license: MIT
metadata:
author: vikiboss
version: "1.0"
api_base: https://60s.viki.moe/v2
tags:
- utility
- translation
- tools
- security
---
# Utility Tools Skill
This skill provides various utility functions for common tasks like translation, IP lookup, QR code generation, and more.
## Available Tools
1. **IP Address Lookup** - Get location and ISP info for any IP
2. **Text Translation** - Translate between multiple languages
3. **QR Code Generation** - Create QR codes for any text/URL
4. **Hash Calculation** - Calculate MD5, SHA1, SHA256, SHA512
5. **OG Metadata Extraction** - Extract Open Graph metadata from URLs
6. **WHOIS Lookup** - Domain registration information
7. **Password Generation** - Generate secure random passwords
## API Endpoints
| Tool | Endpoint | Method |
|------|----------|--------|
| IP Lookup | `/v2/ip` | GET |
| Translation | `/v2/fanyi` | POST |
| QR Code | `/v2/qrcode` | GET |
| Hash | `/v2/hash` | POST |
| OG Metadata | `/v2/og` | POST |
| WHOIS | `/v2/whois` | GET |
| Password | `/v2/password` | GET |
## 1. IP Address Lookup
```python
import requests
# Lookup specific IP
response = requests.get('https://60s.viki.moe/v2/ip', params={'ip': '8.8.8.8'})
ip_info = response.json()
print(f"IP: {ip_info['ip']}")
print(f"Location: {ip_info['location']}")
print(f"ISP: {ip_info['isp']}")
# Get your own IP info (no params)
my_ip = requests.get('https://60s.viki.moe/v2/ip').json()
```
## 2. Text Translation
```python
# Translate text
data = {
'text': 'Hello World',
'from': 'en', # or 'auto' for auto-detection
'to': 'zh' # target language
}
response = requests.post('https://60s.viki.moe/v2/fanyi', json=data)
translation = response.json()
print(f"Original: {translation['text']}")
print(f"Translated: {translation['result']}")
print(f"From: {translation['from']} To: {translation['to']}")
```
**Supported Languages:**
- `zh` - Chinese
- `en` - English
- `ja` - Japanese
- `ko` - Korean
- `fr` - French
- `de` - German
- `es` - Spanish
- `ru` - Russian
- And more...
```python
# Get supported languages
response = requests.post('https://60s.viki.moe/v2/fanyi/langs')
languages = response.json()
```
## 3. QR Code Generation
```python
# Generate QR code
params = {
'text': 'https://github.com/vikiboss/60s',
'size': 300 # pixels, default 200, min 50, max 1000
}
response = requests.get('https://60s.viki.moe/v2/qrcode', params=params)
# Save the QR code image
with open('qrcode.png', 'wb') as f:
f.write(response.content)
```
## 4. Hash Calculation
```python
# Calculate hash
data = {
'text': 'Hello World',
'algorithm': 'md5' # md5, sha1, sha256, sha512
}
response = requests.post('https://60s.viki.moe/v2/hash', json=data)
result = response.json()
print(f"Algorithm: {result['algorithm']}")
print(f"Hash: {result['hash']}")
```
## 5. OG Metadata Extraction
```python
# Extract Open Graph metadata from URL
data = {'url': 'https://github.com/vikiboss/60s'}
response = requests.post('https://60s.viki.moe/v2/og', json=data)
metadata = response.json()
print(f"Title: {metadata['title']}")
print(f"Description: {metadata['description']}")
print(f"Image: {metadata['image']}")
print(f"URL: {metadata['url']}")
```
## 6. WHOIS Lookup
```python
# Domain WHOIS information
params = {'domain': 'github.com'}
response = requests.get('https://60s.viki.moe/v2/whois', params=params)
whois_info = response.json()
print(f"Domain: {whois_info['domain']}")
print(f"Registrar: {whois_info['registrar']}")
print(f"Created: {whois_info['created_date']}")
print(f"Expires: {whois_info['expiration_date']}")
```
## 7. Password Generation
```python
# Generate secure password
params = {
'length': 16, # 6-128
'numbers': True, # include numbers
'lowercase': True, # include lowercase
'uppercase': True, # include uppercase
'symbols': True # include special characters
}
response = requests.get('https://60s.viki.moe/v2/password', params=params)
password_data = response.json()
print(f"Password: {password_data['password']}")
print(f"Strength: {password_data['strength']}")
```
## Example Use Cases
### Multi-language Chatbot
```python
def auto_translate(text, target_lang='zh'):
data = {
'text': text,
'from': 'auto',
'to': target_lang
}
response = requests.post('https://60s.viki.moe/v2/fanyi', json=data)
return response.json()['result']
# Usage
user_input = "Hello, how are you?"
translated = auto_translate(user_input, 'zh')
print(translated) # 你好,你好吗?
```
### URL Shortener with QR Code
```python
def create_qr_for_url(url, size=200):
params = {'text': url, 'size': size}
response = requests.get('https://60s.viki.moe/v2/qrcode', params=params)
return response.content
# Generate and save
qr_image = create_qr_for_url('https://example.com')
with open('url_qr.png', 'wb') as f:
f.write(qr_image)
```
### Security Tools
```python
def check_password_hash(password):
"""Generate multiple hashes for password"""
algorithms = ['md5', 'sha1', 'sha256', 'sha512']
hashes = {}
for algo in algorithms:
data = {'text': password, 'algorithm': algo}
response = requests.post('https://60s.viki.moe/v2/hash', json=data)
hashes[algo] = response.json()['hash']
return hashes
def generate_secure_password(length=16):
params = {
'length': length,
'numbers': True,
'lowercase': True,
'uppercase': True,
'symbols': True
}
response = requests.get('https://60s.viki.moe/v2/password', params=params)
return response.json()['password']
```
### Website Preview Card
```python
def get_link_preview(url):
"""Get rich preview data for a URL"""
data = {'url': url}
response = requests.post('https://60s.viki.moe/v2/og', json=data)
og = response.json()
preview = f"""
📄 {og['title']}
📝 {og['description']}
🖼️ {og['image']}
🔗 {og['url']}
"""
return preview
```
## Best Practices
1. **Translation**: Use 'auto' for source language when unsure
2. **QR Codes**: Keep size between 200-500px for most uses
3. **Hashing**: Use SHA256 or SHA512 for security applications
4. **Passwords**: Always use all character types for strong passwords
5. **Error Handling**: Always validate inputs and handle API errors
## Example Interactions
### User: "把这段话翻译成英文:你好世界"
```python
data = {'text': '你好世界', 'from': 'zh', 'to': 'en'}
response = requests.post('https://60s.viki.moe/v2/fanyi', json=data)
print(response.json()['result']) # Hello World
```
### User: "生成一个强密码"
```python
params = {'length': 20, 'symbols': True, 'uppercase': True, 'lowercase': True, 'numbers': True}
response = requests.get('https://60s.viki.moe/v2/password', params=params)
print(f"🔐 生成的密码:{response.json()['password']}")
```
### User: "查询这个IP地址的位置:1.1.1.1"
```python
response = requests.get('https://60s.viki.moe/v2/ip', params={'ip': '1.1.1.1'})
info = response.json()
print(f"📍 IP: {info['ip']}")
print(f"🌍 位置: {info['location']}")
print(f"🏢 运营商: {info['isp']}")
```
## Related Resources
- [60s API Documentation](https://docs.60s-api.viki.moe)
- [GitHub Repository](https://github.com/vikiboss/60s)
---
name: weather-query
description: 查询中国各地实时天气和天气预报,包括温度、湿度、风速、空气质量等信息。Use when users ask about weather conditions, forecasts, or climate information for locations in China.
license: MIT
metadata:
author: vikiboss
version: "1.0"
api_base: https://60s.viki.moe/v2
tags:
- weather
- forecast
- china
- climate
---
# Weather Query Skill
This skill enables AI agents to fetch real-time weather information and forecasts for locations in China using the 60s API.
## When to Use This Skill
Use this skill when users:
- Ask about current weather conditions
- Want weather forecasts
- Need temperature, humidity, wind information
- Request air quality data
- Plan outdoor activities and need weather info
## API Endpoints
### 1. Real-time Weather
**URL:** `https://60s.viki.moe/v2/weather/realtime`
**Method:** GET
### 2. Weather Forecast
**URL:** `https://60s.viki.moe/v2/weather/forecast`
**Method:** GET
## Parameters
- `query` (required): Location name in Chinese
- Can be city name: "北京", "上海", "广州"
- Can be district name: "海淀区", "浦东新区"
## How to Use
### Get Real-time Weather
```python
import requests
def get_realtime_weather(query):
url = 'https://60s.viki.moe/v2/weather/realtime'
response = requests.get(url, params={'query': query})
return response.json()
# Example
weather = get_realtime_weather('北京')
print(f"☁️ {weather['location']}天气")
print(f"🌡️ 温度:{weather['temperature']}°C")
print(f"💨 风速:{weather['wind']}")
print(f"💧 湿度:{weather['humidity']}")
```
### Get Weather Forecast
```python
def get_weather_forecast(query):
url = 'https://60s.viki.moe/v2/weather/forecast'
response = requests.get(url, params={'query': query})
return response.json()
# Example
forecast = get_weather_forecast('上海')
for day in forecast['forecast']:
print(f"{day['date']}: {day['weather']} {day['temp_low']}°C ~ {day['temp_high']}°C")
```
### Simple bash example
```bash
# Real-time weather
curl "https://60s.viki.moe/v2/weather/realtime?query=北京"
# Weather forecast
curl "https://60s.viki.moe/v2/weather/forecast?query=上海"
```
## Response Format
### Real-time Weather Response
```json
{
"location": "北京",
"weather": "晴",
"temperature": "15",
"humidity": "45%",
"wind": "东北风3级",
"air_quality": "良",
"updated": "2024-01-15 14:00:00"
}
```
### Forecast Response
```json
{
"location": "上海",
"forecast": [
{
"date": "2024-01-15",
"day_of_week": "星期一",
"weather": "多云",
"temp_low": "10",
"temp_high": "18",
"wind": "东风3-4级"
},
...
]
}
```
## Example Interactions
### User: "北京今天天气怎么样?"
**Agent Response:**
```python
weather = get_realtime_weather('北京')
response = f"""
☁️ 北京今日天气
天气状况:{weather['weather']}
🌡️ 温度:{weather['temperature']}°C
💧 湿度:{weather['humidity']}
💨 风力:{weather['wind']}
🌫️ 空气质量:{weather['air_quality']}
"""
```
### User: "上海未来三天天气"
```python
forecast = get_weather_forecast('上海')
response = "📅 上海未来天气预报\n\n"
for day in forecast['forecast'][:3]:
response += f"{day['date']} {day['day_of_week']}\n"
response += f" {day['weather']} {day['temp_low']}°C ~ {day['temp_high']}°C\n"
response += f" {day['wind']}\n\n"
```
### User: "深圳会下雨吗?"
```python
weather = get_realtime_weather('深圳')
if '雨' in weather['weather']:
print("☔ 是的,深圳现在正在下雨")
print("建议带伞出门!")
else:
forecast = get_weather_forecast('深圳')
rain_days = [d for d in forecast['forecast'] if '雨' in d['weather']]
if rain_days:
print(f"未来{rain_days[0]['date']}可能会下雨")
else:
print("近期没有降雨预报")
```
## Best Practices
1. **Location Names**: Always use Chinese characters for location names
2. **Error Handling**: Check if the location is valid before displaying results
3. **Context**: Provide relevant context based on weather conditions
- Rain: Suggest bringing umbrella
- Hot: Recommend staying hydrated
- Cold: Advise wearing warm clothes
- Poor AQI: Suggest wearing mask
4. **Caching**: Weather data is updated regularly but can be cached for short periods
5. **Fallbacks**: If a specific district doesn't work, try the city name
## Common Use Cases
### 1. Weather-based Recommendations
```python
def give_weather_advice(location):
weather = get_realtime_weather(location)
advice = []
temp = int(weather['temperature'])
if temp > 30:
advice.append("🔥 天气炎热,注意防暑降温,多喝水")
elif temp < 5:
advice.append("🥶 天气寒冷,注意保暖")
if '雨' in weather['weather']:
advice.append("☔ 记得带伞")
if weather['air_quality'] in ['差', '重度污染']:
advice.append("😷 空气质量不佳,建议戴口罩")
return '\n'.join(advice)
```
### 2. Multi-city Weather Comparison
```python
def compare_weather(cities):
results = []
for city in cities:
weather = get_realtime_weather(city)
results.append({
'city': city,
'temperature': int(weather['temperature']),
'weather': weather['weather']
})
# Find hottest and coldest
hottest = max(results, key=lambda x: x['temperature'])
coldest = min(results, key=lambda x: x['temperature'])
return f"🌡️ 最热: {hottest['city']} {hottest['temperature']}°C\n" \
f"❄️ 最冷: {coldest['city']} {coldest['temperature']}°C"
```
### 3. Travel Weather Check
```python
def check_travel_weather(destination, days=3):
forecast = get_weather_forecast(destination)
suitable_days = []
for day in forecast['forecast'][:days]:
if '雨' not in day['weather'] and '雪' not in day['weather']:
suitable_days.append(day['date'])
if suitable_days:
return f"✅ {destination}适合出行的日期:{', '.join(suitable_days)}"
else:
return f"⚠️ 未来{days}天{destination}天气不太适合出行"
```
## Troubleshooting
### Issue: Location not found
- **Solution**: Try using the main city name instead of district
- Example: Use "北京" instead of "朝阳区"
### Issue: No forecast data
- **Solution**: Verify the location name is correct
- Try standard city names: 北京, 上海, 广州, 深圳, etc.
### Issue: Data seems outdated
- **Solution**: The API updates regularly, but weather can change quickly
- Check the `updated` timestamp in the response
## Supported Locations
The weather API supports most cities and districts in China, including:
- Provincial capitals: 北京, 上海, 广州, 深圳, 成都, 杭州, 南京, 武汉, etc.
- Major cities: 苏州, 青岛, 大连, 厦门, etc.
- Districts: 海淀区, 朝阳区, 浦东新区, etc.
## Related Resources
- [60s API Documentation](https://docs.60s-api.viki.moe)
- [GitHub Repository](https://github.com/vikiboss/60s)