The Browse API has the following resources:
- item_summary: Lets shoppers search for specific items by keyword, GTIN, category, charity, product, image
(Experimental Method), or item aspects and refine the results by using filters, such as aspects, compatibility, and fields values, or UI parameters.
- item:
- Lets you retrieve the details of a specific item or all the items in an item group, which is an item with variations such as color and size and check if a product is compatible with the specified item, such as if a specific car is compatible with a specific part.
- Provides a bridge between the eBay legacy APIs, such as Finding, and the RESTful APIs, which use different formats for the item IDs.
The item_summary, search_by_image, and item resource calls require an Application access token.
PHP 7.4 and later. Should also work with PHP 8.0.
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/numerogeek/ebay-browse-api.git"
}
],
"require": {
"numerogeek/ebay-browse-api": "*@dev"
}
}Then run composer install
Download the files and include autoload.php:
<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');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 = 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;
}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 |
- 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
- 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
To run the tests, use:
composer install
vendor/bin/phpunitThis PHP package is automatically generated by the OpenAPI Generator project:
- API version:
v1.18.4- Package version:
1.0
- Package version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen