browse

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

README

ebay-browse-api

!!! It is very unstable version !!!

Golang client for eBay Browse API

For using eBay shopping API you need to get Application Token. You can make it using this repo.

Documentation

Index

Constants

View Source
const URLProductionGetItemByLegacyId = "https://api.ebay.com/buy/browse/v1/item/get_item_by_legacy_id"
View Source
const URLProductionGetItemsByItemGroup = "https://api.ebay.com/buy/browse/v1/item/get_items_by_item_group"
View Source
const URLProductionItemSummarySearch = "https://api.ebay.com/buy/browse/v1/item_summary/search"
View Source
const URLSandboxGetItemByLegacyId = "https://api.sandbox.ebay.com/buy/browse/v1/item/get_item_by_legacy_id"
View Source
const URLSandboxGetItemsByItemGroup = "https://api.sandbox.ebay.com/buy/browse/v1/item/get_items_by_item_group"
View Source
const URLSandboxItemSummarySearch = "https://api.sandbox.ebay.com/buy/browse/v1/item_summary/search"

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoCorrection

type AutoCorrection struct {
	Q string `json:"q"`
}

type BasicRequest

type BasicRequest struct {
	// contains filtered or unexported fields
}

type Category

type Category struct {
	CategoryID string `json:"categoryId"`
}

type CommonDescription added in v0.0.2

type CommonDescription struct {
	Description string   `json:"description"`
	ItemIDs     []string `json:"itemIds"`
}

type EbayMarketplace

type EbayMarketplace string

type ErrorDetailV3

type ErrorDetailV3 struct {
}

type EstimatedAvailability added in v0.0.2

type EstimatedAvailability struct {
	EstimatedAvailabilityStatus string   `json:"estimatedAvailabilityStatus"`
	EstimatedAvailableQuantity  int      `json:"estimatedAvailableQuantity"`
	EstimatedSoldQuantity       int      `json:"estimatedSoldQuantity"`
	DeliveryOptions             []string `json:"deliveryOptions"`
}

type FieldGroupsOptions added in v0.0.2

type FieldGroupsOptions string
const (
	FieldGroupsPRODUCT FieldGroupsOptions = "PRODUCT"
)

type FilterType

type FilterType string
const (
	FilterDeliveryCountry    FilterType = "deliveryCountry"
	FilterDeliveryPostalCode FilterType = "deliveryPostalCode"
)

https://developer.ebay.com/api-docs/buy/static/ref-buy-browse-filters.html

type Filterer

type Filterer interface {
	ToQueryParams() string
}

type GetItemByLegacyIdRequest added in v0.0.2

type GetItemByLegacyIdRequest struct {
	LegacyItemID       string
	LegacyVariationID  string
	LegacyVariationSKU string
	FieldGroups        []string
	BasicRequest
}

GetItemByLegacyIdRequest ...

func (*GetItemByLegacyIdRequest) Execute added in v0.0.2

func (*GetItemByLegacyIdRequest) ShowParams added in v0.0.2

func (r *GetItemByLegacyIdRequest) ShowParams() url.Values

func (*GetItemByLegacyIdRequest) WithFieldGroups added in v0.0.2

func (r *GetItemByLegacyIdRequest) WithFieldGroups(fieldGroups ...FieldGroupsOptions) *GetItemByLegacyIdRequest

WithFieldGroups adds fieldsGroups parameter to GetItemByLegacyIdRequest

func (*GetItemByLegacyIdRequest) WithItemID added in v0.0.2

func (r *GetItemByLegacyIdRequest) WithItemID(legacyItemID string) *GetItemByLegacyIdRequest

WithItemID adds legacyItemID parameter to GetItemByLegacyIdRequest

func (*GetItemByLegacyIdRequest) WithLegacyVariationID added in v0.0.2

func (r *GetItemByLegacyIdRequest) WithLegacyVariationID(legacyVariationID string) *GetItemByLegacyIdRequest

WithLegacyVariationID adds legacyVariationID parameter to GetItemByLegacyIdRequest

func (*GetItemByLegacyIdRequest) WithLegacyVariationSKY added in v0.0.2

func (r *GetItemByLegacyIdRequest) WithLegacyVariationSKY(legacyVariationSKY string) *GetItemByLegacyIdRequest

WithLegacyVariationSKY adds legacyVariationSKY parameter to GetItemByLegacyIdRequest

type GetItemByLegacyIdResponse added in v0.0.2

type GetItemByLegacyIdResponse struct {
	Item
}

GetItemByLegacyIdResponse is a responce for GetItemByLegacyIdRequest

type GetItemsByItemGroupRequest added in v0.0.2

type GetItemsByItemGroupRequest struct {
	ItemGroupID string
	BasicRequest
}

GetItemsByItemGroupRequest ...

func (*GetItemsByItemGroupRequest) Execute added in v0.0.2

func (*GetItemsByItemGroupRequest) ShowParams added in v0.0.2

func (r *GetItemsByItemGroupRequest) ShowParams() url.Values

func (*GetItemsByItemGroupRequest) WithItemGroupID added in v0.0.2

func (r *GetItemsByItemGroupRequest) WithItemGroupID(itemGroupID string) *GetItemsByItemGroupRequest

WithItemGroupID adds itemGroupID parameter to GetItemsByItemGroupRequest

type GetItemsByItemGroupResponse added in v0.0.2

type GetItemsByItemGroupResponse struct {
	CommonDescriptions []CommonDescription `json:"commonDescriptions"`
	Items              []Item              `json:"items"`
}

GetItemsByItemGroupResponse is a responce for GetItemsByItemGroupRequest

type Image

type Image struct {
	ImageURL string `json:"imageUrl"`
}

type Item added in v0.0.2

type Item struct {
	ItemID           string `json:"itemId"`
	Title            string `json:"title"`
	ShortDescription string `json:"shortDescription"`
	Price            Price  `json:"price"`
	CategoryPath     string `json:"categoryPath"`
	Condition        string `json:"condition"`
	ConditionID      string `json:"conditionId"`
	//itemLocation
	Image                   Image
	AdditionalImages        []Image                 `json:"additionalImages"`
	Brand                   string                  `json:"brand"`
	Seller                  Seller                  `json:"seller"`
	GTIN                    string                  `json:"gtin"`
	MPN                     string                  `json:"mpn"`
	EstimatedAvailabilities []EstimatedAvailability `json:"estimatedAvailabilities"`
	ShippingOptions         []ShippingOption        `json:"shippingOptions"`
	// shipToLocations
	// returnTerms
	// taxes
	LocalizedAspects         []LocalizedAspect `json:"localizedAspects"`
	TopRatedBuyingExperience bool              `json:"topRatedBuyingExperience"`
	BuyingOptions            []string          `json:"buyingOptions"`
	ItemWebURL               string            `json:"itemWebUrl"`
	//paymentMethods
	PrimaryItemGroup PrimaryItemGroup `json:"primaryItemGroup"`
	//enabledForGuestCheckout
	//eligibleForInlineCheckout
	LegacyItemID string `json:"legacyItemId"`
	//priorityListing
	//adultOnly
	CategoryID string `json:"categoryId"`
}

type ItemLocation

type ItemLocation struct {
	PostalCode string `json:"postalCode"`
	Country    string `json:"country"`
}

type ItemSummary

