mcpField
S
Steam Trends API

Steam Trends API

リモート
trendsapi.aiゲーム・エンタメ010 週間前に更新
リポジトリ公式サイト

Steam Trends API について

Steam Trends APIは、Steamゲームへの関心を分析する開発者向けのAPIとPython SDKです。Steam Web APIキーなしで、月次履歴、成長率、リアルタイムランキングを取得できます。

主な機能

  1. 01月次トレンド系列の取得
  2. 02複数期間の成長率計算
  3. 03リアルタイム人気ゲームランキング
  4. 04同期・非同期Pythonクライアント

活用シーン

  1. 01期間ごとのゲーム関心度の比較
  2. 02現在のSteam人気ゲームの確認
  3. 03トレンドデータのPandas形式への整理

設定

リモートサーバーはインストール不要です。クライアントを選んで設定をコピーするか、ワンクリックで導入できます。

エンドポイントhttps://steam.api.trendsapi.ai/mcp
インストールコマンドをコピー
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

コマンドはターミナルで実行し、JSON は各クライアントの MCP 設定に貼り付けて再起動します。認可が必要なサーバーは初回接続時にログインを求めます。

すべてのエンドポイント
Streamable HTTPhttps://steam.api.trendsapi.ai/mcp認証が必要

ツール

詳細

Steam 同時プレイヤー API

Trends API による Steam のプレイヤー関心度の推移です。月次 CCU 履歴、成長率、現在の最多プレイタイトルを確認できます。Steam Web API キーは不要です。

ライセンス:MIT PyPI Python

キー:trendsapi.ai/#get-key。HTTP の仕様とすべてのソース:trendsapi-ai/trendsapi。

認証

pip install trendsapi-steam
export TRENDSAPI_KEY=your_key

Python 3.9 以降。同じキーを HTTP API と共有します。

from trendsapi_steam import TrendsAPI

client = TrendsAPI()                    # TRENDSAPI_KEY
# client = TrendsAPI(api_key="YOUR_KEY")

キーワード用ヘルパーのデフォルトは source: "steam" です。同じクライアントで他のプラットフォームを利用する場合は、source= を指定します。すべてのソースに対応した公式フルクライアント(プリセットなし):trendsapi。

メソッド

メソッドREST の mode戻り値
get_time_series(keyword, source=, data_mode=)get_time_serieslist[TrendsDataPoint]
get_growth(keyword, percent_growth=, source=, data_mode=)get_growthGetGrowthResponse
get_live(limit=, offset=, category=)get_top_trendsGetTopTrendsResponse
get_top_trends(type=, ...)get_top_trendsGetTopTrendsResponse

source は小文字(steam)です。type は正確な表記(Steam Most Played)を使います。両方を混在させると 400 エラーになります。

from trendsapi_steam import TrendsAPI

client = TrendsAPI()                    # TRENDSAPI_KEY
# client = TrendsAPI(api_key="YOUR_KEY")

series = client.get_time_series("counter-strike 2")
print(series[-1].date, series[-1].value)

growth = client.get_growth("counter-strike 2", percent_growth=["3M", "12M"])
print(growth.results[0].growth, growth.results[0].direction)

hot = client.get_live(limit=10)
print(hot.data)                         # [[1, "..."], ...]

get_time_series

points = client.get_time_series("counter-strike 2")

各データポイント:

フィールド常に含まれる意味
dateはいYYYY-MM-DD
valueはいこの系列の 0〜100 の指数
keywordはいエコー
volumeいいえ利用可能な場合の絶対ボリューム
source または datatypeいいえパイプラインのラベル

Python は list[TrendsDataPoint] を返します。["date"] ではなく .date と .value を使用してください。 JS は同じフィールドをオブジェクトのプロパティとして返します。

get_growth

g = client.get_growth("counter-strike 2", percent_growth=["12M", "3M", "YTD"])
print(g.results[0].growth, g.results[0].direction)

percent_growth のデフォルトは ["12M"] です。プリセット:7D 14D 30D 1M 2M 3M 6M 9M 12M/1Y 18M 24M/2Y 36M/3Y 48M 60M/5Y MTD QTD YTD。カスタム指定:{"name": "Launch", "recent": "2024-06-01", "baseline": "2024-01-01"}。

フィールド意味
search_termキーワード
data_sourceソース
results各期間につき 1 つのオブジェクト(period、growth、direction、日付、値)
metadata件数/成功フラグ

複数の期間を指定しても、リクエスト数は 1 回です。Python:growth.results[0].growth。JS:growth.results[0].growth。

get_live

hot = client.get_live(limit=10)
フィールド意味
as_of_tsスナップショットの時刻
typeフィード名
limit、offset、countページネーション
data[rank, label] の行

Python:hot.data。JS:hot.data。任意で offset= と category= を指定できます(Amazon Best Sellers by Category、Top Websites のみ)。

非同期

import asyncio
from trendsapi_steam import AsyncTrendsAPI

async def main():
    c = AsyncTrendsAPI()
    return await asyncio.gather(
        c.get_time_series("counter-strike 2"),
        c.get_time_series("counter-strike 2", source="google search"),
    )

asyncio.run(main())

200 の応答 1 件につき、課金対象のリクエスト 1 回となります。

Pandas

from dataclasses import asdict
import pandas as pd
from trendsapi_steam import TrendsAPI

df = pd.DataFrame(asdict(p) for p in TrendsAPI().get_time_series("counter-strike 2"))
df["date"] = pd.to_datetime(df["date"])
print(df.set_index("date")["value"].resample("ME").mean().tail())

呼び出し(curl)

フィールド値
エンドポイントPOST https://api.trendsapi.ai/api
認証Authorization: Bearer $TRENDSAPI_KEY
履歴get_time_series または get_growth で source: steam を指定
キーワードゲームの表示名。例:counter-strike 2
ライブの typeSteam Most Played
curl -sS -X POST https://api.trendsapi.ai/api \
  -H "Authorization: Bearer $TRENDSAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode":"get_time_series","source":"steam","keyword":"counter-strike 2"}'

ソースに関する注意

  • バックエンドは Steam ストア検索を使って名前を解決します。AppID はリクエストフィールドではありません。
  • 系列は月次です。value はそのタイトルに対する 0〜100 の値で、生の CCU ではありません。
  • type: steam は 400 エラーになります。

エラー

HTTPクライアント
200ペイロードを解析します。Python のデータクラス/JS の型付きオブジェクト
400例外を発生させます。source または type の表記を修正してください
401例外を発生させます。TRENDSAPI_KEY を確認してください
404例外を発生させます。そのキーワードの系列はありません。再試行しないでください
429例外を発生させます。クォータ超過です
5xxクライアントが再試行した後、例外を発生させます

HTTP の body フィールドは JSON 文字列です。SDK はこれをデコードします。生の curl では、body をもう一度解析する必要があります。

サイト:https://trendsapi.ai/trends/steam-trends。

ライセンス

MIT。LICENSE を参照してください。

コメント

MCP は初めてですか?

プロトコルの概要から最初のサーバーの導入まで、よくある疑問にまとめて答えます。

AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。