Documentation
¶
Index ¶
- Constants
- func LoadTCGSKUs(reader io.Reader) (mtgjson.AllTCGSkus, error)
- func Preprocess(product *TCGProduct, editions map[int]string) (*mtgmatcher.Card, error)
- func SellerName2ID(sellerName string) (string, error)
- func TCGInventoryForSeller(sellerKey string, size, page int, sets ...string) (*sellerInventoryResponse, error)
- func TCGLatestSales(tcgProductId string, foil ...bool) (*latestSalesResponse, error)
- func TCGPlayerProductURL(productId int, printing, affiliate, language string) string
- type LatestSalesData
- type SellerInventoryResult
- type TCGAutoClient
- type TCGAutocartRequest
- type TCGAutocartResponse
- type TCGCategory
- type TCGClient
- func (tcg *TCGClient) EditionMap(category int) (map[int]TCGGroup, error)
- func (tcg *TCGClient) Get(url string) (*TCGResponse, error)
- func (tcg *TCGClient) ListAllGroups(category int, offset int, limit int) ([]TCGGroup, error)
- func (tcg *TCGClient) ListAllProducts(category int, productTypes []string, includeSkus bool, offset int, limit int) ([]TCGProduct, error)
- func (tcg *TCGClient) SKUsForId(productId string) ([]TCGSKU, error)
- func (tcg *TCGClient) TCGBuylistPricesForSKUs(ids []string) ([]TCGSKUPrice, error)
- func (tcg *TCGClient) TCGCategoriesDetails(ids []int) ([]TCGCategory, error)
- func (tcg *TCGClient) TCGPricesForIds(productIds []string) ([]TCGPrice, error)
- func (tcg *TCGClient) TCGPricesForSKUs(ids []string) ([]TCGSKUPrice, error)
- func (tcg *TCGClient) TotalGroups(category int) (int, error)
- func (tcg *TCGClient) TotalProducts(category int, productTypes []string) (int, error)
- type TCGDirectNet
- type TCGGroup
- type TCGPlayerGeneric
- func (tcg *TCGPlayerGeneric) Info() (info mtgban.ScraperInfo)
- func (tcg *TCGPlayerGeneric) InitializeInventory(reader io.Reader) error
- func (tcg *TCGPlayerGeneric) Inventory() (mtgban.InventoryRecord, error)
- func (tcg *TCGPlayerGeneric) InventoryForSeller(sellerName string) (mtgban.InventoryRecord, error)
- type TCGPlayerIndex
- func (tcg *TCGPlayerIndex) Info() (info mtgban.ScraperInfo)
- func (tcg *TCGPlayerIndex) InitializeInventory(reader io.Reader) error
- func (tcg *TCGPlayerIndex) Inventory() (mtgban.InventoryRecord, error)
- func (tcg *TCGPlayerIndex) InventoryForSeller(sellerName string) (mtgban.InventoryRecord, error)
- func (tcg *TCGPlayerIndex) MarketNames() []string
- type TCGPlayerMarket
- func (tcg *TCGPlayerMarket) Buylist() (mtgban.BuylistRecord, error)
- func (tcg *TCGPlayerMarket) Info() (info mtgban.ScraperInfo)
- func (tcg *TCGPlayerMarket) InitializeBuylist(reader io.Reader) error
- func (tcg *TCGPlayerMarket) InitializeInventory(reader io.Reader) error
- func (tcg *TCGPlayerMarket) Inventory() (mtgban.InventoryRecord, error)
- func (tcg *TCGPlayerMarket) InventoryForSeller(sellerName string) (mtgban.InventoryRecord, error)
- func (tcg *TCGPlayerMarket) MarketNames() []string
- type TCGPlayerSealed
- type TCGPrice
- type TCGProduct
- type TCGResponse
- type TCGSKU
- type TCGSKUPrice
- type TCGSYPList
- type TCGSellerInventory
Constants ¶
View Source
const ( CategoryMagic = 1 CategoryYuGiOh = 2 CategoryPokemon = 3 ProductTypeCards = "Cards" ProductTypeBoosterBox = "Booster Box" ProductTypeBoosterPack = "Booster Pack" ProductTypeSealedProducts = "Sealed Products" ProductTypeIntroPack = "Intro Pack" ProductTypeFatPack = "Fat Pack" ProductTypeBoxSets = "Box Sets" ProductTypePreconEventDecks = "Precon/Event Decks" ProductTypeMagicDeckPack = "Magic Deck Pack" ProductTypeMagicBoosterBoxCase = "Magic Booster Box Case" ProductTypeAll5IntroPacks = "All 5 Intro Packs" ProductTypeIntroPackDisplay = "Intro Pack Display" ProductType3xMagicBoosterPacks = "3x Magic Booster Packs" ProductTypeBoosterBattlePack = "Booster Battle Pack" MaxLimit = 100 )
View Source
const ( SellersPageURL = "https://shop.tcgplayer.com/sellers" SellerInventoryURL = "https://mp-search-api.tcgplayer.com/v1/search/request?q=&isList=true" DefaultSellerRequestSize = 500 MaxGlobalScrapingValue = 8000 )
Variables ¶
This section is empty.
Functions ¶
func LoadTCGSKUs ¶
func LoadTCGSKUs(reader io.Reader) (mtgjson.AllTCGSkus, error)
func Preprocess ¶
func Preprocess(product *TCGProduct, editions map[int]string) (*mtgmatcher.Card, error)
func SellerName2ID ¶ added in v0.3.16
func TCGInventoryForSeller ¶ added in v0.3.16
func TCGLatestSales ¶
func TCGPlayerProductURL ¶
Types ¶
type LatestSalesData ¶
type LatestSalesData struct { Condition string `json:"condition"` Variant string `json:"variant"` Language string `json:"language"` Quantity int `json:"quantity"` Title string `json:"title"` ListingType string `json:"listingType"` CustomListingID string `json:"customListingId"` PurchasePrice float64 `json:"purchasePrice"` ShippingPrice float64 `json:"shippingPrice"` OrderDate time.Time `json:"orderDate"` }
type SellerInventoryResult ¶ added in v0.3.16
type SellerInventoryResult struct { FoilOnly bool `json:"foilOnly"` ImageCount float64 `json:"imageCount"` LowestPrice float64 `json:"lowestPrice"` LowestPriceWithShipping float64 `json:"lowestPriceWithShipping"` MarketPrice float64 `json:"marketPrice"` MaxFulfillableQuantity float64 `json:"maxFulfillableQuantity"` NormalOnly bool `json:"normalOnly"` ProductID float64 `json:"productId"` ProductLineID float64 `json:"productLineId"` ProductLineName string `json:"productLineName"` ProductLineURLName string `json:"productLineUrlName"` ProductName string `json:"productName"` ProductStatusID float64 `json:"productStatusId"` ProductTypeID float64 `json:"productTypeId"` ProductTypeName string `json:"productTypeName"` ProductURLName string `json:"productUrlName"` RarityName string `json:"rarityName"` Score float64 `json:"score"` Sealed bool `json:"sealed"` SellerListable bool `json:"sellerListable"` Sellers float64 `json:"sellers"` SetCode string `json:"setCode"` SetID float64 `json:"setId"` SetName string `json:"setName"` SetURLName string `json:"setUrlName"` ShippingCategoryID float64 `json:"shippingCategoryId"` TotalListings float64 `json:"totalListings"` CustomAttributes struct { Number string `json:"number"` } `json:"customAttributes"` Listings []struct { ChannelID float64 `json:"channelId"` Condition string `json:"condition"` ConditionID float64 `json:"conditionId"` DirectInventory float64 `json:"directInventory"` DirectProduct bool `json:"directProduct"` DirectSeller bool `json:"directSeller"` ForwardFreight bool `json:"forwardFreight"` GoldSeller bool `json:"goldSeller"` Language string `json:"language"` LanguageAbbreviation string `json:"languageAbbreviation"` LanguageID float64 `json:"languageId"` ListingID float64 `json:"listingId"` ListingType string `json:"listingType"` Price float64 `json:"price"` Printing string `json:"printing"` ProductConditionID float64 `json:"productConditionId"` ProductID float64 `json:"productId"` Quantity float64 `json:"quantity"` RankedShippingPrice float64 `json:"rankedShippingPrice"` Score float64 `json:"score"` SellerID string `json:"sellerId"` SellerKey string `json:"sellerKey"` SellerName string `json:"sellerName"` SellerRating float64 `json:"sellerRating"` SellerSales string `json:"sellerSales"` SellerShippingPrice float64 `json:"sellerShippingPrice"` ShippingPrice float64 `json:"shippingPrice"` VerifiedSeller bool `json:"verifiedSeller"` } `json:"listings"` }
type TCGAutoClient ¶ added in v0.3.34
type TCGAutoClient struct {
// contains filtered or unexported fields
}
func NewTCGAutoClient ¶ added in v0.3.34
func NewTCGAutoClient(cartId string) *TCGAutoClient
func (*TCGAutoClient) AddProductToCart ¶ added in v0.3.34
func (tcg *TCGAutoClient) AddProductToCart(sellerKey string, skuId, qty int, isDirect bool) (*TCGAutocartResponse, error)
type TCGAutocartRequest ¶ added in v0.3.34
type TCGAutocartResponse ¶ added in v0.3.34
type TCGAutocartResponse struct { Errors []struct { Code string `json:"Code"` Message string `json:"Message"` } Results []struct { IsDirect bool `json:"IsDirect"` SellerQuantityAvailable int `json:"SellerQuantityAvailable"` ItemQuantityInCart int `json:"ItemQuantityInCart"` CurrentPrice float64 `json:"CurrentPrice"` Status int `json:"Status"` } }
type TCGCategory ¶
type TCGCategory struct { CategoryID int `json:"categoryId"` Name string `json:"name"` ModifiedOn string `json:"modifiedOn"` DisplayName string `json:"displayName"` SeoCategoryName string `json:"seoCategoryName"` SealedLabel string `json:"sealedLabel"` NonSealedLabel string `json:"nonSealedLabel"` ConditionGuideURL string `json:"conditionGuideUrl"` IsScannable bool `json:"isScannable"` Popularity int `json:"popularity"` }
type TCGClient ¶
type TCGClient struct {
// contains filtered or unexported fields
}
func NewTCGClient ¶
func (*TCGClient) EditionMap ¶
func (*TCGClient) Get ¶
func (tcg *TCGClient) Get(url string) (*TCGResponse, error)
Perform an authenticated GET request on any URL
func (*TCGClient) ListAllGroups ¶
func (*TCGClient) ListAllProducts ¶
func (*TCGClient) TCGBuylistPricesForSKUs ¶
func (tcg *TCGClient) TCGBuylistPricesForSKUs(ids []string) ([]TCGSKUPrice, error)
func (*TCGClient) TCGCategoriesDetails ¶
func (tcg *TCGClient) TCGCategoriesDetails(ids []int) ([]TCGCategory, error)
func (*TCGClient) TCGPricesForIds ¶
func (*TCGClient) TCGPricesForSKUs ¶
func (tcg *TCGClient) TCGPricesForSKUs(ids []string) ([]TCGSKUPrice, error)
type TCGDirectNet ¶
type TCGDirectNet struct { DirectInventory mtgban.InventoryRecord // contains filtered or unexported fields }
func NewTCGDirectNet ¶
func NewTCGDirectNet() *TCGDirectNet
func (*TCGDirectNet) Buylist ¶
func (tcg *TCGDirectNet) Buylist() (mtgban.BuylistRecord, error)
func (*TCGDirectNet) Info ¶
func (tcg *TCGDirectNet) Info() (info mtgban.ScraperInfo)
type TCGPlayerGeneric ¶
type TCGPlayerGeneric struct { LogCallback mtgban.LogCallbackFunc Affiliate string MaxConcurrency int // contains filtered or unexported fields }
func NewScraperGeneric ¶
func NewScraperGeneric(publicId, privateId string, category int, groups ...string) (*TCGPlayerGeneric, error)
func (*TCGPlayerGeneric) Info ¶
func (tcg *TCGPlayerGeneric) Info() (info mtgban.ScraperInfo)
func (*TCGPlayerGeneric) InitializeInventory ¶
func (tcg *TCGPlayerGeneric) InitializeInventory(reader io.Reader) error
func (*TCGPlayerGeneric) Inventory ¶
func (tcg *TCGPlayerGeneric) Inventory() (mtgban.InventoryRecord, error)
func (*TCGPlayerGeneric) InventoryForSeller ¶
func (tcg *TCGPlayerGeneric) InventoryForSeller(sellerName string) (mtgban.InventoryRecord, error)
type TCGPlayerIndex ¶
type TCGPlayerIndex struct { LogCallback mtgban.LogCallbackFunc Affiliate string MaxConcurrency int // contains filtered or unexported fields }
func NewScraperIndex ¶
func NewScraperIndex(publicId, privateId string) *TCGPlayerIndex
func (*TCGPlayerIndex) Info ¶
func (tcg *TCGPlayerIndex) Info() (info mtgban.ScraperInfo)
func (*TCGPlayerIndex) InitializeInventory ¶
func (tcg *TCGPlayerIndex) InitializeInventory(reader io.Reader) error
func (*TCGPlayerIndex) Inventory ¶
func (tcg *TCGPlayerIndex) Inventory() (mtgban.InventoryRecord, error)
func (*TCGPlayerIndex) InventoryForSeller ¶
func (tcg *TCGPlayerIndex) InventoryForSeller(sellerName string) (mtgban.InventoryRecord, error)
func (*TCGPlayerIndex) MarketNames ¶
func (tcg *TCGPlayerIndex) MarketNames() []string
type TCGPlayerMarket ¶
type TCGPlayerMarket struct { LogCallback mtgban.LogCallbackFunc Affiliate string MaxConcurrency int // The cache data defining SKU data, if not set it will be loaded // from the default location on mtgjson website. SKUsData map[string][]mtgjson.TCGSku // contains filtered or unexported fields }
func NewScraperMarket ¶
func NewScraperMarket(publicId, privateId string) *TCGPlayerMarket
func (*TCGPlayerMarket) Buylist ¶
func (tcg *TCGPlayerMarket) Buylist() (mtgban.BuylistRecord, error)
func (*TCGPlayerMarket) Info ¶
func (tcg *TCGPlayerMarket) Info() (info mtgban.ScraperInfo)
func (*TCGPlayerMarket) InitializeBuylist ¶
func (tcg *TCGPlayerMarket) InitializeBuylist(reader io.Reader) error
func (*TCGPlayerMarket) InitializeInventory ¶
func (tcg *TCGPlayerMarket) InitializeInventory(reader io.Reader) error
func (*TCGPlayerMarket) Inventory ¶
func (tcg *TCGPlayerMarket) Inventory() (mtgban.InventoryRecord, error)
func (*TCGPlayerMarket) InventoryForSeller ¶
func (tcg *TCGPlayerMarket) InventoryForSeller(sellerName string) (mtgban.InventoryRecord, error)
func (*TCGPlayerMarket) MarketNames ¶
func (tcg *TCGPlayerMarket) MarketNames() []string
type TCGPlayerSealed ¶
type TCGPlayerSealed struct { LogCallback mtgban.LogCallbackFunc Affiliate string MaxConcurrency int // contains filtered or unexported fields }
func NewScraperSealed ¶
func NewScraperSealed(publicId, privateId string) *TCGPlayerSealed
func (*TCGPlayerSealed) Info ¶
func (tcg *TCGPlayerSealed) Info() (info mtgban.ScraperInfo)
func (*TCGPlayerSealed) Inventory ¶
func (tcg *TCGPlayerSealed) Inventory() (mtgban.InventoryRecord, error)
type TCGProduct ¶
type TCGProduct struct { ProductId int `json:"productId"` Name string `json:"name"` CleanName string `json:"cleanName"` ImageUrl string `json:"imageUrl"` GroupId int `json:"groupId"` URL string `json:"url"` ModifiedOn string `json:"modifiedOn"` Skus []TCGSKU `json:"skus,omitempty"` ExtendedData []struct { Name string `json:"name"` DisplayName string `json:"displayName"` Value string `json:"value"` } `json:"extendedData,omitempty"` }
func (*TCGProduct) GetNameAndVariant ¶ added in v0.3.33
func (tcgp *TCGProduct) GetNameAndVariant() (string, string)
func (*TCGProduct) GetNumber ¶ added in v0.3.33
func (tcgp *TCGProduct) GetNumber() string
func (*TCGProduct) IsToken ¶ added in v0.3.33
func (tcgp *TCGProduct) IsToken() bool
type TCGResponse ¶
type TCGResponse struct { TotalItems int `json:"totalItems"` Success bool `json:"success"` Errors []string `json:"errors"` Results json.RawMessage `json:"results"` }
type TCGSKUPrice ¶
type TCGSKUPrice struct { SkuId int `json:"skuId"` // Only availabe from TCGPricesForSKUs() ProductId int `json:"productId"` LowPrice float64 `json:"lowPrice"` LowestShipping float64 `json:"lowestShipping"` LowestListingPrice float64 `json:"lowestListingPrice"` MarketPrice float64 `json:"marketPrice"` DirectLowPrice float64 `json:"directLowPrice"` // Only available from TCGBuylistPricesForSKUs() BuylistPrices struct { High float64 `json:"high"` Market float64 `json:"market"` } `json:"prices"` }
type TCGSYPList ¶
type TCGSYPList struct { LogCallback mtgban.LogCallbackFunc // contains filtered or unexported fields }
func NewScraperSYP ¶
func NewScraperSYP() *TCGSYPList
func (*TCGSYPList) Info ¶
func (tcg *TCGSYPList) Info() (info mtgban.ScraperInfo)
func (*TCGSYPList) Inventory ¶
func (tcg *TCGSYPList) Inventory() (mtgban.InventoryRecord, error)
type TCGSellerInventory ¶ added in v0.3.16
type TCGSellerInventory struct { LogCallback mtgban.LogCallbackFunc MaxConcurrency int Affiliate string // contains filtered or unexported fields }
func NewScraperForSeller ¶ added in v0.3.16
func NewScraperForSeller(sellerName string) (*TCGSellerInventory, error)
func NewScraperForSellerId ¶ added in v0.3.34
func NewScraperForSellerId(sellerKey string) *TCGSellerInventory
func (*TCGSellerInventory) Info ¶ added in v0.3.16
func (tcg *TCGSellerInventory) Info() (info mtgban.ScraperInfo)
func (*TCGSellerInventory) Inventory ¶ added in v0.3.16
func (tcg *TCGSellerInventory) Inventory() (mtgban.InventoryRecord, error)
Click to show internal directories.
Click to hide internal directories.