Updated:10/19/2015

The MoPub Server-to-Server API makes it easier for ad networks and demand partners to connect with the MoPub platform outside of SDK libraries. To integrate with MoPub through the Server-to-Server API, follow the integration approval process and technical specifications that are outlined here

Ad Request Specifications

Ad Response Specifications

Creative Attributes Values From OpenRTB 2.1 Specification Table 6.3

Changelog

 Ad Request Specifications

Attribute

Always Passed?

Value

app

N - Always passed for native apps, otherwise omitted

Object for native apps - note only site or app object will be included, not both.

bundle

On Android, this is the package name, “com.mopub.simpleadsdemo.” On iOS, this is the iTunes ID, e.g. “628677149.”

cat []        

IAB Categories (§6.1), per the static mapping on S2S Integration

id

This is the internal ID you provide to publishers when they sign up with your platform. This should be unique for each app and platform.

name

The App name as entered by the publisher in MoPub UI

publisher

The MoPub account ID (uniquely identifies the publisher)

id

The MoPub account ID (uniquely identifies the publisher)

name

The MoPub Account’s name

storeurl

N

Only provided on iOS, example: http://itunes.apple.com/app/628677149

ver

N

Application version, which is passed up from the latest MoPub SDK. If it is not present from the SDK, this is omitted

site

N - Always passed for mobile web, otherwise omitted

Object for mobile websites - note only site or app object will be included, not both

id

This is the internal ID you provide to publishers when they sign up with your platform. This should be unique for each site..

name

The Site name as entered by the publisher in MoPub UI  

domain

Domain of the URL listed above

publisher

The MoPub account ID (uniquely identifies the publisher)

id

The MoPub account ID (uniquely identifies the publisher)

name

The account’s name

at

Auction type, this is set to “2” to reflect second price auction. Ignore this field for s2s Integrations. It is for marketplace only

bcat[]

Array of blocked IAB categories. This is a default list. Please reach out to the publisher for a list of blocked categories. See Default Blocked Categories table on S2S Integration

device

Device object describes the hardware, platform, etc. - always passed, recommended by the IAB spec

carrier

N

Move to standardized list of carrier codes (“MNC”) from this list: http://en.wikipedia.org/wiki/Mobile_network_code.

This value will be formatted as follows:

{mcc}-{mnc}

for example, “310-053” would represent Virgin Mobile US in the United States.

This value will be passed along to the DSP when it is present via the SDK.

connectiontype

One of the following values, derived exclusively from the signal passed to us by the iOS/Android SDK. If that signal is not present, pass zero.  Values from table 6.10 in IAB spec.

0 (unknown) = always pass zero if the SDK signal is not present. We do not deduce this value based on IPAddress.

1 (Ethernet) = If  device directly connected via Ethernet (Android only)

2 (Wifi) = If  device connected via  WiFi (Android/iOS)

3 (Cellular) = If device is connected through EDGE, 3G, LTE, etc. (Android/iOS)

NOTE: Currently we cannot distinguish among these states and as a result will not pass 4,5 or 6 for this value.

devicetype

Always set to 1 on MoPub, indicating mobile/tablet devicetype

dnt

N

If “0”, then do not track Is set to false, if “1”, then do no track is set to true.  This paramater is omitted if DNT is not passed by the SDK or on iOS 5 or lower.

dpidmd5

N

The MD5 of the RAW_IFA, if the IFA is available. We can pass the MD5 digest along with the SHA1 because we collect the unhashed IFA from the device; we do this for the convenience of demand partners. If there is an invalid identifier or the identifier is not passed, this is omitted.

dpidsha1

N

The SHA1 of the RAW_IFA,

RAW_UDID or ANDROID_ID. If

there is an invalid identifier or the

identifier is not passed, this is

omitted.

geo

N

Geo Object is always passed - includes derived geo data - see details for each field

country

N

This is populated from MaxMind IP database.  3 digit country codes per the ISO-3166-1 Alpha-3 standard

lat

N

Latitude portion of “loc” field. Latitude from -90 to 90. South is negative. Lat derived from the device (not IP).  Passed when available.

lon

N

Longitude portion of “loc” field. Longitude from -180 to 180. West is negative. Lon derived from the device (not IP). Passed when `available.

city

N

This is populated from MaxMind IP database, if available. Always derived from IP, never a reverse geocode from Lat/Lon

metro

N

Metro codes taken from this list. Only be passed for US and Canada. Always derived from IP, never a reverse geocode from Lat/Lon

region

N

This is populated from MaxMind IP database, if the value is available. Always derived from IP, never a reverse geocode from Lat/Lon

zip

N

This is populated from MaxMind IP database. Always derived from IP, never a reverse geocode from Lat/Lon

ip

The IP address that comes from the HTTP request indicating the IP of the mobile device - note this is raw IP and is always passed

js

Set to 1 to indicate JavaScript support

language

Parsed out from HTTP headers as highlighted below. Acceptable values are two-letter ISO 639-1 codes.

iOS:

Accept-Language: en-us

Android:

User-Agent: Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; SAMSUNG-SGH-I317 Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 Paros/3.2.13

make

N

make of device (e.g., Apple, Amazon)

model

N

model of device (e.g., iPhone 5s, Nexus 7)

os

Operating System type (currently “iOS” or “Android”)

osv

Version passed from the OS, e.g. “6.1.2”

ua

Unprocessed User-Agent string from HTTP headers

ext

N

Extension of the device object

idfa

N

The raw IFA, unhashed. IDFA is

only present on iOS6+ and the

new Google Advertising ID.

id

Unique auction ID (this is the field that is mapped to “id” in bid response)

imp[]

impression object

banner

Banner object, required for banner impressions

api[]

N

Array of integers. 3=MRAID 1.0 is supported, 5 = MRAID 2.0

battr[]

N

Reflects the blocked creative attributes for this banner, reference. (§6.3)

btype[]

Set to [4], to reflect our platform-wide prohibition on IFRAMEs

h

Height attr of the ad unit (e.g. 50)

pos

position is set to 1 (“above the fold,” i.e. visible)

w

Width attr of the ad unit (e.g. 300)

video

 

 

 

 

 

 

minduration

 

 

 

Minimum duration of the video in seconds.

 

maxduration

 

 

 

Maximum duration of the video in seconds.

 

linearity

 

 

 

Always = 1 (only linear videos are supported)

 

mimes[]

 

 

 

iOS: [video/3gpp,video/3gpp2,video/mp4,video/quicktime,video/x-m4v]

Android: [video/mp4,video/.3gp]

 

protocol

 

 

 

2.1 parameter for protocol. integer, hardcoded to 2.

See table 6.7 in OpenRTB spec for mapping.

 

protocols[]

 

 

 

We support Vast 2.0 and wrappers. always = [2,5].

 

See table 6.7 in OpenRTB spec for mapping.

 

h

 

 

 

For phone-sized interstitials, h = the shorter dimension (always landscape).

 

For tablets this would match banner object h.

 

w

 

 

 

For phone-sized interstitials, w = the longer dimension (always landscape).

For tablets this would match banner object w.

 

battr[]

 

 

 

Reflects the blocked creative attributes for this banner, reference. (see table 6.3 in OpenRTB spec)*

ext

N

extension of banner object

video

N

If impression supports in-banner video, this object will be present. All the following attributes will be provided for video enabled inventory.

minduration

N

Minimum duration of the video in seconds.

maxduration

N

Maximum duration of the video in seconds. This is always set to 1000.

linearity

N

Only linear videos (linearity=1) are supported for VAST XML

type[]

N

Represents what video protocol can the pub accept. It can be either (a combination) of the following: “VAST 2.0” & “HTML5”.

nativebrowserclick

N

Set to 1 if Native Browser Clicks are supported.

bidfloor

Formerly knows as Price Floor, minimum price for inventory - Ignore for S2S Integrations. Will be set to 0

displaymanager

“mopub” when MoPub SDK is present

displaymanagerver

N

MoPub SDK version passed from the SDK, otherwise not passed

id

Set to 1, indicating that this is the first (and only) impression in the bid request.  (Map this value to bid.impid in the response)

instl

Set to 1 if a modal interstitial, 0 otherwise

tagid 

This is your internal ID you provide to publishers when they create an ad serving placement within your UI.  This should be unique for each size, [Not Ad Format], platform, and app.

ext

secure

Flag to indicate if the impression requires secure HTTPS URL creative assets and markup, where 0 = non-secure, 1 = secure.  If omitted, the secure state is unknown, but non-secure HTTP support can be assumed.

user

User object contains info about the human user of the device

keywords

N

The keywords that are passed through the ad request

yob

N

Year of Birth parsed from the keywords, if present, e.g. “1985”

gender

N

Gender parsed from the keywords, if present, should be “M” for male and “F” for female.

Ad Response Specifications

Attribute

Required

Value

id

y

This must be the top-level ID of the bid request that this is a response for.

seatbid []

y

An array of all seats for this bidder endpoint. There must be at least one seat present.

bid []

y

Enables consideration for all elements in the array, rather than just the first. The highest bid that is not excluded by blocklist violations and other validity checks will be submitted as the winning bid from this seat.

adm

y

Ad Markup in HTML. We do not support dynamic ad markup via the nURL at this time, so this is required.

adomain[]

y

An array of advertiser domain names, e.g. [“king.com”]. Only the first domain in the array will be used.

Must match the top level domain for the advertiser landing page and must be passed with only .com or .countrycode appended (e.g., domain.com or domain.ie).

attr[]

y if using video

An array of values taken from §6.3 Creative Attributes, that indicate if the ad is expandable, etc.Should be set to 6 for video.

crid

y

Creative ID. This should uniquely identify the creative, and can be used for blocking or identification / aggregation purposes.

crtype

y

This field can contain one of the following values depending on the type of creative: [{“VAST 2.0”, “MRAID 1.0”, “MRAID 2.0”, “Image Ad”, “HTML5”, “JS”}]. Required for serving of Video or MRAID, preferred for all ad formats

impid

y

Matches the impression object that was sent in the bid request that this bid corresponds to. This must match the value in imp.id from the bid request.  

iurl

y

A sample image URL that represents the creative being displayed via the ad markup.

nurl

y

Required by MoPub, see below (Win Notification URL).

price

n

The price, in CPM or CPC units, which you are valuing the impression at

ext

y if using video

video

y if using video

duration

y if using video

Length of the video

type

y if using video

Could include one of “VAST 2.0” or “HTML5”.

linearity

y if using video

Whether the VAST XML video is linear or not. Only linear videos are supported by MoPub Marketplace. The value of this field should always be 1.

Creative Attributes Values From OpenRTB 2.1 Specification Table 6.3

Value

Description

1

Audio Ad (Auto Play)

2

Audio Ad (User Initiated)

3

Expandable (Automatic)

4

Expandable (User Initiated - Click)

5

Expandable (User Initiated - Rollover)

6

In-Banner Video Ad (Auto Play)

7

In-Banner Video Ad (User Initiated)

8

Pop (e.g., Over, Under, or upon Exit)

9

Provocative or Suggestive Imagery

10

Shaky, Flashing, Flickering, Extreme Animation, Smileys

11

Surveys

12

Text Only

13

User Interactive (e.g., Embedded Games)

14

Windows Dialog or Alert Style

15

Has audio on/off button

16

Ad can be skipped (e.g., skip button on preroll video)

Changelog

10/19/2015:

7/13/2015:

7/1/2015

2/13/2015:

2/6/2015:

11/24/2014 update:

Added additional support for app category, geo object, uidh, and blocked categories.

10/1/2014 update:

8/22/2014 update:

8/7/2014 update: