numerogeek/ebay-browse-api

<p>The Browse API has the following resources:</p> <ul> <li><b> item_summary: </b> Lets shoppers search for specific items by keyword, GTIN, category, charity, product, image </b><a href="/api-docs/static/versioning.html#experimental " target="_blank"><img src="/cms/img/docs/experimental-icon.svg"

1.0 2023-05-18 18:44 UTC

This package is auto-updated.

Last update: 2024-04-18 20:47:57 UTC


README

The Browse API has the following resources:

  • item_summary: Lets shoppers search for specific items by keyword, GTIN, category, charity, product, image \"Experimental(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.

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

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

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 = 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 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.18.4
    • Package version: 1.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen