ebay

package module
v0.0.0-...-8931a90 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-ebay

An ebay search api client in golang.

Install

You'll need to have golang installed.

$ go get github.com/rmpacheco/go-ebay

Example

import (
	"github.com/rmpacheco/go-ebay"
)

var (
	ebay_application_id = "your_application_id_here"
)

func main() {
	e := ebay.New(ebay_application_id)
	response, err := e.FindItemsByKeywords(ebay.GLOBAL_ID_EBAY_US, "DJM 900, DJM 850", 10)
	if err != nil {
		fmt.Println("ERROR: ", err)
		os.Exit(1)
	}
	for _, i := range response.Items {
		fmt.Println("Title: ", i.Title)
		fmt.Println("\tListing Url:     ", i.ListingUrl)
		fmt.Println("\tBin Price:       ", i.BinPrice)
		fmt.Println("\tCurrent Price:   ", i.CurrentPrice)
		fmt.Println("\tShipping Price:  ", i.ShippingPrice)
		fmt.Println()
	}
}

Documentation

Index

Constants

View Source
const (
	GLOBAL_ID_EBAY_US = "EBAY-US"
	GLOBAL_ID_EBAY_FR = "EBAY-FR"
	GLOBAL_ID_EBAY_DE = "EBAY-DE"
	GLOBAL_ID_EBAY_IT = "EBAY-IT"
	GLOBAL_ID_EBAY_ES = "EBAY-ES"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EBay

type EBay struct {
	ApplicationID string
	HTTPRequest   *httprequest.HttpRequest
}

EBay API request

func New

func New(applicationID string) *EBay

New EBay API request

func (*EBay) FindItemsByKeywords

func (e *EBay) FindItemsByKeywords(globalID string, keywords string, entriesPerPage int, binOnly bool) (FindItemsResponse, error)

FindItemsByKeywords returns items matching the keyword search terms

func (*EBay) FindSoldItems

func (e *EBay) FindSoldItems(globalID string, keywords string, entriesPerPage int) (FindCompletedItemsResponse, error)

FindSoldItems returns sold items by keyword

type Error

type Error struct {
	ErrorID   string `xml:"errorId"`
	Domain    string `xml:"domain"`
	Severity  string `xml:"severity"`
	Category  string `xml:"category"`
	Message   string `xml:"message"`
	SubDomain string `xml:"subdomain"`
}

Error response from EBay

type ErrorMessage

type ErrorMessage struct {
	XMLName xml.Name `xml:"errorMessage"`
	Error   Error    `xml:"error"`
}

ErrorMessage from EBay

type FindCompletedItemsResponse

type FindCompletedItemsResponse struct {
	XMLName   xml.Name `xml:"findCompletedItemsResponse"`
	Items     []Item   `xml:"searchResult>item"`
	Timestamp string   `xml:"timestamp"`
}

FindCompletedItemsResponse from EBay

type FindItemsResponse

type FindItemsResponse struct {
	XMLName   xml.Name `xml:"findItemsByKeywordsResponse"`
	Items     []Item   `xml:"searchResult>item"`
	Timestamp string   `xml:"timestamp"`
}

FindItemsResponse from EBay

type Item

type Item struct {
	ItemID        string    `xml:"itemId"`
	Title         string    `xml:"title"`
	Location      string    `xml:"location"`
	CurrentPrice  float64   `xml:"sellingStatus>currentPrice"`
	ShippingPrice float64   `xml:"shippingInfo>shippingServiceCost"`
	BinPrice      float64   `xml:"listingInfo>buyItNowPrice"`
	ShipsTo       []string  `xml:"shippingInfo>shipToLocations"`
	ListingURL    string    `xml:"viewItemURL"`
	ImageURL      string    `xml:"galleryURL"`
	Site          string    `xml:"globalId"`
	EndTime       time.Time `xml:"listingInfo>endTime"`
}

Item for sale on EBay

Jump to

Keyboard shortcuts

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