type ItemSummary struct {
	ItemID                   string           `json:"itemId"`
	Title                    string           `json:"title"`
	ShortDescription         string           `json:"shortDescription"`
	Image                    Image            `json:"image"`
	BidCount                 int              `json:"bidCount"`
	WatchCount               int              `json:"watchCount"`
	ItemEndDate              string           `json:"itemEndDate"`
	ItemAffiliateWebURL      string           `json:"itemAffiliateWebUrl"`
	Price                    Price            `json:"price"`
	ItemHref                 string           `json:"itemHref"`
	Seller                   Seller           `json:"seller"`
	MarketingPrice           MarketingPrice   `json:"marketingPrice"`
	Condition                string           `json:"condition"`
	ConditionID              string           `json:"conditionId"`
	ThumbnailImages          []Image          `json:"thumbnailImages"`
	ShippingOptions          []ShippingOption `json:"shippingOptions"`
	BuyingOptions            []string         `json:"buyingOptions"`
	CurrentBidPrice          Price            `json:"currentBidPrice"`
	Epid                     string           `json:"epid"`
	ItemWebURL               string           `json:"itemWebUrl"`
	ItemLocation             ItemLocation     `json:"itemLocation"`
	Categories               []Category       `json:"categories"`
	AdditionalImages         []Image          `json:"additionalImages"`
	LegacyItemID             string           `json:"legacyItemId"`
	AdultOnly                bool             `json:"adultOnly"`
	AvailableCoupons         bool             `json:"availableCoupons"`
	PriorityListing          bool             `json:"priorityListing"`
	TopRatedBuyingExperience bool             `json:"topRatedBuyingExperience"`
}

type ItemSummarySearchRequest

type ItemSummarySearchRequest struct {
	Q           string
	Limit       string
	Offset      string
	CategoryIDs []string
	AutoCorrect []string
	Sort        []string
	FilterMap   map[string]Filterer
	BasicRequest
}

func (*ItemSummarySearchRequest) Execute

func (*ItemSummarySearchRequest) ShowParams

func (r *ItemSummarySearchRequest) ShowParams() url.Values

func (*ItemSummarySearchRequest) WithAutoCorrect

func (r *ItemSummarySearchRequest) WithAutoCorrect(values ...string) *ItemSummarySearchRequest

WithAutoCorrect adds autocorrecting option to ItemSummarySearchRequest Leave empty to omit

func (*ItemSummarySearchRequest) WithCategoryID

func (r *ItemSummarySearchRequest) WithCategoryID(categoryID string) *ItemSummarySearchRequest

WithCategoryID adds categories for search to ItemSummarySearchRequest Leave empty to omit

func (r *ItemSummarySearchRequest) WithCategories(categories ...string) *ItemSummarySearchRequest {
	r.CategoryIDs = categories
	return r
}

func (*ItemSummarySearchRequest) WithFilterDeliveryCountry

func (r *ItemSummarySearchRequest) WithFilterDeliveryCountry(country string) *ItemSummarySearchRequest

WithFilterDeliveryCountry adds filter by deliveryCountry to ItemSummarySearchRequest Parameter for this function is Two-character ISO 3166 Country Code ("US", "GB" etc.)

func (*ItemSummarySearchRequest) WithFilterDeliveryPostalCode

func (r *ItemSummarySearchRequest) WithFilterDeliveryPostalCode(postalCode string) *ItemSummarySearchRequest

WithFilterDeliveryPostalCode adds filter by deliveryPostalCode to ItemSummarySearchRequest Must be used with deliveryCountry parameter.

func (*ItemSummarySearchRequest) WithLimit

WithLimit sets limit of items per page to ItemSummarySearchRequest Default : 50

func (*ItemSummarySearchRequest) WithOffset

func (r *ItemSummarySearchRequest) WithOffset(offset int) *ItemSummarySearchRequest

WithOffset adds offset to skip during the call. Field of ItemSummarySearchRequest Default : 0

func (*ItemSummarySearchRequest) WithQuery

WithQuery adds query parameter to ItemSummarySearchRequest

func (*ItemSummarySearchRequest) WithSort

WithSort adds sorting order to ItemSummarySearchRequest Default: BestMatch

type ItemSummarySearchResponse

type ItemSummarySearchResponse struct {
	AutoCorrections AutoCorrection `json:"autoCorrections"`
	Href            string         `json:"href"`
	Next            string         `json:"next"`
	Prev            string         `json:"prev"`
	ItemSummaries   []ItemSummary  `json:"itemSummaries"`
	Limit           int            `json:"limit"`
	Offset          int            `json:"offset"`
	Total           int            `json:"total"`
}

type LocalizedAspect added in v0.0.2

type LocalizedAspect struct {
	Type  string `json:"type"`
	Name  string `json:"name"`
	Value string `json:"value"`
}

