Skip to main content
Web3Fire
SDK

Web3Fire SDK

實體、搜尋和比較的型別化客戶端。無執行時依賴。

安裝

尚未發布到 npm——從此倉庫安裝:

npm install ./sdk
# or copy the single-file build:
#   sdk/dist/index.mjs  (+ sdk/dist/index.d.ts for TypeScript)

快速開始

import { Web3Fire } from '@web3fire/sdk';

// anonymous (public API)
const w3f = new Web3Fire();

// with an API key (higher limits + usage dashboard)
// const w3f = new Web3Fire({ apiKey: 'pk_live_...' });

const eth = await w3f.getEntity('ethereum');
console.log(eth.summary);

const trust = await w3f.getEntity('ethereum', { fields: ['summary', 'trust'] });
const results = await w3f.search('stablecoin', { limit: 10 });
const cmp = await w3f.compare('ethereum-vs-bitcoin');

方法

getEntity(slug, { fields?, lang? })

identity · summary · score · relations · compare · sources · timeline · faq · evidence · trust · freshness

search(q, { lang?, limit? })

FTS5 with alias + intent routing

compare(slug, { lang? })

dimension-by-dimension comparison values

Errors throw with .message = error code and .status = HTTP status. 429/5xx are retried with backoff.

← dev.back_to_developers