numerogeek/ebay-browse-api

<p>浏览API包含以下资源:</p> <ul> <li><b> item_summary: </b> 允许购物者通过关键词、GTIN、类别、慈善机构、产品、图片搜索特定商品 </b><a href="/api-docs/static/versioning.html#experimental " target="_blank"><img src="/cms/img/docs/experimental-icon.svg"></a></p>

1.0 2023-05-18 18:44 UTC

This package is auto-updated.

Last update: 2024-09-18 21:55:44 UTC


README

浏览API包含以下资源

  • item_summary: 允许购物者通过关键词、GTIN、类别、慈善机构、产品、图片搜索特定商品,并通过使用过滤器(如方面、兼容性和字段值)或UI参数来根据商品方面和属性筛选结果 \"Experimental(实验方法),或使用过滤器来筛选结果,例如方面、兼容性和字段值。
  • 商品
    • 允许您检索特定商品或商品组的详细信息,商品组包含具有不同变体(如颜色和大小)的商品,并检查产品是否与指定商品兼容,例如检查特定汽车是否与特定零件兼容。
    • 为eBay传统API(如 Finding)和RESTful API之间提供桥梁,后者使用不同的格式表示商品ID。

调用 item_summary search_by_image item资源需要应用程序访问令牌

安装和用法

要求

PHP 7.4及其以上版本。也应与PHP 8.0兼容。

Composer

要通过Composer安装绑定,请将以下内容添加到composer.json

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/numerogeek/ebay-browse-api.git"
    }
  ],
  "require": {
    "numerogeek/ebay-browse-api": "*@dev"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

入门

请按照安装说明进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure OAuth2 access token for authorization: api_auth
$config = OpenAPI\EbayBrowseClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\EbayBrowseClient\Api\ItemApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$item_id = 'item_id_example'; // string | The eBay RESTful identifier of an item (such as a part you want to check). This ID is returned by the <b> Browse</b> and <b> Feed</b> API methods.  <br><br> <b> RESTful Item ID Format: </b><code>v1</code>|<code><i>#</i></code>|<code><i>#</i></code> <br>For example: <code>v1|2**********2|0</code> or <code>v1|1**********2|4**********2</code> <br><br>For more information about item ID for RESTful APIs, see the <a href=\"/api-docs/buy/static/api-browse.html#Legacy\">Legacy API compatibility</a> section of the <i>Buy APIs Overview</i>.
$x_ebay_c_marketplace_id = 'x_ebay_c_marketplace_id_example'; // string | The ID of the eBay marketplace you want to use. <b> Note: </b> This value is case sensitive.<br><br>For example: <br>&nbsp;&nbsp;<code>X-EBAY-C-MARKETPLACE-ID = EBAY_US</code>  <br><br> For a list of supported sites see, <a href=\"/api-docs/buy/browse/overview.html#API\">API Restrictions</a>.
$compatibility_payload = new \OpenAPI\EbayBrowseClient\Model\CompatibilityPayload(); // \OpenAPI\EbayBrowseClient\Model\CompatibilityPayload

try {
    $result = $apiInstance->checkCompatibility($item_id, $x_ebay_c_marketplace_id, $compatibility_payload);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ItemApi->checkCompatibility: ', $e->getMessage(), PHP_EOL;
}

API端点

所有URI均相对于 https://api.ebay.com/buy/browse/v1

模型

Authorization

api_auth

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

关于此包

此PHP包由OpenAPI Generator项目自动生成

  • API版本:v1.18.4
    • 包版本:1.0
  • 构建包:org.openapitools.codegen.languages.PhpClientCodegen