Search by

nogrod / ebay-buy-browse-php-sdk

Nogrod

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

Package info

github.com/Nogrod/ebay-buy-browse-php-sdk

Homepage

pkg:composer/nogrod/ebay-buy-browse-php-sdk

Statistics

Installs: 554

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.2.2 2026-09-01 19:11 UTC

This package is auto-updated.

Last update: 2026-09-01 19:37:19 UTC


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

Authorization

api_auth

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
  • Build package: org.openapitools.codegen.languages.PhpNextgenClientCodegen