nogrod / ebay-buy-browse-php-sdk
The <b>Browse API</b> lets shoppers search eBay listings by keyword, category, GTIN, product, charity, compatibility criteria, or image, and refine results with filters such as aspects, compatibility, field values, and UI parameters through the <b>item_summary</b> resource.<br><br>The <b>item</b> re
Requires
- php: ^8.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.4.5
- guzzlehttp/psr7: ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- overtrue/phplint: ^9.0
- phpunit/phpunit: ^9.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
The Browse API lets shoppers search eBay listings by keyword, category, GTIN, product, charity, compatibility criteria, or image, and refine results with filters such as aspects, compatibility, field values, and UI parameters through the item_summary resource.
The item resource lets applications retrieve detailed information for a specific item or all items in an item group, and check whether a product is compatible with a specified item, such as whether a specific vehicle is compatible with a specific part. The item resource also supports legacy item identifiers alongside RESTful item IDs, which use different formats. This helps developers work with stored or historical legacy item IDs when using the Browse API.
All methods in the Browse API require an Application access token, which is obtained using the <a href="/develop/guides-v2/authorization#the-client-credentials-grant-flow" target="_blank">client credentials grant flow.
Installation & Usage
Requirements
PHP 8.1 and later.
Composer
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/nogrod/ebay-buy-browse-php-sdk.git"
}
],
"require": {
"nogrod/ebay-buy-browse-php-sdk": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php:
<?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: api_auth $config = eBay\Buy\Browse\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new eBay\Buy\Browse\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 | This path parameter specifies the unique RESTful identifier of an item (such as the park you want to check).<br><br><b>RESTful Item ID Format: </b><code>v1</code>|<code><i>#</i></code>|<code><i>#</i></code><br><br>For a single SKU listing, pass in the item ID: <pre>v1|2**********2|0</pre>For a multi-SKU listing, pass in the identifier of the variation:<pre>v1|1**********2|4**********2</pre><br>For more information about item IDs for RESTful APIs, refer to <a href=\"/api-docs/buy/static/api-browse.html#Legacy\" target=\"_blank\">Item ID legacy API compatibility overview</a> in the <a href=\"/api-docs/buy/static/buying-ig-landing.html\" target=\"_blank\">Buying Integration Guide</a>. $x_ebay_c_marketplace_id = 'x_ebay_c_marketplace_id_example'; // string | This header identifies the seller's eBay marketplace. It is required for all marketplaces outside of the US.<br><br><span class=\"tablenote\"><b>Note:</b> If the marketplace ID value is invalid or missing, the default value of <code>EBAY_US</code> is used.</span><br>See <a href=\"/develop/api/buy/browse_api#buy-browse_api-item-getitem.marketplaceidenum\">MarketplaceIdEnum</a> for a list of supported marketplaces.<br><br><b>Default:</b> <code>EBAY_US</code> $accept_language = 'accept_language_example'; // string | This header is used to indicate the natural language and locale preferred by the user for the response.<br><br>This header is required when targeting a specific locale of a marketplace that supports multiple locales. For example:<ul><li>When targeting the French locale of the Belgium marketplace, it is required to pass in <code>fr-BE</code> to specify this. If this locale is not specified, the language will default to Dutch.</li><li>When targeting the French locale of the Canadian marketplace, it is required to pass in <code>fr-CA</code> to specify this. If this locale is not specified, the language will default to English.</li></ul> $compatibility_payload = new \eBay\Buy\Browse\Model\CompatibilityPayload(); // \eBay\Buy\Browse\Model\CompatibilityPayload try { $result = $apiInstance->checkCompatibility($item_id, $x_ebay_c_marketplace_id, $accept_language, $compatibility_payload); print_r($result); } catch (Exception $e) { echo 'Exception when calling ItemApi->checkCompatibility: ', $e->getMessage(), PHP_EOL; }
API Endpoints
All URIs are relative to https://api.ebay.com/buy/browse/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| ItemApi | checkCompatibility | POST /item/{item_id}/check_compatibility | |
| ItemApi | getItem | GET /item/{item_id} | |
| ItemApi | getItemByLegacyId | GET /item/get_item_by_legacy_id | |
| ItemApi | getItems | GET /item | |
| ItemApi | getItemsByItemGroup | GET /item/get_items_by_item_group | |
| ItemSummaryApi | search | GET /item_summary/search | |
| ItemSummaryApi | searchByImage | POST /item_summary/search_by_image |
Models
- AdditionalProductIdentity
- AddonService
- AddonServiceSelectionEnum
- AddonServiceTypeEnum
- Address
- Amount
- Aspect
- AspectDistribution
- AspectFilter
- AspectGroup
- AspectValueDistribution
- AttributeNameValue
- AuthenticityGuaranteeProgram
- AuthenticityVerificationProgram
- AutoCorrections
- AvailabilityStatusEnum
- AvailabilityThresholdEnum
- AvailableCoupon
- BuyingOptionDistribution
- Category
- CategoryDistribution
- CommonDescriptions
- CompanyAddress
- CompatibilityFilter
- CompatibilityMatchEnum
- CompatibilityPayload
- CompatibilityProperty
- CompatibilityResponse
- CompatibilityStatus
- CompatibilityStatusEnum
- ConditionDescriptor
- ConditionDescriptorValue
- ConditionDistribution
- ConvertedAmount
- CoreItem
- CountryCodeEnum
- CouponConstraint
- CouponDiscountType
- CouponDiscountTypeEnum
- CurrencyCodeEnum
- DeliveryOptionsEnum
- EconomicOperator
- Error
- ErrorDetailV3
- ErrorParameter
- ErrorParameterV3
- EstimatedAvailability
- FilterField
- FulfilledThroughEnum
- HazardPictogram
- HazardStatement
- HazardousMaterialsLabels
- Image
- Item
- ItemCharityTerms
- ItemGroup
- ItemGroupSummary
- ItemGroupTypeEnum
- ItemLocationImpl
- ItemReturnTerms
- ItemSummary
- Items
- LegalAddress
- MarketingPrice
- MarketplaceIdEnum
- PaymentInstructionEnum
- PaymentMethod
- PaymentMethodBrand
- PaymentMethodBrandEnum
- PaymentMethodTypeEnum
- PickupOptionSummary
- PriceDisplayConditionEnum
- PriceTreatmentEnum
- Product
- ProductIdentity
- ProductSafetyLabelPictogram
- ProductSafetyLabelStatement
- ProductSafetyLabels
- RangeValue
- RatingHistogram
- Refinement
- RefundMethodEnum
- Region
- RegionTypeEnum
- ResponsiblePerson
- ResponsiblePersonTypeEnum
- ReturnMethodEnum
- ReturnShippingCostPayerEnum
- ReviewRating
- SearchByImageRequest
- SearchPagedCollection
- Seller
- SellerCustomPolicy
- SellerCustomPolicyTypeEnum
- SellerDetail
- SellerInstructionEnum
- SellerLegalInfo
- ShipToLocation
- ShipToLocations
- ShipToRegion
- ShippingOption
- ShippingOptionSummary
- SortField
- TargetLocation
- TaxJurisdiction
- TaxType
- TaxTypeEnum
- Taxes
- TimeDuration
- TimeDurationUnitEnum
- TypedNameValue
- ValueTypeEnum
- VatDetail
Authorization
api_auth
- Type:
OAuth - Flow:
application - Authorization URL: ``
- Scopes:
- https://api.ebay.com/oauth/api_scope/buy.item.bulk: Retrieve eBay items in bulk.
- https://api.ebay.com/oauth/api_scope: View public data from eBay
Tests
To run the tests, use:
composer install vendor/bin/phpunit
Author
About this package
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
v1.20.4- Generator version:
7.25.0
- Generator version:
- Build package:
org.openapitools.codegen.languages.PhpNextgenClientCodegen