Adsterra 残高(推定)
0
円
インプレッション数(合計)
0
USD→JPY レート
—
API読み込み
API無効
経路は「直接 → 拡張機能 → プロキシ」の順に自動で切替。1分ごと自動更新します。
拡張機能(プロキシ不要ローカル代替)を使う
下の3ファイルをChrome拡張として読み込むと、プロキシ無しで動作します(オフラインでも可)。
manifest.json
background.js
content.js
manifest.json { "manifest_version": 3, "name": "Adsterra Fetch Bridge", "version": "1.0.0", "description": "Adsterra API をブラウザ拡張の権限でフェッチしてCORSを回避するブリッジ", "host_permissions": ["https://api3.adsterratools.com/*"], "background": { "service_worker": "background.js" }, "content_scripts": [{ "matches": ["http://*/*", "https://*/*"], "js": ["content.js"], "run_at": "document_start" }] } background.js chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => { if (msg && msg.type === 'ADSTERRA_FETCH') { (async () => { try { const { apiKey, startDate, endDate } = msg.payload || {}; const u = new URL('https://api3.adsterratools.com/publisher/stats.json'); u.searchParams.set('start_date', startDate); u.searchParams.set('finish_date', endDate); u.searchParams.append('group_by[]', 'date'); const r = await fetch(u.toString(), { headers: { 'Accept': 'application/json', 'X-API-Key': apiKey } }); const text = await r.text(); let data = null; try { data = JSON.parse(text); } catch {} sendResponse({ ok: r.ok, status: r.status, data, text }); } catch (e) { sendResponse({ ok: false, status: 0, error: String(e) }); } })(); return true; } }); content.js window.addEventListener('message', async (event) => { if (event.source !== window) return; const d = event.data || {}; if (d.type !== 'ADSTERRA_FETCH') return; const res = await chrome.runtime.sendMessage(d); window.postMessage({ type: 'ADSTERRA_FETCH_RESULT', requestId: d.requestId, ...res }, '*'); });