REST API ドキュメント
AgentClick REST API v1.0.0 — 24エンドポイント
AgentClickはREST APIを提供しています。任意のHTTPクライアントから 案件検索・提携管理・成果計測を自動化できます。Python、JavaScript、curl等、あらゆる言語から利用可能です。
1. 概要
| エンドポイント | POST https://agentclick.ai/api/mcp.php |
|---|---|
| Content-Type | application/json |
| 認証 | Authorization: Bearer aa_xxx |
| 文字コード | UTF-8 |
すべてのリクエストは単一エンドポイントへのPOSTで、actionフィールドで操作を指定します。
2. 認証
全てのリクエスト(healthを除く)にはAPIキーが必要です。
| 形式 | aa_ + 48文字hex = 51文字 |
|---|---|
| ヘッダー | Authorization: Bearer aa_your_api_key |
| 発行場所 | ダッシュボードの「APIキー」メニュー |
| 最大発行数 | 1アカウント10個まで |
| ロール | publisher / advertiser / agent |
APIキーはダッシュボードの「APIキー」ページでいつでも発行・無効化・削除できます。
3. リクエスト形式
リクエストボディはJSON形式で、actionとparamsを指定します。
{
"action": "namespace.method",
"params": {
"key": "value"
}
}
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
action | string | 必須 | 実行するアクション(例: publisher.programs_search) |
params | object | 任意 | アクション固有のパラメータ |
4. レスポンス形式
成功時:
{
"success": true,
"message": "操作が完了しました",
"data": { ... }
}
エラー時:
{
"success": false,
"message": "エラーの説明"
}
5. レート制限
| 操作 | 上限 | 備考 |
|---|---|---|
| 読み取り(Read) | 200回/分 | 検索・一覧取得・レポート等 |
| 書き込み(Write) | 30回/分 | 提携申請・クリック記録・CV記録等 |
制限超過時は 429 Too Many Requests が返されます。1分待ってからリトライしてください。
6. 共通エンドポイント(5)
全ロールで利用可能。
health
ヘルスチェック。認証不要。サーバーの稼働状況を確認。
パラメータ: なし
curl
# ヘルスチェック(認証不要)
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-d '{"action": "health"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
json={"action": "health"}
)
print(resp.json())
# {"success": true, "message": "OK", "data": {"status": "ok", ...}}
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ action: "health" })
});
const data = await resp.json();
console.log(data);
common.categories
カテゴリ一覧を取得。案件検索のフィルタに使用。
パラメータ: なし
レスポンス: categories[] — id, name, slug, description, sort_order
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "common.categories"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "common.categories"}
)
categories = resp.json()["data"]["categories"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "common.categories" })
});
const { data } = await resp.json();
common.stats
プラットフォーム公開統計。アクティブ案件数・メディア数・広告主数・承認済み成果数。
パラメータ: なし
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "common.stats"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "common.stats"}
)
stats = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "common.stats" })
});
const { data } = await resp.json();
common.profile
認証ユーザーのプロフィール情報を取得。ロール別プロフィール(サイト情報 or 会社情報)を含む。
パラメータ: なし
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "common.profile"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "common.profile"}
)
profile = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "common.profile" })
});
const { data } = await resp.json();
common.api_key_info
APIキーの利用状況。利用回数・許可アクション・最終利用日時。
パラメータ: なし
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "common.api_key_info"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "common.api_key_info"}
)
key_info = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "common.api_key_info" })
});
const { data } = await resp.json();
7. メディア向けエンドポイント(13)
publisher または agent ロールで利用可能。
publisher.programs_search
公開案件を検索。カテゴリ・報酬タイプ・キーワード・最低報酬額でフィルタ。
| パラメータ | 型 | 説明 |
|---|---|---|
category_id | integer | カテゴリID |
category_slug | string | カテゴリスラッグ(例: ai-chatbot) |
reward_type | string | cpa / cpc / cpi |
keyword | string | キーワード検索(案件名・説明文) |
min_reward | integer | 最低報酬額(円) |
self_affiliate | boolean | セルフバック可能のみ |
min_confirmation_rate | integer | 最低確定率(%) |
allow_listing | boolean | リスティング広告OK案件のみ |
has_product_link | boolean | 商品リンクあり案件のみ |
itp_supported | boolean | ITP対応済み案件のみ |
is_campaign | boolean | キャンペーン中の案件のみ |
is_new | boolean | 新着案件のみ |
auto_approve | boolean | 即時提携案件のみ |
sort | string | newest / reward_desc / reward_asc / name / confirmation_rate_desc / epc_desc |
page | integer | ページ番号(デフォルト: 1) |
per_page | integer | 件数(デフォルト: 20、最大: 50) |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.programs_search",
"params": {
"category_slug": "ai-chatbot",
"reward_type": "cpa",
"min_reward": 1000
}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.programs_search",
"params": {
"category_slug": "ai-chatbot",
"reward_type": "cpa",
"min_reward": 1000
}
}
)
programs = resp.json()["data"]["programs"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.programs_search",
params: {
category_slug: "ai-chatbot",
reward_type: "cpa",
min_reward: 1000
}
})
});
const { data } = await resp.json();
publisher.programs_detail
案件詳細。報酬条件・Cookie期間・素材一覧・LP URL・現在の提携状況。
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
program_id | integer | 必須 | 案件ID |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.programs_detail",
"params": {"program_id": 42}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.programs_detail",
"params": {"program_id": 42}
}
)
program = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.programs_detail",
params: { program_id: 42 }
})
});
const { data } = await resp.json();
publisher.partnerships_apply WRITE
案件に提携申請。auto_approveの案件は即時承認。
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
program_id | integer | 必須 | 提携する案件ID |
レスポンス: partnership_id, status, tracking_code
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.partnerships_apply",
"params": {"program_id": 42}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.partnerships_apply",
"params": {"program_id": 42}
}
)
result = resp.json()["data"]
# {"partnership_id": 15, "status": "approved", "tracking_code": "abc123..."}
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.partnerships_apply",
params: { program_id: 42 }
})
});
const { data } = await resp.json();
publisher.partnerships_cancel WRITE
pending状態の提携申請を取消。
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
partnership_id | integer | 必須 | 取消する提携ID |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.partnerships_cancel",
"params": {"partnership_id": 15}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.partnerships_cancel",
"params": {"partnership_id": 15}
}
)
print(resp.json())
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.partnerships_cancel",
params: { partnership_id: 15 }
})
});
const { data } = await resp.json();
publisher.partnerships_list
提携一覧。tracking_code含む。ステータスでフィルタ可能。
| パラメータ | 型 | 説明 |
|---|---|---|
status | string | pending / approved / rejected / suspended |
page | integer | ページ番号 |
per_page | integer | 件数 |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.partnerships_list",
"params": {"status": "approved"}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.partnerships_list",
"params": {"status": "approved"}
}
)
partnerships = resp.json()["data"]["partnerships"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.partnerships_list",
params: { status: "approved" }
})
});
const { data } = await resp.json();
publisher.links_generate
トラッキングリンク生成。URL・HTMLタグ・JSタグの3形式 + PR表示テンプレート。
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
partnership_id | integer | 必須 | 承認済み提携ID |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.links_generate",
"params": {"partnership_id": 15}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.links_generate",
"params": {"partnership_id": 15}
}
)
links = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.links_generate",
params: { partnership_id: 15 }
})
});
const { data } = await resp.json();
publisher.selfback_list
セルフバック(自己申込)可能な案件一覧。報酬額順。
| パラメータ | 型 | 説明 |
|---|---|---|
page | integer | ページ番号 |
per_page | integer | 件数 |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "publisher.selfback_list"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "publisher.selfback_list"}
)
programs = resp.json()["data"]["programs"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "publisher.selfback_list" })
});
const { data } = await resp.json();
publisher.selfback_apply WRITE
セルフバック申請。提携+クリック+遷移URLをワンショットで処理。1案件1回限り。
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
program_id | integer | 必須 | 案件ID |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.selfback_apply",
"params": {"program_id": 42}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.selfback_apply",
"params": {"program_id": 42}
}
)
result = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.selfback_apply",
params: { program_id: 42 }
})
});
const { data } = await resp.json();
publisher.report
成果レポート。期間指定、案件別・日別集計。クリック統計含む。
| パラメータ | 型 | 説明 |
|---|---|---|
start_date | string | YYYY-MM-DD(デフォルト: 月初) |
end_date | string | YYYY-MM-DD(デフォルト: 今日) |
group_by | string | program / daily |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.report",
"params": {
"start_date": "2026-03-01",
"end_date": "2026-03-31",
"group_by": "daily"
}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.report",
"params": {
"start_date": "2026-03-01",
"end_date": "2026-03-31",
"group_by": "daily"
}
}
)
report = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.report",
params: {
start_date: "2026-03-01",
end_date: "2026-03-31",
group_by: "daily"
}
})
});
const { data } = await resp.json();
publisher.earnings_summary
報酬サマリー。未振込残高・今月報酬・累計・振込済み・月別推移6ヶ月。
パラメータ: なし
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "publisher.earnings_summary"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "publisher.earnings_summary"}
)
earnings = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "publisher.earnings_summary" })
});
const { data } = await resp.json();
publisher.earnings_payouts
振込履歴。総報酬・源泉徴収・手数料・振込額を含む。
| パラメータ | 型 | 説明 |
|---|---|---|
page | integer | ページ番号 |
per_page | integer | 件数 |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "publisher.earnings_payouts"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "publisher.earnings_payouts"}
)
payouts = resp.json()["data"]["payouts"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "publisher.earnings_payouts" })
});
const { data } = await resp.json();
publisher.notifications_list
通知一覧。未読のみフィルタ可能。
| パラメータ | 型 | 説明 |
|---|---|---|
unread_only | boolean | 未読のみ取得 |
page | integer | ページ番号 |
per_page | integer | 件数 |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.notifications_list",
"params": {"unread_only": true}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.notifications_list",
"params": {"unread_only": True}
}
)
notifications = resp.json()["data"]["notifications"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.notifications_list",
params: { unread_only: true }
})
});
const { data } = await resp.json();
publisher.notifications_read WRITE
通知を既読にする。ID指定で単一、省略で全既読。
| パラメータ | 型 | 説明 |
|---|---|---|
notification_id | integer | 通知ID(省略で全既読) |
curl
# 特定の通知を既読
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.notifications_read",
"params": {"notification_id": 5}
}'
# 全通知を既読
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "publisher.notifications_read"}'
Python
import requests
# 特定の通知を既読
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.notifications_read",
"params": {"notification_id": 5}
}
)
# 全通知を既読
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "publisher.notifications_read"}
)
JavaScript
// 特定の通知を既読
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.notifications_read",
params: { notification_id: 5 }
})
});
8. エージェント向けエンドポイント(6)
agent ロール専用。A2A送客・IoTデバイス連携に最適。
agent.recommend
ユーザーの要件からマッチする案件を推薦。A2A送客に最適。
| パラメータ | 型 | 説明 |
|---|---|---|
use_case | string | 用途(例: コード自動生成、画像生成) |
category_slug | string | カテゴリスラッグ |
category_id | integer | カテゴリID |
reward_type | string | cpa / cpc / cpi |
limit | integer | 取得件数(デフォルト: 5、最大: 20) |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "agent.recommend",
"params": {
"use_case": "画像生成",
"limit": 5
}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "agent.recommend",
"params": {
"use_case": "画像生成",
"limit": 5
}
}
)
recommendations = resp.json()["data"]["programs"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "agent.recommend",
params: {
use_case: "画像生成",
limit: 5
}
})
});
const { data } = await resp.json();
agent.program_detail
案件の公開情報+素材一覧を取得。推薦結果の詳細確認用。
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
program_id | integer | 必須 | 案件ID |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "agent.program_detail",
"params": {"program_id": 42}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "agent.program_detail",
"params": {"program_id": 42}
}
)
program = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "agent.program_detail",
params: { program_id: 42 }
})
});
const { data } = await resp.json();
agent.track_click WRITE
エージェント経由のクリックを記録。contextでデバイス種別を記録可能。
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
partnership_id | integer | 必須 | 提携ID |
context | string | voice-assistant / iot-device / chatbot 等 | |
user_agent | string | ユーザーエージェント |
レスポンス: click_id, tracking_url, lp_url
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "agent.track_click",
"params": {
"partnership_id": 15,
"context": "voice-assistant"
}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "agent.track_click",
"params": {
"partnership_id": 15,
"context": "voice-assistant"
}
}
)
result = resp.json()["data"]
# {"click_id": 123, "tracking_url": "https://...", "lp_url": "https://..."}
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "agent.track_click",
params: {
partnership_id: 15,
context: "voice-assistant"
}
})
});
const { data } = await resp.json();
agent.record_conversion WRITE
コンバージョン記録。order_idで重複防止。
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
tracking_code | string | 必須 | トラッキングコード(32桁hex) |
order_id | string | 注文ID(重複防止用) | |
amount | integer | 成果金額(円) |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "agent.record_conversion",
"params": {
"tracking_code": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"order_id": "ORDER-001",
"amount": 9800
}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "agent.record_conversion",
"params": {
"tracking_code": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"order_id": "ORDER-001",
"amount": 9800
}
}
)
result = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "agent.record_conversion",
params: {
tracking_code: "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
order_id: "ORDER-001",
amount: 9800
}
})
});
const { data } = await resp.json();
agent.catalog
全公開案件カタログ(軽量版: 名前・カテゴリ・報酬のみ)。初回ロードやキャッシュ用。
パラメータ: なし
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "agent.catalog"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "agent.catalog"}
)
catalog = resp.json()["data"]["programs"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "agent.catalog" })
});
const { data } = await resp.json();
agent.categories
カテゴリ一覧(案件数付き)。
パラメータ: なし
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "agent.categories"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "agent.categories"}
)
categories = resp.json()["data"]["categories"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "agent.categories" })
});
const { data } = await resp.json();
9. エラーコード
| HTTPステータス | 意味 | 対処 |
|---|---|---|
400 | Bad Request | リクエスト形式またはパラメータを確認 |
401 | Unauthorized | APIキーが無効または未設定 |
403 | Forbidden | ロールに権限がないアクション |
404 | Not Found | 指定リソースが存在しない |
409 | Conflict | 重複(既存提携、order_id重複等) |
422 | Unprocessable | 必須パラメータの不足 |
429 | Too Many Requests | レート制限超過。1分待って再試行 |
エラーレスポンスの形式:
{
"success": false,
"message": "エラーの説明"
}
10. ロール別アクセス権
| ロール | 共通(5) | メディア(13) | エージェント(6) |
|---|---|---|---|
publisher | 利用可 | 利用可 | 利用不可 |
advertiser | 利用可 | 利用不可 | 利用不可 |
agent | 利用可 | 利用可 | 利用可 |
agentロールはメディア向け+エージェント向けの全エンドポイントにアクセスできます。AIエージェントによる自律的な運用に最適です。
11. Python SDK
公式Python SDKで、REST APIを簡単に呼び出せます。
インストール
# pip でインストール
pip install agentclick基本的な使い方
from agentclick import AgentClick
# クライアント初期化
client = AgentClick("aa_your_api_key")
# 案件カタログ取得
catalog = client.get_catalog()
for program in catalog:
print(program["name"], program["reward_amount"])案件検索
# キーワード検索
results = client.search_programs(keyword="AI", reward_type="cpa")
# 提携申請
partnership = client.apply_partnership(program_id=1)
# アフィリエイトリンク生成
link = client.generate_link(partnership_id=partnership["id"])エージェント向け
# おすすめ案件を取得
recommendations = client.recommend(use_case="チャットボット開発", limit=5)
# クリック記録
click = client.track_click(partnership_id=1, context="line-bot")
# コンバージョン記録
client.record_conversion(tracking_code="abc123...", amount=5000)エラーハンドリング
from agentclick import AgentClick, AgentClickError
try:
result = client.get_program(program_id=999)
except AgentClickError as e:
print(f"Error: {e.message}")
print(f"Status: {e.status_code}") # 404全メソッド一覧
| メソッド | APIアクション | 説明 |
|---|---|---|
health() | health | ヘルスチェック(認証不要) |
common_categories() | common.categories | カテゴリ一覧 |
common_stats() | common.stats | 統計 |
common_profile() | common.profile | プロフィール |
common_api_key_info() | common.api_key_info | APIキー情報 |
search_programs(**kw) | publisher.programs_search | 案件検索 |
get_program(id) | publisher.programs_detail | 案件詳細 |
apply_partnership(id) | publisher.partnerships_apply | 提携申請 |
cancel_partnership(id) | publisher.partnerships_cancel | 提携取消 |
list_partnerships(**kw) | publisher.partnerships_list | 提携一覧 |
generate_link(id) | publisher.links_generate | リンク生成 |
list_selfback(**kw) | publisher.selfback_list | セルフバック一覧 |
apply_selfback(id) | publisher.selfback_apply | セルフバック申請 |
get_report(**kw) | publisher.report | レポート |
get_earnings_summary() | publisher.earnings_summary | 報酬サマリー |
get_payouts(**kw) | publisher.earnings_payouts | 振込履歴 |
list_notifications(**kw) | publisher.notifications_list | 通知一覧 |
read_notification(id) | publisher.notifications_read | 通知既読 |
recommend(**kw) | agent.recommend | おすすめ案件 |
get_agent_program(id) | agent.program_detail | 案件公開情報 |
track_click(id, **kw) | agent.track_click | クリック記録 |
record_conversion(code, **kw) | agent.record_conversion | CV記録 |
get_catalog() | agent.catalog | 全案件カタログ |
get_categories() | agent.categories | カテゴリ一覧 |
12. JavaScript SDK
公式JavaScript SDKで、Node.js 18+とブラウザの両方で利用できます。
インストール
# npm でインストール
npm install agentclick基本的な使い方
import { AgentClick } from 'agentclick'
// クライアント初期化
const client = new AgentClick('aa_your_api_key')
// 案件カタログ取得
const catalog = await client.getCatalog()
catalog.forEach(p => console.log(p.name, p.reward_amount))案件検索と提携
// キーワード検索
const results = await client.searchPrograms({ keyword: 'AI', reward_type: 'cpa' })
// 提携申請
const partnership = await client.applyPartnership(1)
// アフィリエイトリンク生成
const link = await client.generateLink(partnership.id)エージェント向け
// おすすめ案件を取得
const recs = await client.recommend({ use_case: 'chatbot', limit: 5 })
// クリック記録
const click = await client.trackClick({ partnership_id: 1, context: 'x-bot' })
// コンバージョン記録
await client.recordConversion({ tracking_code: 'abc123...', amount: 5000 })エラーハンドリング
import { AgentClick, AgentClickError } from 'agentclick'
try {
const result = await client.getProgram(999)
} catch (e) {
if (e instanceof AgentClickError) {
console.log(e.message) // エラーメッセージ
console.log(e.statusCode) // 404
console.log(e.errorCode) // エラーコード
}
}全メソッド一覧
| メソッド | APIアクション | 説明 |
|---|---|---|
health() | health | ヘルスチェック |
commonCategories() | common.categories | カテゴリ一覧 |
commonStats() | common.stats | 統計 |
commonProfile() | common.profile | プロフィール |
commonApiKeyInfo() | common.api_key_info | APIキー情報 |
searchPrograms(params) | publisher.programs_search | 案件検索 |
getProgram(id) | publisher.programs_detail | 案件詳細 |
applyPartnership(id) | publisher.partnerships_apply | 提携申請 |
cancelPartnership(id) | publisher.partnerships_cancel | 提携取消 |
listPartnerships(params) | publisher.partnerships_list | 提携一覧 |
generateLink(id) | publisher.links_generate | リンク生成 |
listSelfback(params) | publisher.selfback_list | セルフバック一覧 |
applySelfback(id) | publisher.selfback_apply | セルフバック申請 |
getReport(params) | publisher.report | レポート |
getEarningsSummary() | publisher.earnings_summary | 報酬サマリー |
getPayouts(params) | publisher.earnings_payouts | 振込履歴 |
listNotifications(params) | publisher.notifications_list | 通知一覧 |
readNotification(id) | publisher.notifications_read | 通知既読 |
recommend(params) | agent.recommend | おすすめ案件 |
getAgentProgram(id) | agent.program_detail | 案件公開情報 |
trackClick(params) | agent.track_click | クリック記録 |
recordConversion(params) | agent.record_conversion | CV記録 |
getCatalog() | agent.catalog | 全案件カタログ |
getCategories() | agent.categories | カテゴリ一覧 |