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

Mobile examples

Last updated on January 23, 2018

This page contains the following mobile examples:

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.

Mobile banner

The request and response below are 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). examples.

BidRequest example

The following bid request is a mobile banner example. To accurately represent a mobile banner 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., it includes Banner, App, and Device objects.


{
    "ext": {
        "pchain": "6a123e2ec45678c6:538995987"
    },
    "source": {
        "pchain": "6a123e2ec45678c6:538995987",
        "fd": 1
    },
    "cur": ["USD"],
    "imp": [{
        "banner": {
            "ext": {
                "matching_ad_id": [{
                    "ad_width": 320,
                    "ad_height": 50,
                    "creative_id": 538123456,
                    "placement_id": 537789987,
                    "campaign_id": 537124578
                }]
            },
            "format": [{
                "w": 320,
                "h": 50
            }],
            "h": 50,
            "w": 320,
            "topframe": 1,
            "battr": [1, 2, 3, 6, 7, 8, 9, 17],
            "btype": [1, 4]
        },
        "id": "1",
        "exp": 300,
        "secure": 0,
        "instl": 0
    }],
    "at": 2,
    "id": "0abcf7cf-108c-4051-def7-49e3b9f9gh99",
    "regs": {
        "ext": {
            "sb568": 0
        },
        "coppa": 0
    },
    "bcat": ["108", "98", "IAB25", "IAB25-1", "IAB25-2", "IAB25-3", "IAB25-4", "IAB25-5", "IAB25-6", "IAB25-7", "IAB26", "IAB26-1", "IAB26-2", "IAB26-3", "IAB26-4", "OX-108", "OX-98"],
    "test": 0,
    "device": {
        "ext": {
            "language": ["en"],
            "browser_version": "61",
            "browser": "Chrome"
        },
        "dpidmd5": "05CC972FF8E2F9EF2D1B914CD0DC0C89",
        "dpidsha1": "98945FBDC53472CDDA5E15BBFECE3560D026ED11",
        "ifa": "7a123a2b-ef45-4b78-ac99-f3e94ab0d556",
        "connectiontype": 0,
        "carrier": "Frontier Communications",
        "language": "en",
        "js": 1,
        "w": 1440,
        "h": 2560,
        "osv": "6",
        "os": "Android",
        "model": "SM-G928V",
        "make": "Samsung",
        "devicetype": 4,
        "ip": "50.50.144.251",
        "lmt": 0,
        "dnt": 0,
        "geo": {
            "ext": {
                "dma": 617,
                "continent": "north america"
            },
            "zip": "53075",
            "city": "random lake",
            "metro": "617",
            "region": "WI",
            "country": "USA",
            "type": 2,
            "lon": -88.0105,
            "lat": 43.5717
        },
        "ua": "Mozilla/5.0 (Linux; Android 6.0.1; SM-G928V Build/MMB29K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Mobile Safari/537.36"
    },
    "user": {
        "id": "55816b39711f9b5acf3b90e313ed29e51665623f",
        "yob": 1984,
        "gender": "M"
    },
    "app": {
        "content": {
            "userrating": "4.5"
        },
        "publisher": {
            "id": "538987123"
        },
        "cat": ["IAB19", "IAB3"],
        "storeurl": "https://play.google.com/store/apps/details?id=yourapp",
        "domain": "yourapp.com",
        "name": "YourApp",
        "bundle": "com.yourapp.bundle",
        "id": "539321789"
    }
} 

Object references

Learn more about the objects in this request:

BidResponse example

The following bid response contains a single SeatBid object. The Bid object includes the bundle field, which is required for app. Bid responses for banner also contain the h and w fields. The adm field supports the use of macros. The example below shows the ${AUCTION_PRICE:OXCRYPT} and {clickurl_enc} macrosFor OpenX, a command enclosed in curly braces {} that dynamically inserts attributes into your HTML or third-party ad creatives and click-through URLs when OpenX serves an ad. Other macros, like from your video player, may have alternate formatting..

{
    "id": "0abcf7cf-108c-4051-def7-49e3b9f9gh99",
    "bidid": "78e6c6fe067a5e345b6d9325dd0d9c99",
    "seatbid": [{
        "bid": [{
            "id": "78e6c6fe067a5e345b6d9325dd0d9c99",
            "impid": "1",
            "adomain": ["advertiserdomain.com"],
            "price": 0.19,
            "bundle": "com.yourapp.bundle",
            "adm": "<img src=\"http://imagename.location.com\"/><img src=\"https://adserver1.com/impressionnotice?impid=1&winning_price=${AUCTION_PRICE:OXCRYPT}&click={clickurl_enc}\"/>",
            "crid": "3000567",
            "w": 300,
            "h": 250
            "ext": {
                "brand_id": "brand_0",
                "buyer_id": "buyer_0"
            }
        }]
    }]
}

