nexpcb/phpoctopart

Octopart 的 PHP restful API SDK。

dev-master 2019-03-28 08:38 UTC

This package is auto-updated.

Last update: 2024-09-29 04:43:25 UTC


README

一个用于 Octopart v3 restful API 的 PHP 库。如果使用 Laravel,请安装 laravel-octopart 包

安装

(如果使用 laravel-octopart 包,则跳过以下步骤)

  1. composer require "nexpcb/phpoctopart"
  2. 从其仪表板获取 Octopart API 密钥

示例

  • 通过 uid 获取单个品牌

NexPCB\PHPOctopart\OctopartClient::create(['apikey' => 'xxxxxxx'])->getBrandByUID('2239e3330e2df5fe');

  • 搜索品牌

NexPCB\PHPOctopart\OctopartClient::create(['apikey' => 'xxxxxxx'])->searchBrands(['q' => 'texas']);

  • 通过多个 uid 获取多个品牌

NexPCB\PHPOctopart\OctopartClient::create(['apikey' => 'xxxxxxx'])->getMultipleBrands(['uid' => ['2239e3330e2df5fe', '56b297b87fa88175']]);