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
Requires
- php: ^7.4 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
This package is auto-updated.
Last update: 2024-09-18 21:55:44 UTC
README
浏览API包含以下资源
- item_summary: 允许购物者通过关键词、GTIN、类别、慈善机构、产品、图片搜索特定商品,并通过使用过滤器(如方面、兼容性和字段值)或UI参数来根据商品方面和属性筛选结果
(实验方法),或使用过滤器来筛选结果,例如方面、兼容性和字段值。
- 商品
- 允许您检索特定商品或商品组的详细信息,商品组包含具有不同变体(如颜色和大小)的商品,并检查产品是否与指定商品兼容,例如检查特定汽车是否与特定零件兼容。
- 为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> <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
模型
- AdditionalProductIdentity
- AddonService
- Address
- Amount
- Aspect
- AspectDistribution
- AspectGroup
- AspectValueDistribution
- AttributeNameValue
- AuthenticityGuaranteeProgram
- AuthenticityVerificationProgram
- AutoCorrections
- AvailableCoupon
- BuyingOptionDistribution
- Category
- CategoryDistribution
- CommonDescriptions
- CompatibilityPayload
- CompatibilityProperty
- CompatibilityResponse
- ConditionDistribution
- ConvertedAmount
- CoreItem
- CouponConstraint
- Error
- ErrorParameter
- EstimatedAvailability
- HazardPictogram
- HazardStatement
- HazardousMaterialsLabels
- Image
- Item
- ItemGroup
- ItemGroupSummary
- ItemLocationImpl
- ItemReturnTerms
- ItemSummary
- Items
- LegalAddress
- MarketingPrice
- PaymentMethod
- PaymentMethodBrand
- PickupOptionSummary
- Product
- ProductIdentity
- RatingHistogram
- Refinement
- Region
- ReviewRating
- SearchByImageRequest
- SearchPagedCollection
- Seller
- SellerCustomPolicy
- SellerDetail
- SellerLegalInfo
- ShipToLocation
- ShipToLocations
- ShipToRegion
- ShippingOption
- ShippingOptionSummary
- TargetLocation
- TaxJurisdiction
- Taxes
- TimeDuration
- TypedNameValue
- VatDetail
Authorization
api_auth
- 类型:
OAuth
- 流程:
application
- 授权URL: ``
- 作用域:
- https://api.ebay.com/oauth/api_scope/buy.item.bulk:批量检索eBay商品。
- https://api.ebay.com/oauth/api_scope:查看eBay的公开数据
测试
要运行测试,请使用
composer install vendor/bin/phpunit
作者
关于此包
此PHP包由OpenAPI Generator项目自动生成
- API版本:
v1.18.4
- 包版本:
1.0
- 包版本:
- 构建包:
org.openapitools.codegen.languages.PhpClientCodegen