RTB API

Using merchenta.io for real-time bidding

Realtime Bid Stream and Impression Stream 

Our platform provides the ability to report the bid stream and impression stream in real-time. The bid stream shows the bid requests being bid upon - the impression stream shows the ad requests bought/won.

Bid Stream 

This endpoint returns the bid stream for the advertiser(s) associated with the authentication token provided. The endpoint is implemented using websockets. The stream is updated in real-time with a round-trip delay of 1-3 seconds. If the stream is not needed anymore it’s important to close the websocket connection. The bid is in millicents (CPM = bid / 100, price for impression = bid / 100 000).

var c = new WebSocket("wss://sandbox.rtbapi.io/v3/realtime/bidStream");
c.onopen = function(e) {
    c.send('{YOUR_TOKEN_HERE}');
}
c.onmessage = function(e) {
    // do something with e.data
    {"userHash":"6205722d3964d0801fa91543d09ee383",
    "userAgent":"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36",
    "auctionId":"OX2b18eab8-d7ca-4141-8474-5a3b54df7845",
    "bid":10,
    "campaignCode":"MERCHENTA-test",
    "creativeCode":"MERCHENTA-test-1",
    "retailer":"MERCHENTA",
    "url":"http://www.ig.com.br",
    "ip":"40.210.129.202",
    "city":"London",
    "geoCountry":"gb",
    "timestamp":1446451778742,
    "size":"728x90"
    }
}
// do not forget to close websocket
c.close();

Impression Stream 

This endpoints returns the impression stream for the advertiser(s) associated with the authentication token provided. The endpoint is implemented using websockets. The stream is updated in real-time, although exchanges may take up to 60 minutes to confirm won auctions dependent upon network congestion and factors beyond our control. If the stream is not needed anymore it’s important to close the websocket connection. The winningBid is in millicents (CPM = winningBid / 100, price for impression = winningBid / 100 000).

var c = new WebSocket("wss://sandbox.rtbapi.io/v3/realtime/impressionStream");
c.onopen = function(e) {
    c.send('{YOUR_TOKEN_HERE}');
}
c.onmessage = function(e) {
    // do something with e.data
    {"userHash":"6205722d3964d0801fa91543d09ee383",
    "userAgent":"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36",
    "auctionId":"OX2b18eab8-d7ca-4141-8474-5a3b54df7845",
    "winningBid":10,
    "campaignCode":"MERCHENTA-test",
    "creativeCode":"MERCHENTA-test-1",
    "retailer":"MERCHENTA",
    "url":"http://www.ig.com.br",
    "ip":"40.210.129.202",
    "city":"London",
    "geoCountry":"gb",
    "timestamp":1446451778742,
    "won":true,
    "size":"728x90"
    }
}
// do not forget to close websocket
c.close();
Previous page