Skip to content

OpenRTB Auction

The /openrtb2/auction endpoint accepts OpenRTB 2.x bid requests and returns deterministic bid responses.

Endpoint

POST /openrtb2/auction
Content-Type: application/json

Request Format

Minimal Request

json
{
  "id": "request-123",
  "imp": [
    {
      "id": "imp-1",
      "banner": {
        "w": 300,
        "h": 250
      }
    }
  ]
}

Full Request

json
{
  "id": "request-123",
  "site": {
    "domain": "example.com",
    "page": "https://example.com/article"
  },
  "imp": [
    {
      "id": "imp-1",
      "banner": {
        "w": 300,
        "h": 250,
        "format": [
          { "w": 300, "h": 250 },
          { "w": 320, "h": 50 }
        ]
      },
      "ext": {
        "mocktioneer": {
          "bid": 2.5
        }
      }
    }
  ],
  "ext": {
    "trusted_server": {
      "signature": "base64-encoded-signature",
      "kid": "key-id"
    }
  }
}

Request Fields

FieldTypeRequiredDescription
idstringYesRequest ID
imparrayYesArray of impressions (min 1)
imp[].idstringYesImpression ID
imp[].bannerobjectYes*Banner object (*or other media type)
imp[].banner.wintegerNoWidth in pixels
imp[].banner.hintegerNoHeight in pixels
imp[].banner.formatarrayNoArray of size objects
imp[].ext.mocktioneer.bidfloatNoOverride bid price
ext.trusted_server.signaturestringNoSignature for request ID verification
ext.trusted_server.kidstringNoKey ID for signature verification
siteobjectNoSite information
site.domainstringNoDomain for signature verification

Size Resolution

Size is determined in this order:

  1. imp[].banner.w and imp[].banner.h
  2. First entry in imp[].banner.format[]
  3. Default: 300x250

Response Format

json
{
  "id": "request-123",
  "seatbid": [
    {
      "seat": "mocktioneer",
      "bid": [
        {
          "id": "019abc123",
          "impid": "imp-1",
          "price": 2.5,
          "adm": "<iframe src=\"//localhost:8787/static/creatives/300x250.html?crid=mocktioneer-imp-1&bid=2.50\" width=\"300\" height=\"250\" frameborder=\"0\" scrolling=\"no\"></iframe>",
          "adomain": ["example.com"],
          "crid": "mocktioneer-imp-1",
          "w": 300,
          "h": 250,
          "mtype": 1
        }
      ]
    }
  ],
  "cur": "USD"
}

Response Fields

FieldTypeDescription
idstringEchoed request ID
seatbidarrayArray of seat bids
seatbid[].seatstringAlways "mocktioneer"
seatbid[].bidarrayArray of bids
seatbid[].bid[].idstringUnique bid ID (UUIDv7)
seatbid[].bid[].impidstringCorresponding impression ID
seatbid[].bid[].pricefloatBid price in USD
seatbid[].bid[].admstringAd markup (iframe HTML)
seatbid[].bid[].adomainarrayAdvertiser domains
seatbid[].bid[].cridstringCreative ID
seatbid[].bid[].wintegerCreative width
seatbid[].bid[].hintegerCreative height
seatbid[].bid[].mtypeintegerMedia type (1 = banner)
curstringCurrency (USD)

Price Override

Override the bid price using the ext.mocktioneer.bid field:

json
{
  "id": "test",
  "imp": [
    {
      "id": "1",
      "banner": { "w": 300, "h": 250 },
      "ext": {
        "mocktioneer": {
          "bid": 5.0
        }
      }
    }
  ]
}

The creative will display this bid amount.

Default Pricing

Without a price override, Mocktioneer uses fixed CPM prices based on ad size. Prices range from $1.70 (300x50) to $4.20 (970x250). Non-standard sizes use an area-based fallback formula.

See the complete pricing table for all supported sizes and their CPM values.

Examples

cURL

bash
curl -X POST http://127.0.0.1:8787/openrtb2/auction \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "test-request",
    "imp": [{
      "id": "imp-1",
      "banner": {"w": 300, "h": 250}
    }]
  }' | jq .

Multiple Impressions

bash
curl -X POST http://127.0.0.1:8787/openrtb2/auction \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "multi-imp",
    "imp": [
      {"id": "1", "banner": {"w": 300, "h": 250}},
      {"id": "2", "banner": {"w": 728, "h": 90}},
      {"id": "3", "banner": {"w": 320, "h": 50}}
    ]
  }' | jq .

With Price Override

bash
curl -X POST http://127.0.0.1:8787/openrtb2/auction \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "custom-price",
    "imp": [{
      "id": "1",
      "banner": {"w": 300, "h": 250},
      "ext": {"mocktioneer": {"bid": 10.00}}
    }]
  }' | jq .

Error Responses

Missing Impressions (422)

json
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "imp: must have at least 1 item"
  }
}

Missing Media Type (422)

json
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "imp[0]: must have banner, video, or native"
  }
}

Invalid JSON (400)

json
{
  "error": {
    "code": "PARSE_ERROR",
    "message": "expected value at line 1 column 1"
  }
}

Request Signature Verification

Mocktioneer supports optional request signature verification. When site.domain is present, it attempts to verify the request signature using:

  • ext.trusted_server.signature - Base64-encoded signature
  • ext.trusted_server.kid - Key ID for signature verification

The JWKS is fetched from http://{site.domain}/.well-known/ts.jwks.json. Verification failures are logged but don't reject the request.

Built with EdgeZero