You can create carousels and swimlanes using Banners by requesting an auction for banners and specifying the number of banners you need for the carousel or swimlane. The banner candidates will be the banner campaigns created for the slotId related to the carousel or swimlane. Topsort will return the product id of the winners and the assets with links to creatives to be added to the carousel or swimlane.

You can also create single banner slot for the carousel or swimlane, and request 3 results from the auction.

For example, suppose you have a “Back to School” landing page with a carousel featuring three campaigns from different brands. When a visitor lands on this page, you’ll make a request with the slots parameter set to 3 so that Topsort can provide at least three winners. After receiving the winners, you can add the three banner ads to the carousel. If there are fewer than three winners, you can either add a fallback image for your marketplace promotions or show only one or two banners.

Request

Here’s an example auction request for a carousel with three banner slots targeting brands:

{
  "auctions": [
    {
      "type": "banners",
      "slots": 3,
      "slotId": "backtoschool-carousel"
    }
  ]
}

Response

The response will include three products you can display in the carousel, ranked by the auction results. If there are no qualifying bids (no winners) or if there was an error, the response will be empty. In this case, you can only show the organic results. A new boolean variable, error, indicates whether the auction was resolved successfully.

Here’s an example of the response for a call with one auction request using the API V2 in JSON format:

{
  "results": [
    {
      "winners": [
        {
          "rank": 1,
          "type": "brand",
          "id": "p_Mfk15",
          "resolvedBidId": "WyJiX01mazE1IiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0",
          "asset": [
            {
              "url": "https://topsort.cdnprovider.com/lhs-banner-image-for-p_PJbnN-1x.png"
            }
          ]
        },
        {
          "rank": 2,
          "type": "brand",
          "id": "p_8VKDt",
          "resolvedBidId": "WyJlX1BKYm5OIiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0",
          "asset": [
            {
              "url": "https://topsort.cdnprovider.com/lhs-banner-image-for-p_Paesa2N-1x.png"
            }
          ]
        },
        {
          "rank": 3,
          "type": "product",
          "id": "p_PJbnN",
          "resolvedBidId": "WyJlX1BKYm5OIiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwiYmFubmVyQWRzIiwiZGVmYXVsdCIsIiJd",
          "asset": [
            {
              "url": "https://topsort.cdnprovider.com/lhs-banner-image-for-p_PJbasnx-2x.png"
            }
          ]
        }
     "error": false
    }
  ]
}