ebay-go Another golang ebay API, mostly for searching.

go get



Another golang ebay API, mostly for searching.


go get


eb := ebay.New("my application ID")
items, err := eb.Search("Something")
if err != nil {return err}
completed, err := eb.SearchCompleted("Something finished")


cheapest := LowestPrice(itemlist)       // returns the item with the lowest price
c2 := LowestPricePlusShipping(itemlist) //returns cheapest with shipping
e := EndingSoonest(itemlist)            //ending soonest


package main
import (
const ebay_application_id = "My_Application_ID"
var (
    eb *ebay.EBay

func init() {
    eb = ebay.New(ebay_application_id)

func main() {
    search_string := "Atari%202600%20combat"
    // Optionally, set a category id
    // eb.CategoryID=1122334455
    itemlist, err  := eb.Search(search_string)
    if err != nil {
        fmt.Printf("eb.Search(%s): %s", search_string, err)
    for _, i := range itemlist {
        fmt.Printf("ID: %s\n", i.ID)                        //"322119314985"
        fmt.Printf("Location: %s\n", i.Location)            //"Minneapolis,MN,USA"
        fmt.Printf("Url: %s\n", i.Url)                      //""
        fmt.Printf("ImageUrl: %s\n", i.ImageUrl)            //""
        fmt.Printf("Title: %s\n", i.Title)                  //"3-D Tic-Tac-Toe (Atari 2600, 1980) CARTRIDGE ONLY! CLEAN & TESTED! "
        fmt.Printf("Price: %v\n", i.Price)                  //5.95
        fmt.Printf("BuyItNowPrice: %v\n", i.BuyItNowPrice)  //0.00
        fmt.Printf("BuyItNow: %v\n", i.BuyItNow)            //false
        fmt.Printf("ShippingPrice: %v\n", i.ShippingPrice)  //0.0
        fmt.Printf("FreeShipping: %v\n", i.FreeShipping)    //true
        fmt.Printf("StartTime: %s\n", i.StartTime)          //"2016-05-23T20:41:25.000Z"
        fmt.Printf("EndTime: %s\n", i.EndTime)              //"2016-06-22T20:41:25.000Z"
        fmt.Printf("BestOffer: %s\n", i.BestOffer)          //false
    ci := ebay.LowestPrice(itemlist)
    fmt.Printf("Cheapest ID and price: %s, %s\n", ci.ID, ci.Price)
    cips := ebay.LowestPricePlusShipping(itemlist)
    fmt.Printf("Cheapest price+shipping: id: %s, price: %v, shipping: %v, shippingtype: %s\n", cips.ID, cips.Price, cips.ShippingPrice, cips.ShippingType)
    es := ebay.EndingSoonest(itemlist)
    fmt.Printf("Ending soonest: ID: %s, Endtime: %s\n", es.ID, es.EndTime)
    //find some completed auctions
    completedlist, err := eb.SearchCompleted("antique rocking horse")
    if err != nil {
        fmt.Printf("eb.SearchCompleted(...): %s", err)
    // All the sorting, etc work the same on completed as on regular auctions
    ci = ebay.LowestPricePlusShipping(completedlist)