type ManyValueFilter

type ManyValueFilter struct {
	Title  string
	Values []string
}

type MarketingPrice

type MarketingPrice struct {
	OriginalPrice      Price  `json:"originalPrice"`
	DiscountPercentage string `json:"discountPercentage"`
	DiscountAmount     Price  `json:"discountAmount"`
	PriceTreatment     string `json:"priceTreatment"`
}

type OneValueFilter

type OneValueFilter struct {
	Title string
	Value string
}

func (OneValueFilter) ToQueryParams

func (ovf OneValueFilter) ToQueryParams() string

type Price

type Price struct {
	Value                 string `json:"value"`
	Currency              string `json:"currency"`
	ConvertedFromValue    string `json:"convertedFromValue"`
	ConvertedFromCurrency string `json:"convertedFromCurrency"`
}

type PrimaryItemGroup added in v0.0.2

type PrimaryItemGroup struct {
	ItemGroupID               string  `json:"itemGroupId"`
	ItemGroupType             string  `json:"itemGroupType"`
	ItemGroupHref             string  `json:"itemGroupHref"`
	ItemGroupTitle            string  `json:"itemGroupTitle"`
	ItemGroupImage            Image   `json:"itemGroupImage"`
	ItemGroupAdditionalImages []Image `json:"itemGroupAdditionalImages"`
}

type Refinement

type Refinement struct {
}

type Seller

type Seller struct {
	Username           string `json:"username"`
	FeedbackPercentage string `json:"feedbackPercentage"`
	FeedbackScore      int    `json:"feedbackScore"`
	SellerAccountType  string `json:"sellerAccountType"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(appToken string) *Service

NewService creates new Service. It requires already created Application Token. You can use this repo to create token https://github.com/hotafrika/ebay-common More info here https://developer.ebay.com/api-docs/static/oauth-client-credentials-grant.html

func (*Service) NewGetItemByLegacyIdRequest added in v0.0.2

func (s *Service) NewGetItemByLegacyIdRequest() *GetItemByLegacyIdRequest

NewGetItemByLegacyIdRequest creates new GetItemByLegacyIdRequest

func (*Service) NewGetItemsByItemGroupRequest added in v0.0.2

func (s *Service) NewGetItemsByItemGroupRequest() *GetItemsByItemGroupRequest

NewGetItemsByItemGroupRequest creates new GetItemsByItemGroupRequest

func (*Service) NewItemSummarySearchRequest

func (s *Service) NewItemSummarySearchRequest() *ItemSummarySearchRequest

NewItemSummarySearchRequest creates new ItemSummarySearchRequest

func (*Service) WithApplicationToken

func (s *Service) WithApplicationToken(token string) *Service

WithApplicationToken sets application token (Authorization) header for HTTP client. The same header will be for all child requests.

func (*Service) WithLimit

func (s *Service) WithLimit(limit int) *Service

WithLimit tells to Service to create requests with specified limit per page. Default: 50

func (*Service) WithMarketplace

func (s *Service) WithMarketplace(marketplace EbayMarketplace) *Service

WithMarketplace sets marketplace header for HTTP client. The same header will be for all child requests.

func (*Service) WithSandbox

func (s *Service) WithSandbox(isSandbox bool) *Service

WithSandbox tells to Service to create Sandbox requests.

func (*Service) WithTimeout

func (s *Service) WithTimeout(timeout time.Duration) *Service

WithTimeout sets timeout for HTTP client. The same timeout will be for all child requests.

type ShippingOption

type ShippingOption struct {
	GuaranteedDelivery       bool   `json:"guaranteedDelivery"`
	MaxEstimatedDeliveryDate string `json:"maxEstimatedDeliveryDate"`
	MinEstimatedDeliveryDate string `json:"minEstimatedDeliveryDate"`
	ShippingCostType         string `json:"shippingCostType"`
	ShippingCost             Price  `json:"shippingCost"`
}

type TwoValueFilter

type TwoValueFilter struct {
	Title  string
	Value1 string
	Value2 string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL