class Ebay::Finding

The Finding API lets you search and browse for items listed on eBay and provides useful metadata to refine searches.

@see developer.ebay.com/Devzone/finding/Concepts/MakingACall.html @see developer.ebay.com/Devzone/finding/CallRef/index.html

Attributes

global_id[R]

@return [String]

message_encoding[R]

@return [String]

response_data_format[R]

@return [String]

security_appname[R]

@return [String]

service_version[R]

@return [String]

Public Class Methods

new(global_id: nil, message_encoding: nil, response_data_format: nil, security_appname: Config.app_id, service_version: nil) click to toggle source

Returns a Finding API request instance

@see developer.ebay.com/Devzone/finding/Concepts/SiteIDToGlobalID.html @param [String] global_id @param [String] message_encoding @param [String] response_data_format @param [String] security_appname @param [String] service_version

# File lib/ebay/finding.rb, line 46
def initialize(global_id: nil, message_encoding: nil,
               response_data_format: nil,
               security_appname: Config.app_id, service_version: nil)
  @global_id = global_id
  @message_encoding = message_encoding
  @response_data_format = response_data_format
  @security_appname = security_appname
  @service_version = service_version
end

Public Instance Methods

find_completed_items(payload = {}) click to toggle source

Searches for items whose listings are completed

@param [Hash] payload @return [HTTP::Response]

# File lib/ebay/finding.rb, line 60
def find_completed_items(payload = {})
  request('findCompletedItems', payload)
end
find_items_advanced(payload = {}) click to toggle source

Searches for items by category or keyword or both

@param [Hash] payload @return [HTTP::Response]

# File lib/ebay/finding.rb, line 68
def find_items_advanced(payload = {})
  request('findItemsAdvanced', payload)
end
find_items_by_category(payload = {}) click to toggle source

Searches for items using specific eBay category ID numbers

@param [Hash] payload @return [HTTP::Response]

# File lib/ebay/finding.rb, line 76
def find_items_by_category(payload = {})
  request('findItemsByCategory', payload)
end
find_items_by_keywords(keywords, payload = {}) click to toggle source

Searches for items by a keyword query

@param [String] keywords @param [Hash] payload @return [HTTP::Response]

# File lib/ebay/finding.rb, line 85
def find_items_by_keywords(keywords, payload = {})
  payload = payload.merge('keywords' => keywords)
  request('findItemsByKeywords', payload)
end
find_items_by_product(product_id, product_id_type, payload = {}) click to toggle source

Searches for items using specific eBay product values\

@param [String] product_id @param [String] product_id_type @param [Hash] payload @return [HTTP::Response]

# File lib/ebay/finding.rb, line 96
def find_items_by_product(product_id, product_id_type, payload = {})
  payload = payload.merge('productId' => product_id,
                          'productId.@type' => product_id_type)

  request('findItemsByProduct', payload)
end
find_items_in_ebay_stores(payload = {}) click to toggle source

Searches for items in the eBay store inventories

@param [Hash] payload @return [HTTP::Response]

# File lib/ebay/finding.rb, line 107
def find_items_in_ebay_stores(payload = {})
  request('findItemsIneBayStores', payload)
end
get_histograms(category_id) click to toggle source

Retrieves category and/or aspect histogram information for an eBay category

@param [String] category_id @return [HTTP::Response]

# File lib/ebay/finding.rb, line 116
def get_histograms(category_id)
  request('getHistograms', 'categoryId' => category_id)
end
get_search_keywords_recommendation(keywords) click to toggle source

Retrieves commonly used words found in eBay titles, based on the words you supply

@param [String] keywords @return [HTTP::Response]

# File lib/ebay/finding.rb, line 125
def get_search_keywords_recommendation(keywords)
  request('getSearchKeywordsRecommendation', 'keywords' => keywords)
end
get_version() click to toggle source

Returns the current version of the service

@return [HTTP::Response]

# File lib/ebay/finding.rb, line 132
def get_version
  request('getVersion')
end

Private Instance Methods

request(operation, payload = {}) click to toggle source
# File lib/ebay/finding.rb, line 138
def request(operation, payload = {})
  params = { 'GLOBAL-ID' => global_id,
             'MESSAGE-ENCODING' => message_encoding,
             'OPERATION-NAME' => operation,
             'RESPONSE-DATA-FORMAT' => response_data_format,
             'SECURITY-APPNAME' => security_appname,
             'SERVICE-VERSION' => service_version }.update(payload).compact

  http.headers(headers).get(endpoint, params: params)
end