To serve targeted banner ads on your search pages based on user queries, simply include the search query and slot ID in your auction request.

Here’s an example showcasing a single banner slot on a search results page for mobile devices:

{
  "auctions": [
    {
      "type": "banners",
      "slots": 1,
      "slotId": "search_banner_top",
      "device": "mobile",
      "searchQuery": "blue running shoes"
    }
  ]
}

The sample response below provides all the necessary information to serve the banner ad:

{
  "results": [
    {
      "winners": [
        {
          "rank": 1,
          "winnerType": "product",
          "winnerId": "p_PJbnN",
          "resolvedBidId": "WyJlX1BKYm5OIiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwiYmFubmVyQWRzIiwiZGVmYXVsdCIsIiJd",
          "asset": [
            {
              "url": "https://topsort.cdnprovider.com/lhs-banner-image-for-p_PJbnN-1x.png"
            }
          ]
        }
      ],
      "error": false
    }
  ]
}

winnerType can be “product”, “brand”, “vendor”, or “url” based on the target of the winning banner ads campaign.