You are here: Demand Partners > Real-time bidding APIs > OpenRTB API > Mobile examples

Mobile examples

Last updated on September 11, 2017

The following sample bid requestWhen OpenX Ad Exchange receives an ad request, it sends a communication containing details about the impression to selected real-time bidders to solicit bids for it. for a mobile bannerThis is an ad that appears on a web page which is typically hyperlinked to an advertiser’s website. Banners can be images (GIF, JPEG, PNG), JavaScript programs or multimedia objects (For example, Java). includes the App and Device objects.

BidRequest example


{
    "id" : "eb85349d-03c3-44f4-a77b-824f7221d116",
    "imp": [{
        "id": "eb85349d-03c3-44f4-a77b-824f7221d116",
        "banner": {
            "h": 50,
            "w": 320,
            "battr": [2,3],
            "btype": [1,3]
        }
    }],
    "bcat": [ "IAB2", "IAB3-2" ],
    "app" : {
        "id": "asd2343453wert345dfg",
        "name": "YourApp",
        
        "cat" : [ "IAB15", "IAB15-10" ],
        "bundle": "com.yourapp.bundle",
        "storeurl" : "https://itunes.apple.com/app_id_url",
        "publisher": {
            "id": "qqwer1234xgfd",
            "name": "app.yourapp.com"
        }
    },   
    "device" : {
        "dnt": 0,
        "dpimd5": "aasdfadsfwerqewr234",
        "dpidsha1": "asdfasdfwererr",
        "macsha1" : "asdf2345562ds",
        "macmd5": "asdfaxcv2345243",
        "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53",
        "ip": "166.216.157.23",
        "geo": {
            "lat": 37.789,
            "lon": -122.394,
            "country": "USA",
            "city": "San Francisco",
            "region": "CA",
            "zip" : "94105",
            "type": 2
        },
        "ifa": "asdfdfwerasd2454",
        "carrier" : "310-560",
        "language": "en",
        "make" : "Apple",
        "model": "iPhone",
        "os" : "iOS",
        "osv": "7",
        "connectiontype": 0,
        "devicetype": 1
    }
}

The following sample bid responseAfter evaluating a bid request, a real-time bidder’s communication to OpenX Ad Exchange, indicating if they’re interested in the impression, and if so, how much they’re willing to pay for it. contains a single SeatBid object.

BidResponse example


{
    "id": "eb85349d-03c3-44f4-a77b-824f7221d116",
    "seatbid": [
        {
            "bid": [
                {
                    "id": "bid1",
                    "impid": "eb85349d-03c3-44f4-a77b-824f7221d116",
                    "price": 0.5,
                    "adm": "<div>Mobile Ad Creative</div>",
                    "adomain": [
                        "http://www.bidder0.com/clickthrough"
                    ],
                    "crid": "crid_0",
                    "nurl": "http://example.com/winnotice?impid=${AUCTION_IMP_ID}&auction=${AUCTION_ID}&price=${AUCTION_PRICE}&bidid=${AUCTION_BID_ID}",
                    "ext": {
                        "brand_id": "brand_0",
                        "buyer_id": "buyer_0",
                        }
                    },
                    "next_highest_bid_price": 0.3
                }
            ]
        }
    ]
}

Field definitions:

Important: Your bidding application must return a valid response even if you do not want to place a bid. For example, you can return a 204 No Content or a 200 OK response with an empty body, which will be treated as a bid of zero.

Feedback form