2

我正在研究 groupon 交易 API 以在我的网站上显示交易,我得到了 API 返回的所有结果,但它没有给我任何相关交易的类别。我想要一个类别来对交易进行分类。

从 groupon 获取类别的任何想法?我正在处理一个结果以便更好地理解。

{
"deals": [
    {
        "type": "groupon",
        "tippingPoint": 0,
        "isOptionListComplete": true,
        "division": {
            "lng": -99.7331,
            "timezone": "Central Time (US & Canada)",
            "lat": 32.4487,
            "timezoneIdentifier": "America/Chicago",
            "name": "Abilene, TX",
            "id": "abilene",
            "timezoneOffsetInSeconds": -21600
        },
        "announcementTitle": "Sterling Silver Swarovski Elements Double Crystal Ball Earrings",
        "allowedInCart": true,
        "isTipped": true,
        "dealUrl": "http://tracking.groupon.com/r?tsToken=US_AFF_0_201236_212556_0&url=http%3A%2F%2Fwww.groupon.com%2Fdeals%2Fgg-sterling-silver-swarovski-elements-double-crystal-ball-earrings%3Fz%3Dskip%26utm_medium%3Dafl%26utm_source%3DGPN%26utm_campaign%3D201236%26mediaId%3D212556",
        "areas": [],
        "status": "open",
        "soldQuantity": 50,
        "pitchHtml": "<p></p>\n\n<h4>Sterling Silver Swarovski Elements Double Crystal Ball Earrings</h4>\n\n<ul>\n  <li>Unique double-ball earrings</li>\n  <li>Genuine Swarovski Elements crystals</li>\n  <li>.925 sterling silver</li>\n  <li>Nickel- and lead-free</li>\n  <li>6mm ball on top, 10mm ball on bottom</li>\n  <li>Butterfly post backs</li>\n  <li>Overall dimensions: 17mm x 10mm x 0.1mm</li>\n</ul>\n\n<hr />\n\n<p><i>For questions pertaining to this deal, click the Ask a Question button below. For post-purchase inquiries, please contact <a href=\"http://gr.pn/zmfvIT\">Groupon customer support</a>.\n<br /><br />\nGoods sold by Groupon Goods. View the <a href=\"http://gr.pn/1gH6Dm7\">Groupon Goods FAQ</a> to learn more.\n</i></p>",
        "accessType": "featured",
        "grid6ImageUrl": "https://img.grouponcdn.com/deal/oqUZuNtSqpmnaX88v3bx/B2-4200x2544/v1/t460x279.jpg",
        "says": null,
        "isTravelBookableDeal": false,
        "sidebarImageUrl": "https://img.grouponcdn.com/deal/oqUZuNtSqpmnaX88v3bx/B2-4200x2544/v1/t200x300.jpg",
        "displayOptions": [
            {
                "enabled": true,
                "name": "timer"
            },
            {
                "enabled": true,
                "name": "quantity"
            },
            {
                "enabled": true,
                "name": "discount"
            },
            {
                "value": "goods",
                "name": "merchandisingType"
            }
        ],
        "placementPriority": "nearby",
        "isAutoRefundEnabled": false,
        "title": "Sterling Silver Swarovski Elements Double Crystal Ball Earrings",
        "shippingAddressRequired": true,
        "finePrint": "Limit 3 per person, May buy 2 more as gifts. <b>Free returns.</b> Does not ship to AK/HI/Canada/Puerto Rico.Most orders are delivered within 12 business days from the purchase date Does not ship to PO boxes <a target=\"_blank\" href=\"http://gr.pn/wqDomX\">See return policy.</a> <a target=\"_blank\" href=\"http://gr.pn/hqEozV\">Must pay applicable tax and provide name and shipping address at checkout, which will be shared to facilitate shipping.</a>  Goods sold by Groupon Goods.",
        "channels": [
            {
                "name": "Goods",
                "id": "goods"
            }
        ],
        "placeholderUrl": "https://secure-assets.grouponcdn.com/images/groupon/grayPlaceholder.png",
        "tippedAt": "2015-02-24T06:00:34Z",
        "vip": "",
        "soldQuantityMessage": "50+",
        "redemptionLocation": null,
        "merchant": {
            "websiteUrl": "",
            "facebookUrl": null,
            "twitterUrl": null,
            "uuid": "d8389750-664e-11e2-beb6-00259060b5bc",
            "ratings": [],
            "name": "Sterling Silver Swarovski Elements Double Crystal Ball Earrings",
            "id": "golden-moon-inc"
        },
        "isMerchandisingDeal": true,
        "dealTypes": [
            {
                "description": "For those who dress to thrill",
                "name": "Threads",
                "id": "wearables"
            }
        ],
        "shortAnnouncementTitle": "Swarovski Elements Ball Earrings",
        "largeImageUrl": "https://img.grouponcdn.com/deal/oqUZuNtSqpmnaX88v3bx/B2-4200x2544/v1/t440x300.jpg",
        "uuid": "7e831c0a-554e-43ea-a47d-d8e1ba4bf776",
        "textAd": {
            "headline": "",
            "line2": "",
            "line1": ""
        },
        "startAt": "2015-02-24T06:00:00Z",
        "isGliveInventoryDeal": false,
        "grouponRating": null,
        "smallImageUrl": "https://img.grouponcdn.com/deal/oqUZuNtSqpmnaX88v3bx/B2-4200x2544/v1/t50x50.jpg",
        "isInviteOnly": false,
        "locationNote": "",
        "tags": [
            {
                "name": "Shopping"
            }
        ],
        "limitedQuantityRemaining": null,
        "highlightsHtml": "<p>Double-studded earrings, with a 6mm ball and 10mm ball, draw onlookers&#8217; eyes with the impressive sparkle of Swarovski Elements crystals</p>",
        "endAt": "2015-03-10T04:59:59Z",
        "grid4ImageUrl": "https://img.grouponcdn.com/deal/oqUZuNtSqpmnaX88v3bx/B2-4200x2544/v1/t300x182.jpg",
        "id": "gg-sterling-silver-swarovski-elements-double-crystal-ball-earrings",
        "fulfillmentMethod": "Drop ship (Supplier small parcel)",
        "salesforceLink": "https://login.salesforce.com/006C000000wDIhdIAG",
        "options": [
            {
                "traits": [
                    {
                        "name": "Stone",
                        "value": "Lt Amethyst"
                    }
                ],
                "remainingQuantity": 0,
                "expiresInDays": null,
                "customFields": [],
                "status": "open",
                "soldQuantity": 1,
                "externalUrl": null,
                "maximumPurchaseQuantity": 5,
                "discountPercent": 88,
                "value": {
                    "currencyCode": "USD",
                    "formattedAmount": "$125.00",
                    "amount": 12500
                },
                "price": {
                    "currencyCode": "USD",
                    "formattedAmount": "$14.99",
                    "amount": 1499
                },
                "initialQuantity": 0,
                "buyUrl": "https://www.groupon.com/deals/gg-sterling-silver-swarovski-elements-double-crystal-ball-earrings/confirmation?pledge_id=12601090",
                "title": "Sterling Silver Swarovski Elements Double-Studded Earrings-Lt Amethyst",
                "minimumPurchaseQuantity": 1,
                "expiresAt": null,
                "uuid": "0717d2b9-178e-45df-9453-d2e1eaba433b",
                "soldQuantityMessage": "1",
                "discount": {
                    "currencyCode": "USD",
                    "formattedAmount": "$110.01",
                    "amount": 11001
                },
                "details": [
                    {
                        "description": "Limit 3 per person, May buy 2 more as gifts. <b>Free returns.</b> Does not ship to AK/HI/Canada/Puerto Rico.Most orders are delivered within 12 business days from the purchase date Does not ship to PO boxes <a target=\"_blank\" href=\"http://gr.pn/wqDomX\">See return policy.</a> <a target=\"_blank\" href=\"http://gr.pn/hqEozV\">Must pay applicable tax and provide name and shipping address at checkout, which will be shared to facilitate shipping.</a>  Goods sold by Groupon Goods."
                    }
                ],
                "bookable": false,
                "isLimitedQuantity": true,
                "redemptionLocations": [],
                "endAt": "2015-03-10T04:59:59Z",
                "id": 12601090,
                "specificAttributes": {},
                "isSoldOut": false
            },
            {
                "traits": [
                    {
                        "name": "Stone",
                        "value": "Light Rose"
                    }
                ],
                "remainingQuantity": 0,
                "expiresInDays": null,
                "customFields": [],
                "status": "open",
                "soldQuantity": 4,
                "externalUrl": null,
                "maximumPurchaseQuantity": 5,
                "discountPercent": 88,
                "value": {
                    "currencyCode": "USD",
                    "formattedAmount": "$125.00",
                    "amount": 12500
                },
                "price": {
                    "currencyCode": "USD",
                    "formattedAmount": "$14.99",
                    "amount": 1499
                },
                "initialQuantity": 0,
                "buyUrl": "https://www.groupon.com/deals/gg-sterling-silver-swarovski-elements-double-crystal-ball-earrings/confirmation?pledge_id=12601089",
                "title": "Sterling Silver Swarovski Elements Double-Studded Earrings--Light Rose",
                "minimumPurchaseQuantity": 1,
                "expiresAt": null,
                "uuid": "cb1315f1-3c34-40c5-81fb-a4342edc6549",
                "soldQuantityMessage": "4",
                "discount": {
                    "currencyCode": "USD",
                    "formattedAmount": "$110.01",
                    "amount": 11001
                },
                "details": [
                    {
                        "description": "Limit 3 per person, May buy 2 more as gifts. <b>Free returns.</b> Does not ship to AK/HI/Canada/Puerto Rico.Most orders are delivered within 12 business days from the purchase date Does not ship to PO boxes <a target=\"_blank\" href=\"http://gr.pn/wqDomX\">See return policy.</a> <a target=\"_blank\" href=\"http://gr.pn/hqEozV\">Must pay applicable tax and provide name and shipping address at checkout, which will be shared to facilitate shipping.</a>  Goods sold by Groupon Goods."
                    }
                ],
                "bookable": false,
                "isLimitedQuantity": true,
                "redemptionLocations": [],
                "endAt": "2015-03-10T04:59:59Z",
                "id": 12601089,
                "specificAttributes": {},
                "isSoldOut": false
            },
            {
                "traits": [
                    {
                        "name": "Stone",
                        "value": "Jet"
                    }
                ],
                "remainingQuantity": 0,
                "expiresInDays": null,
                "customFields": [],
                "status": "open",
                "soldQuantity": 8,
                "externalUrl": null,
                "maximumPurchaseQuantity": 5,
                "discountPercent": 88,
                "value": {
                    "currencyCode": "USD",
                    "formattedAmount": "$125.00",
                    "amount": 12500
                },
                "price": {
                    "currencyCode": "USD",
                    "formattedAmount": "$14.99",
                    "amount": 1499
                },
                "initialQuantity": 0,
                "buyUrl": "https://www.groupon.com/deals/gg-sterling-silver-swarovski-elements-double-crystal-ball-earrings/confirmation?pledge_id=12601088",
                "title": "Sterling Silver Swarovski Elements Double-Studded Earrings-Jet",
                "minimumPurchaseQuantity": 1,
                "expiresAt": null,
                "uuid": "c539d338-20d7-4c2a-a3eb-a0cb11583914",
                "soldQuantityMessage": "8",
                "discount": {
                    "currencyCode": "USD",
                    "formattedAmount": "$110.01",
                    "amount": 11001
                },
                "details": [
                    {
                        "description": "Limit 3 per person, May buy 2 more as gifts. <b>Free returns.</b> Does not ship to AK/HI/Canada/Puerto Rico.Most orders are delivered within 12 business days from the purchase date Does not ship to PO boxes <a target=\"_blank\" href=\"http://gr.pn/wqDomX\">See return policy.</a> <a target=\"_blank\" href=\"http://gr.pn/hqEozV\">Must pay applicable tax and provide name and shipping address at checkout, which will be shared to facilitate shipping.</a>  Goods sold by Groupon Goods."
                    }
                ],
                "bookable": false,
                "isLimitedQuantity": true,
                "redemptionLocations": [],
                "endAt": "2015-03-10T04:59:59Z",
                "id": 12601088,
                "specificAttributes": {},
                "isSoldOut": false
            },
            {
                "traits": [
                    {
                        "name": "Stone",
                        "value": "Crystal AB"
                    }
                ],
                "remainingQuantity": 0,
                "expiresInDays": null,
                "customFields": [],
                "status": "open",
                "soldQuantity": 3,
                "externalUrl": null,
                "maximumPurchaseQuantity": 5,
                "discountPercent": 88,
                "value": {
                    "currencyCode": "USD",
                    "formattedAmount": "$125.00",
                    "amount": 12500
                },
                "price": {
                    "currencyCode": "USD",
                    "formattedAmount": "$14.99",
                    "amount": 1499
                },
                "initialQuantity": 0,
                "buyUrl": "https://www.groupon.com/deals/gg-sterling-silver-swarovski-elements-double-crystal-ball-earrings/confirmation?pledge_id=12601087",
                "title": "Sterling Silver Swarovski Elements Double-Studded Earrings-Crystal AB",
                "minimumPurchaseQuantity": 1,
                "expiresAt": null,
                "uuid": "58fcb76c-17c5-40af-8303-7eb1c65171d0",
                "soldQuantityMessage": "3",
                "discount": {
                    "currencyCode": "USD",
                    "formattedAmount": "$110.01",
                    "amount": 11001
                },
                "details": [
                    {
                        "description": "Limit 3 per person, May buy 2 more as gifts. <b>Free returns.</b> Does not ship to AK/HI/Canada/Puerto Rico.Most orders are delivered within 12 business days from the purchase date Does not ship to PO boxes <a target=\"_blank\" href=\"http://gr.pn/wqDomX\">See return policy.</a> <a target=\"_blank\" href=\"http://gr.pn/hqEozV\">Must pay applicable tax and provide name and shipping address at checkout, which will be shared to facilitate shipping.</a>  Goods sold by Groupon Goods."
                    }
                ],
                "bookable": false,
                "isLimitedQuantity": true,
                "redemptionLocations": [],
                "endAt": "2015-03-10T04:59:59Z",
                "id": 12601087,
                "specificAttributes": {},
                "isSoldOut": false
            },
            {
                "traits": [
                    {
                        "name": "Stone",
                        "value": "Crystal"
                    }
                ],
                "remainingQuantity": 0,
                "expiresInDays": null,
                "customFields": [],
                "status": "open",
                "soldQuantity": 30,
                "externalUrl": null,
                "maximumPurchaseQuantity": 5,
                "discountPercent": 88,
                "value": {
                    "currencyCode": "USD",
                    "formattedAmount": "$125.00",
                    "amount": 12500
                },
                "price": {
                    "currencyCode": "USD",
                    "formattedAmount": "$14.99",
                    "amount": 1499
                },
                "initialQuantity": 0,
                "buyUrl": "https://www.groupon.com/deals/gg-sterling-silver-swarovski-elements-double-crystal-ball-earrings/confirmation?pledge_id=12601086",
                "title": "Sterling Silver Swarovski Elements Double-Studded Earrings-Crystal",
                "minimumPurchaseQuantity": 1,
                "expiresAt": null,
                "uuid": "7374ae5d-c2d5-4cf9-8ffa-cfb469217c72",
                "soldQuantityMessage": "30+",
                "discount": {
                    "currencyCode": "USD",
                    "formattedAmount": "$110.01",
                    "amount": 11001
                },
                "details": [
                    {
                        "description": "Limit 3 per person, May buy 2 more as gifts. <b>Free returns.</b> Does not ship to AK/HI/Canada/Puerto Rico.Most orders are delivered within 12 business days from the purchase date Does not ship to PO boxes <a target=\"_blank\" href=\"http://gr.pn/wqDomX\">See return policy.</a> <a target=\"_blank\" href=\"http://gr.pn/hqEozV\">Must pay applicable tax and provide name and shipping address at checkout, which will be shared to facilitate shipping.</a>  Goods sold by Groupon Goods."
                    }
                ],
                "bookable": false,
                "isLimitedQuantity": true,
                "redemptionLocations": [],
                "endAt": "2015-03-10T04:59:59Z",
                "id": 12601086,
                "specificAttributes": {},
                "isSoldOut": false
            },
            {
                "traits": [
                    {
                        "name": "Stone",
                        "value": "Light Peach"
                    }
                ],
                "remainingQuantity": 0,
                "expiresInDays": null,
                "customFields": [],
                "status": "open",
                "soldQuantity": 1,
                "externalUrl": null,
                "maximumPurchaseQuantity": 5,
                "discountPercent": 88,
                "value": {
                    "currencyCode": "USD",
                    "formattedAmount": "$125.00",
                    "amount": 12500
                },
                "price": {
                    "currencyCode": "USD",
                    "formattedAmount": "$14.99",
                    "amount": 1499
                },
                "initialQuantity": 0,
                "buyUrl": "https://www.groupon.com/deals/gg-sterling-silver-swarovski-elements-double-crystal-ball-earrings/confirmation?pledge_id=12601091",
                "title": "Sterling Silver Swarovski Elements Double-Studded Earrings-Light Peach",
                "minimumPurchaseQuantity": 1,
                "expiresAt": null,
                "uuid": "43cb8093-aecc-4664-a782-d18905d8377c",
                "soldQuantityMessage": "1",
                "discount": {
                    "currencyCode": "USD",
                    "formattedAmount": "$110.01",
                    "amount": 11001
                },
                "details": [
                    {
                        "description": "Limit 3 per person, May buy 2 more as gifts. <b>Free returns.</b> Does not ship to AK/HI/Canada/Puerto Rico.Most orders are delivered within 12 business days from the purchase date Does not ship to PO boxes <a target=\"_blank\" href=\"http://gr.pn/wqDomX\">See return policy.</a> <a target=\"_blank\" href=\"http://gr.pn/hqEozV\">Must pay applicable tax and provide name and shipping address at checkout, which will be shared to facilitate shipping.</a>  Goods sold by Groupon Goods."
                    }
                ],
                "bookable": false,
                "isLimitedQuantity": true,
                "redemptionLocations": [],
                "endAt": "2015-03-10T04:59:59Z",
                "id": 12601091,
                "specificAttributes": {},
                "isSoldOut": false
            }
        ],
        "isSoldOut": false,
        "isNowDeal": false,
        "mediumImageUrl": "https://img.grouponcdn.com/deal/oqUZuNtSqpmnaX88v3bx/B2-4200x2544/v1/t100x100.jpg"
    }
],
"facets": [],
"pagination": {
    "offset": 0,
    "count": 9886
}

}

4

1 回答 1

0

将交易与类别相关联的唯一方法是循环浏览此处文档中提供的不同类别。

因此,您的 URL 必须包含filters=category:参数。

您可以在上面的链接中找到示例 URL。

以下是目前的类别:

automotive beauty-and-spas food-and-drink health-and-fitness home-improvement local-services shopping things-to-do auto-and-home-improvement baby-kids-and-toys collectibles electronics entertainment-and-media food-and-drink-goods health-and-beauty-goods home-and-garden household-essentials jewelry-and-watches men sports-and-outdoors women accommodation bed-and-breakfast-travel cabin-travel cruise-travel hotels resort-travel tour-travel vacation-rental-travel

请注意,并非所有国家/地区都支持类别。

于 2015-09-02T16:01:43.143 回答