market-data
Fetches and processes real-time financial market data for analysis and trading.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o market-data.zip https://jpskill.com/download/22212.zip && unzip -o market-data.zip && rm market-data.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22212.zip -OutFile "$d\market-data.zip"; Expand-Archive "$d\market-data.zip" -DestinationPath $d -Force; ri "$d\market-data.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
market-data.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
market-dataフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
market-data
目的
このスキルは、Alpha VantageやYahoo FinanceなどのAPIからリアルタイムの金融市場データを取得・処理し、分析や取引の意思決定を可能にします。株式、通貨、指数に関するデータの取り込み、正規化、基本的な計算を扱います。
使用場面
このスキルは、取引ボット、金融ダッシュボード、データ駆動型アプリでのリアルタイム市場監視に利用します。特に高頻度取引シナリオやポートフォリオ分析において、ライブ株価、履歴データ、移動平均などの指標が必要な場合に適用します。
主な機能
- APIを介して、株式、ETF、外国為替のリアルタイムまたは履歴データを取得します。
- 組み込み関数(例:単純移動平均やボラティリティの計算)でデータを処理します。
- JSON設定ファイルで設定可能な複数のデータソースをサポートします。
- ページネーションとキャッシングにより、大規模なデータセットを効率的に処理します。
- 自動化されたワークフローのために、他の金融ツールと統合します。
使用パターン
常に環境変数による認証でスキルを初期化してください。パイプラインで使用します。まずデータを取得し、次に処理し、最後に結果を出力または統合します。スクリプトでは、モジュールとしてインポートし、関数を直接呼び出します。CLIモードでは、コマンドを連結して連続操作を行います。データベースへの直接書き込みは避け、一時的なデータ処理に利用してください。
一般的なコマンド/API
claw CLIは迅速なアクセスに利用し、APIエンドポイントはプログラムによる使用を目的としています。コマンドを実行する前に、認証のために$MARKET_API_KEYを設定してください。
-
CLIコマンド: 株価の取得
claw market-data fetch --symbol AAPL --interval 1minこれは、AAPLの最新の1分足OHLCデータを取得します。 -
APIエンドポイント: 株式データの取得 エンドポイント: GET /api/v1/stocks/{symbol} (クエリパラメータ例: ?interval=1min) コードでの使用例:
import requests response = requests.get('http://api.openclaw.ai/api/v1/stocks/AAPL', headers={'Authorization': f'Bearer {os.environ["MARKET_API_KEY"]}'}) data = response.json() -
CLIコマンド: データの処理(例:SMAの計算)
claw market-data process --input data.json --function sma --period 20これはJSONファイルを読み込み、20期間のSMAを計算します。 -
APIエンドポイント: データの処理 エンドポイント: POST /api/v1/process (JSONボディ例: {"function": "sma", "data": [...], "period": 20}) 例:
fetch('http://api.openclaw.ai/api/v1/process', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.MARKET_API_KEY}` }, body: JSON.stringify({function: 'sma', data: [/* array */], period: 20}) }).then(res => res.json()); -
設定形式: 設定にはJSONファイルを使用します config.jsonの例:
{ "api_endpoint": "http://api.openclaw.ai", "default_interval": "1min", "cache_ttl": 300 }読み込み方:
claw market-data config load path/to/config.json
統合に関する注意点
スキル関数をアプリのコードでラップして統合します。環境変数に$MARKET_API_KEYが設定されていることを確認してください。Webアプリの場合、ブロッキングを避けるために非同期呼び出しを使用します。他のスキルと組み合わせる場合は、stdin/stdoutを介して出力をパイプします。例: claw market-data fetch --symbol AAPL | claw trading-execution analyze。レート制限は、遅延を追加するか、--retry-count 3で組み込みの再試行メカニズムを使用することで処理します。統合はまずサンドボックス環境でテストしてください。
エラー処理
APIエラーはレスポンスコードを解析して確認します。一般的なエラーには、$MARKET_API_KEYが欠落しているか無効な場合の401(認証されていない)などがあります。コードスニペットではtry-catchを使用します。
try:
response = requests.get(...) # 上記と同様
response.raise_for_status()
except requests.exceptions.HTTPError as err:
print(f"Error: {err} - Check API key or endpoint")
CLIの場合、エラーをログに記録するために--verboseを追加します。例: claw market-data fetch --symbol AAPL --verbose。一時的なエラーは指数関数的バックオフで再試行します。config.jsonで{"retry_policy": {"max_retries": 5, "backoff": 2}}のように設定します。不正なリクエストを防ぐため、常に入力を検証してください。
具体的な使用例
-
Pythonスクリプトで株価を取得・分析する:
$MARKET_API_KEY=your_keyを設定します。その後:import os import requests symbol = 'AAPL' response = requests.get(f'http://api.openclaw.ai/api/v1/stocks/{symbol}', headers={'Authorization': f'Bearer {os.environ["MARKET_API_KEY"]}'}) price = response.json()['price'] print(f"Current price of {symbol}: {price}")これは、取引アルゴリズムで即座に使用するためのライブ価格を出力します。
-
CLIを介して履歴データを処理し、取引シグナルを得る: まず、データを取得します:
claw market-data fetch --symbol TSLA --interval daily --output history.json。 次に処理します:claw market-data process --input history.json --function rsi --period 14。 出力: RSI値を含むJSON。これを売買シグナルの意思決定スクリプトに供給できます。
グラフの関係
- 関連: trading-execution(注文発注のためのデータを取得)、financial-analysis(レポート用の処理済みデータを提供)。
- 依存: authentication-service(APIキーの検証用)。
- 使用元: portfolio-management(資産配分のために市場データを統合)。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
market-data
Purpose
This skill fetches and processes real-time financial market data from APIs like Alpha Vantage or Yahoo Finance, enabling analysis and trading decisions. It handles data ingestion, normalization, and basic computations for stocks, currencies, and indices.
When to Use
Use this skill for real-time market monitoring in trading bots, financial dashboards, or data-driven apps. Apply it when you need live stock prices, historical data, or indicators like moving averages, especially in high-frequency trading scenarios or portfolio analysis.
Key Capabilities
- Fetch real-time or historical data for stocks, ETFs, and forex via APIs.
- Process data with built-in functions, e.g., calculate simple moving averages or volatility.
- Support for multiple data sources, configurable via JSON config files.
- Handle large datasets efficiently with pagination and caching.
- Integrate with other financial tools for automated workflows.
Usage Patterns
Always initialize the skill with authentication via environment variables. Use it in a pipeline: first fetch data, then process it, and finally output or integrate. For scripts, import as a module and call functions directly. In CLI mode, chain commands for sequential operations. Avoid direct database writes; use it for transient data processing.
Common Commands/API
Use the claw CLI for quick access; API endpoints are for programmatic use. Set $MARKET_API_KEY for authentication before running commands.
-
CLI Command: Fetch stock price
claw market-data fetch --symbol AAPL --interval 1min
This retrieves the latest 1-minute OHLC data for AAPL. -
API Endpoint: Get stock data
Endpoint: GET /api/v1/stocks/{symbol} with query params like ?interval=1min
Example: Use in code:import requests response = requests.get('http://api.openclaw.ai/api/v1/stocks/AAPL', headers={'Authorization': f'Bearer {os.environ["MARKET_API_KEY"]}'}) data = response.json() -
CLI Command: Process data (e.g., calculate SMA)
claw market-data process --input data.json --function sma --period 20
This reads a JSON file and computes a 20-period SMA. -
API Endpoint: Process data
Endpoint: POST /api/v1/process with JSON body {"function": "sma", "data": [...], "period": 20}
Example:fetch('http://api.openclaw.ai/api/v1/process', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.MARKET_API_KEY}` }, body: JSON.stringify({function: 'sma', data: [/* array */], period: 20}) }).then(res => res.json()); -
Config Format: Use a JSON file for settings
Example config.json:{ "api_endpoint": "http://api.openclaw.ai", "default_interval": "1min", "cache_ttl": 300 }Load it with:
claw market-data config load path/to/config.json
Integration Notes
Integrate by wrapping skill functions in your app's code; ensure $MARKET_API_KEY is set in your environment. For web apps, use async calls to avoid blocking. If combining with other skills, pipe output via stdin/stdout, e.g., claw market-data fetch --symbol AAPL | claw trading-execution analyze. Handle rate limits by adding delays or using the built-in retry mechanism with --retry-count 3. Test integrations in a sandbox environment first.
Error Handling
Check for API errors by parsing response codes; common ones include 401 (unauthorized) if $MARKET_API_KEY is missing or invalid. Use try-catch in code snippets:
try:
response = requests.get(...) # as above
response.raise_for_status()
except requests.exceptions.HTTPError as err:
print(f"Error: {err} - Check API key or endpoint")
For CLI, add --verbose to log errors, e.g., claw market-data fetch --symbol AAPL --verbose. Retry transient errors with exponential backoff; configure via config.json as {"retry_policy": {"max_retries": 5, "backoff": 2}}. Always validate inputs to prevent malformed requests.
Concrete Usage Examples
-
Fetch and analyze stock price in a Python script:
Set$MARKET_API_KEY=your_key. Then:import os import requests symbol = 'AAPL' response = requests.get(f'http://api.openclaw.ai/api/v1/stocks/{symbol}', headers={'Authorization': f'Bearer {os.environ["MARKET_API_KEY"]}'}) price = response.json()['price'] print(f"Current price of {symbol}: {price}")This outputs the live price for immediate use in a trading algorithm.
-
Process historical data via CLI for trading signals:
First, fetch data:claw market-data fetch --symbol TSLA --interval daily --output history.json.
Then process:claw market-data process --input history.json --function rsi --period 14.
Output: A JSON with RSI values, which you can feed into a decision-making script for buy/sell signals.
Graph Relationships
- Related to: trading-execution (fetches data for order placement), financial-analysis (provides processed data for reports).
- Depends on: authentication-service (for API key validation).
- Used by: portfolio-management (integrates market data for asset allocation).