如何獲取易貝EBAY商品詳情 API 返回值說明?
易貝(eBay)是一個在線拍賣和購物網(wǎng)站业扒,提供了一個API(應(yīng)用程序接口)供開發(fā)者獲取商品詳情等信息检吆。使用eBay的API,你可以編寫應(yīng)用程序來查詢商品程储、檢索拍賣詳情蹭沛、跟蹤訂單等。
當(dāng)你調(diào)用eBay的API獲取商品詳情時章鲤,通常會返回一個JSON或XML格式的響應(yīng)摊灭,這個響應(yīng)包含了商品的詳細(xì)信息。以下是一個簡化的JSON格式的eBay商品詳情API返回值示例及說明:
```json
{
? "ack": "Success",
? "version": "1.13.0",
? "timestamp": "2023-04-25T12:34:56.789Z",
? "build": "E1234567",
? "Item": {
? ? "ItemID": "123456789012",
? ? "Title": "Brand New Laptop",
? ? "PrimaryCategory": {
? ? ? "CategoryID": "12345",
? ? ? "CategoryName": "Laptops & Netbooks"
? ? },
? ? "StartPrice": {
? ? ? "currencyID": "USD",
? ? ? "__value__": "999.99"
? ? },
? ? "CurrentPrice": {
? ? ? "currencyID": "USD",
? ? ? "__value__": "999.99"
? ? },
? ? "HighBidder": {
? ? ? "UserID": "bidder123",
? ? ? "UserName": "HighBidderUser"
? ? },
? ? "QuantitySold": "10",
? ? "ListingInfo": {
? ? ? "ListingDuration": "GTC",
? ? ? "ListingType": "FixedPriceItem",
? ? ? "BestOfferEnabled": "false"
? ? },
? ? "PaymentMethods": "PayPal",
? ? "ShippingInfo": {
? ? ? "ShippingServiceCost": {
? ? ? ? "currencyID": "USD",
? ? ? ? "__value__": "0.00"
? ? ? },
? ? ? "ShipToLocations": "US",
? ? ? "ExpeditedShipping": "false"
? ? },
? ? "PictureURL": "https://example.com/item-picture.jpg",
? ? "ViewItemURLForNaturalSearch": "https://www.ebay.com/itm/Brand-New-Laptop/123456789012",
? ? "Description": "This is a brand new laptop computer...",
? ? "Seller": {
? ? ? "UserID": "seller123",
? ? ? "UserName": "SellerUser"
? ? }
? ? // 其他可能存在的字段败徊,如Location, HandlingTime, ShippingIncludesInsurance等
? }
}
```
返回值說明:
- `ack`: API調(diào)用的響應(yīng)狀態(tài)帚呼,通常是"Success"表示成功,"Failure"表示失敗皱蹦。
- `version`: API的版本號煤杀。
- `timestamp`: 請求處理的時間戳。
- `build`: eBay系統(tǒng)的構(gòu)建版本號沪哺。
- `Item`: 商品信息對象沈自。
? - `ItemID`: 商品的唯一ID。
? - `Title`: 商品標(biāo)題凤粗。
? - `PrimaryCategory`: 商品的主要分類信息酥泛。
? ? - `CategoryID`: 分類ID。
? ? - `CategoryName`: 分類名稱嫌拣。
? - `StartPrice`: 商品的起始價格。
? ? - `currencyID`: 貨幣類型呆躲,如USD异逐。
? ? - `__value__`: 價格值。
? - `CurrentPrice`: 商品的當(dāng)前價格(對于固定價格商品或當(dāng)前競拍價格)插掂。
? - `HighBidder`: 當(dāng)前最高出價者的信息灰瞻。
? ? - `UserID`: 出價者ID。
? ? - `UserName`: 出價者用戶名辅甥。
? - `QuantitySold`: 已售出的商品數(shù)量酝润。
? - `ListingInfo`: 列表信息。
? ? - `ListingDuration`: 列表持續(xù)時間璃弄,如GTC(Good Until Canceled要销,直到取消為止)。
? ? - `ListingType`: 列表類型夏块,如FixedPriceItem(固定價格商品)疏咐。
? ? - `BestOfferEnabled`: 是否啟用“最佳報價”功能纤掸。
? - `PaymentMethods`: 支付方式,如PayPal浑塞。
? - `ShippingInfo`: 運輸信息借跪。
? ? - `ShippingServiceCost`: 運輸服務(wù)費用。
? ? - `ShipToLocations`: 可發(fā)貨地點酌壕。
? ? - `ExpeditedShipping`: 是否提供加急運輸掏愁。
? - `PictureURL`: 商品的圖片URL。
? - `ViewItemURLForNaturalSearch`: 商品的自然搜索URL卵牍。
? - `Description`: 商品的描述托猩。
? - `Seller`: 賣家信息。
? ? - `UserID`: 賣家ID辽慕。
? ? - `UserName`: 賣家用戶名京腥。
請注意,實際的API返回值可能會比這個示例更加復(fù)雜溅蛉,是的公浪,我之前的示例只是一個簡化的、概念性的返回值結(jié)構(gòu)船侧。在實際使用中欠气,EBAY商品詳情API的返回值可能會包含更多的字段和嵌套結(jié)構(gòu),具體取決于你請求的商品和API的版本镜撩。
以下是一些可能存在的額外字段和結(jié)構(gòu)的例子:
```json
{
? "ack": "Success",
? "version": "1.0",
? "timestamp": "2023-04-01T12:34:56.789Z",
? "build": "E123456",
? "Item": {
? ? "ItemID": "123456789012",
? ? "Title": "Brand New Laptop",
? ? "PrimaryCategory": {
? ? ? "CategoryID": "1234",
? ? ? "CategoryName": "Laptops & Netbooks"
? ? },
? ? "SecondaryCategory": [
? ? ? {
? ? ? ? "CategoryID": "5678",
? ? ? ? "CategoryName": "Apple Laptops"
? ? ? },
? ? ? {
? ? ? ? "CategoryID": "9012",
? ? ? ? "CategoryName": "Business Laptops"
? ? ? }
? ? ],
? ? "StartPrice": {
? ? ? "currencyID": "USD",
? ? ? "__value__": "999.99"
? ? },
? ? "CurrentPrice": {
? ? ? "currencyID": "USD",
? ? ? "__value__": "999.99"
? ? },
? ? "HighBidder": {
? ? ? "UserID": "bidder123",
? ? ? "UserName": "HighBidderUser"
? ? },
? ? "QuantitySold": "10",
? ? "ReservePrice": {
? ? ? "currencyID": "USD",
? ? ? "__value__": "0.00"
? ? },
? ? "BidCount": "20",
? ? "SellingStatus": {
? ? ? "CurrentPrice": {
? ? ? ? "currencyID": "USD",
? ? ? ? "__value__": "999.99"
? ? ? },
? ? ? "ConvertedCurrentPrice": {
? ? ? ? "currencyID": "USD",
? ? ? ? "__value__": "999.99"
? ? ? },
? ? ? "TimeLeft": "P3DT6H23M59S"
? ? },
? ? "ListingInfo": {
? ? ? "ListingDuration": "GTC",
? ? ? "ListingType": "FixedPriceItem",
? ? ? "StartTime": "2023-04-01T00:00:00.000Z",
? ? ? "EndTime": "2023-05-01T00:00:00.000Z",
? ? ? "QuantityAvailable": "5",
? ? ? "BestOfferEnabled": "false",
? ? ? "BuyItNowAvailable": "true",
? ? ? "ConversionType": "FixedPrice"
? ? },
? ? "PaymentMethods": "PayPal, CreditCard",
? ? "PaymentInfo": {
? ? ? "PayPalAccepted": "true",
? ? ? "PayPalEmail": "seller@example.com"
? ? },
? ? "ShippingInfo": {
? ? ? "ShippingServiceCost": {
? ? ? ? "currencyID": "USD",
? ? ? ? "__value__": "10.00"
? ? ? },
? ? ? "ShipToLocations": "US, CA",
? ? ? "ExpeditedShipping": "true",
? ? ? "OneDayShippingAvailable": "false",
? ? ? "HandlingTime": "1"
? ? },
? ? "Location": "United States",
? ? "PictureURL": "https://example.com/item-picture.jpg",
? ? "GalleryURL": "https://example.com/gallery-picture.jpg",
? ? "ViewItemURLForNaturalSearch": "https://www.ebay.com/itm/Brand-New-Laptop/123456789012",
? ? "Description": "This is a brand new laptop computer...",
? ? "Seller": {
? ? ? "UserID": "seller123",
? ? ? "UserName": "SellerUser",
? ? ? "FeedbackScore": "98.5",
? ? ? "PositiveFeedbackPercent": "99"
? ? },
? ? "ReturnsAccepted": "true",
? ? "ConditionID": "1000",
? ? "ConditionDisplayName": "Brand New",
? ? "IsMultiVariationListing": "false",
? ? "Variations": [
? ? ? // 如果商品有多個變體预柒,這里會列出每個變體的信息
? ? ],
? ? "SKU": "LAPTOP-001",
? ? "MPN": "LNX-MNXB2",
? ? "Brand":