mcpField
D
data-query

data-query

github.com/vikiboss生産性4772 回インストール34 週間前に更新
リポジトリ

data-query について

Data Query Skillは、APIを通じて為替レート、旧暦、歴史上の出来事、百科事典、燃料・金価格、元素情報を取得します。日常的な情報照会に答えるアシスタントや小規模なツール向けです。

主な機能

  1. 01為替レートの照会
  2. 02旧暦への変換
  3. 03今日は何の日の検索
  4. 04中国語百科事典の検索
  5. 05燃料・金価格と元素情報

活用シーン

  1. 01通貨換算ボットの構築
  2. 02カレンダーウィジェットで旧暦を表示
  3. 03歴史上の出来事を通知
  4. 04燃料価格や元素の詳細を照会

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/vikiboss/60s-skills --skill data-query

インストール後、Claude Code で/data-queryを入力して読み込まれたか確認します。

詳細

データクエリスキル

為替レート、カレンダー、歴史、百科事典、価格など、さまざまなデータや情報を照会します。

利用可能なクエリ

  1. 為替レート - 通貨の換算レート
  2. 旧暦 - 中国の旧暦への変換
  3. 今日は何の日 - 歴史上の出来事
  4. 百科事典(Baike) - 中国の百科事典を検索
  5. 燃料価格 - 中国のガソリン・ディーゼル価格
  6. 金価格 - 現在の金価格
  7. 化学元素 - 元素の情報

API エンドポイント

クエリの種類エンドポイントメソッド
為替レート/v2/exchange-rateGET
旧暦/v2/lunarGET
歴史/v2/today-in-historyGET
百科事典/v2/baikeGET
燃料価格/v2/fuel-priceGET
金価格/v2/gold-priceGET
化学/v2/chemicalGET

簡単な使用例

為替レート
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']}")
旧暦
# 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)
今日は何の日
# 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)
百科事典の検索
# 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']}")
燃料価格
# 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号柴油']} 元/升")
金価格
# 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']}")
化学元素
# 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']}")

ユースケース

通貨換算ボット
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
歴史上の出来事のリマインダー
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
旧暦ウィジェット
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 '无'}
    """

会話例

ユーザー:「米ドルから人民元への為替レートはいくらですか?」
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']} 人民币")
ユーザー:「今日は旧暦で何月何日ですか?」
lunar = requests.get('https://60s.viki.moe/v2/lunar').json()
print(f"🏮 今天是农历 {lunar['lunar_date']}")
print(f"🐲 生肖:{lunar['zodiac']}")
ユーザー:「水素元素の情報を調べてください」
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']}")

関連リソース

コメント