App Store Trends API について
App Store Trends APIは、Python、JavaScript、HTTP経由でAndroidアプリのダウンロード履歴と、iOSおよびGoogle Playのライブランキングを提供します。アプリ需要の分析向けで、履歴データとライブランキングは別々に取得できます。
主な機能
- 01アプリダウンロード時系列の取得
- 02期間別の成長率測定
- 03ライブApp Storeランキングの取得
- 04ライブGoogle Playランキングの取得
- 05非同期Pythonクライアント
- 06HTTP API経由のアクセス
活用シーン
- 01bundle IDによるAndroidダウンロード数の追跡
- 02期間ごとのアプリダウンロード成長率の比較
- 03現在のiOSランキングの確認
- 04Google Playランキング位置の確認
設定
リモートサーバーはインストール不要です。クライアントを選んで設定をコピーするか、ワンクリックで導入できます。
https://app-store.api.trendsapi.ai/mcpclaude mcp add --transport http ai-trendsapi-app-store https://app-store.api.trendsapi.ai/mcp{"mcpServers":{"ai-trendsapi-app-store":{"type":"http","url":"https://app-store.api.trendsapi.ai/mcp"}}}Cursor で開く{"servers":{"ai-trendsapi-app-store":{"type":"http","url":"https://app-store.api.trendsapi.ai/mcp"}}}VS Code で開く{"mcpServers":{"ai-trendsapi-app-store":{"type":"http","url":"https://app-store.api.trendsapi.ai/mcp"}}}{"mcpServers":{"ai-trendsapi-app-store":{"serverUrl":"https://app-store.api.trendsapi.ai/mcp"}}}コマンドはターミナルで実行し、JSON は各クライアントの MCP 設定に貼り付けて再起動します。認可が必要なサーバーは初回接続時にログインを求めます。
https://app-store.api.trendsapi.ai/mcp認証が必要ツール
詳細
App Store と Google Play のチャート API
Trends API による App Store と Google Play の需要データです。Android のダウンロード履歴に加え、iOS と Play のリアルタイムランキングを取得できます。
API キー:trendsapi.ai/#get-key。HTTP の仕様とすべてのデータソース:trendsapi-ai/trendsapi。
認証
pip install trendsapi-app-store
export TRENDSAPI_KEY=your_key
Python 3.9 以降に対応しています。HTTP API と同じキーを使用します。
from trendsapi_app_store import TrendsAPI
client = TrendsAPI() # TRENDSAPI_KEY
# client = TrendsAPI(api_key="YOUR_KEY")
キーワード用ヘルパーの既定の source は "app downloads" です。source= を渡すと、同じクライアントでほかのプラットフォームを指定できます。すべてのソースに対応した公式フルクライアント(プリセットなし):trendsapi。
メソッド
| メソッド | REST の mode | 戻り値 |
|---|---|---|
get_time_series(keyword, source=, data_mode=) | get_time_series | list[TrendsDataPoint] |
get_growth(keyword, percent_growth=, source=, data_mode=) | get_growth | GetGrowthResponse |
get_live(limit=, offset=, category=) | get_top_trends | GetTopTrendsResponse |
get_top_trends(type=, ...) | get_top_trends | GetTopTrendsResponse |
source は小文字で指定します(app downloads)。type は正確に指定します(App Store Top Free)。両方を混在させると 400 エラーになります。
from trendsapi_app_store import TrendsAPI
client = TrendsAPI() # TRENDSAPI_KEY
# client = TrendsAPI(api_key="YOUR_KEY")
series = client.get_time_series("com.openai.chatgpt")
print(series[-1].date, series[-1].value)
growth = client.get_growth("com.openai.chatgpt", 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("com.openai.chatgpt")
各データポイント:
| フィールド | 常に存在 | 意味 |
|---|---|---|
date | はい | YYYY-MM-DD |
value | はい | この系列の 0〜100 のインデックス |
keyword | はい | エコーバックされた値 |
volume | いいえ | 利用可能な場合の絶対ボリューム |
source または datatype | いいえ | パイプラインのラベル |
Python では list[TrendsDataPoint] が返されます。["date"] ではなく、.date と .value を使用してください。
JS では同じフィールドがオブジェクトのプロパティとして返されます。
get_growth
g = client.get_growth("com.openai.chatgpt", 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 | ウィンドウごとのオブジェクト(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_app_store import AsyncTrendsAPI
async def main():
c = AsyncTrendsAPI()
return await asyncio.gather(
c.get_time_series("com.openai.chatgpt"),
c.get_time_series("com.openai.chatgpt", source="google search"),
)
asyncio.run(main())
200 のレスポンス 1 件につき、課金リクエスト 1 件としてカウントされます。
Pandas
from dataclasses import asdict
import pandas as pd
from trendsapi_app_store import TrendsAPI
df = pd.DataFrame(asdict(p) for p in TrendsAPI().get_time_series("com.openai.chatgpt"))
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: app downloads を指定 |
| キーワード | Android のバンドル ID。例:com.openai.chatgpt(chatgpt ではありません) |
リアルタイムの type | App Store Top Free、App Store Top Paid、Google Play |
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":"app downloads","keyword":"com.openai.chatgpt"}'
データソースに関する注意
keywordにchatgptを指定すると 404 エラーになります。Play Store の ID を使用してください。app downloadsは Android の履歴データです。iOS のランキングはリアルタイムフィードのみです。- リアルタイムの
typeの値:App Store Top Free、App Store Top Paid、Google Play。
エラー
| HTTP | クライアント |
|---|---|
| 200 | ペイロードを解析します。Python のデータクラス/JS の型付きオブジェクト |
| 400 | エラーを送出します。source または type の表記を修正してください |
| 401 | エラーを送出します。TRENDSAPI_KEY を確認してください |
| 404 | エラーを送出します。そのキーワードの系列はありません。再試行しないでください |
| 429 | エラーを送出します。クォータ超過です |
| 5xx | クライアントが再試行した後、エラーを送出します |
HTTP の body フィールドは JSON 文字列です。SDK はこれをデコードします。生の curl では body をもう一度解析する必要があります。
サイト:https://trendsapi.ai/trends/app-store-trends。
ライセンス
MIT。LICENSE を参照してください。
コメント
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。