4つの簡単なステップで始める
1
SDKをインストール
お好みのパッケージマネージャーを選択してTypeScript SDKをインストール
npm install @sourceparts/sdk2
APIキーを設定
Source Parts APIに接続するための認証を設定
3
クライアントを初期化
設定でクライアントインスタンスを作成
import { SourceParts } from '@sourceparts/sdk';
const client = new SourceParts({
apiKey: process.env.SOURCEPARTS_API_KEY,
environment: 'production'
});4
最初のリクエストを実行
コンポーネントを検索し、リアルタイムの価格データを取得
// Search for components
const results = await client.components.search({
query: 'ESP32',
limit: 10,
filters: {
inStock: true,
category: 'microcontrollers'
}
});
console.log(`Found ${results.total} components`);
results.items.forEach(component => {
console.log(`${component.name}: ${component.price}`);
});次のステップ
APIを探索
包括的なAPIドキュメントを深く掘り下げる
APIドキュメントを見るコードサンプル
実際の統合例とパターンを参照
サンプルを見るサポートを受ける
エンジニアリングチームがあなたの成功をサポートします
サポートに連絡