Mobile interstitial

The request and response below are mobile interstitialA full-screen ad displayed in content transitions. For example, a video ad that loads between levels of a mobile game. examples.

BidRequest example

The following bid request is a mobile interstitial example. To accurately represent a mobile interstitial bid request, it includes App and Device objects and the instl field in the Imp object.


{
    "ext": {
        "pchain": "6a123e2ec45678c6:538995987"
    },
    "source": {
        "pchain": "6a123e2ec45678c6:538995987",
        "fd": 1
    },
    "cur": ["USD"],
    "imp": [{
        "id": "1",
        "exp": 300,
        "secure": 0,
        "instl": 1
    }],
    "at": 2,
    "id": "0abcf7cf-108c-4051-def7-49e3b9f9gh99",
    "regs": {
        "ext": {
            "sb568": 0
        },
        "coppa": 0
    },
    "bcat": ["108", "98", "IAB25", "IAB25-1", "IAB25-2", "IAB25-3", "IAB25-4", "IAB25-5", "IAB25-6", "IAB25-7", "IAB26", "IAB26-1", "IAB26-2", "IAB26-3", "IAB26-4", "OX-108", "OX-98"],
    "test": 0,
    "device": {
        "ext": {
            "language": ["en"],
            "browser_version": "61",
            "browser": "Chrome"
        },
        "dpidmd5": "05CC972FF8E2F9EF2D1B914CD0DC0C89",
        "dpidsha1": "98945FBDC53472CDDA5E15BBFECE3560D026ED11",
        "ifa": "7a123a2b-ef45-4b78-ac99-f3e94ab0d556",
        "connectiontype": 0,
        "carrier": "Frontier Communications",
        "language": "en",
        "js": 1,
        "w": 1440,
        "h": 2560,
        "osv": "6",
        "os": "Android",
        "model": "SM-G928V",
        "make": "Samsung",
        "devicetype": 4,
        "ip": "50.50.144.251",
        "lmt": 0,
        "dnt": 0,
        "geo": {
            "ext": {
                "dma": 617,
                "continent": "north america"
            },
            "zip": "53075",
            "city": "random lake",
            "metro": "617",
            "region": "WI",
            "country": "USA",
            "type": 2,
            "lon": -88.0105,
            "lat": 43.5717
        },
        "ua": "Mozilla/5.0 (Linux; Android 6.0.1; SM-G928V Build/MMB29K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Mobile Safari/537.36"
    },
    "user": {
        "id": "55816b39711f9b5acf3b90e313ed29e51665623f",
        "yob": 1984,
        "gender": "M"
    },
    "app": {
        "content": {
            "userrating": "4.5"
        },
        "publisher": {
            "id": "538987123"
        },
        "cat": ["IAB19", "IAB3"],
        "storeurl": "https://play.google.com/store/apps/details?id=yourapp",
        "domain": "yourapp.com",
        "name": "YourApp",
        "bundle": "com.yourapp.bundle",
        "id": "539321789"
    }
} 

Object references

Learn more about the objects in this request:

BidResponse example

The following bid response contains a single SeatBid object. The Bid object includes the bundle field, which is required for app. This example also differs from the banner 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. in that it includes the imptrackers field.

If you are currently placing an impressionA single display of an ad on a web page, mobile app, or other delivery medium. For deals, impression is a metric to relay the total number of ads that have served. See also billable impression, forecasted impressions. tracking URL in the adm field but need to use imptrackers to reduce discrepancies for pre-rendered content, you should stop placing the impression tracking URL in adm and move it to imptrackers. If you aren't currently placing an impression tracking URL in adm, you don't need to make any changes. Additionally, the imptrackers field supports the use of macros. The example below shows the ${AUCTION_PRICE:OXCRYPT} and {clickurl_enc} macros.

{
    "id": "0abcf7cf-108c-4051-def7-49e3b9f9gh99",
    "bidid": "78e6c6fe067a5e345b6d9325dd0d9c99",
    "seatbid": [{
        "bid": [{
            "id": "78e6c6fe067a5e345b6d9325dd0d9c99",
            "impid": "1",
            "adomain": ["advertiserdomain.com"],
            "price": 0.19,
            "bundle": "com.yourapp.bundle",
            "adm": "<img src=\"http://imagename.location.com\"/>",
            "crid": "3000567",
            "ext": {
                "brand_id": "brand_0",
                "buyer_id": "buyer_0",
                "imptrackers": "https://adserver1.com/impressionnotice?winning_price=${AUCTION_PRICE:OXCRYPT}&click={clickurl_enc}"
            }
        }]
    }]
}

Feedback form