Skip to content

API Reference

Mocktioneer exposes several HTTP endpoints for bid requests, creative serving, and tracking.

Base URL

EnvironmentURLNotes
Local (Axum)http://127.0.0.1:8787Default development port
Local (Fastly)http://127.0.0.1:7676Viceroy default port
Local (Cloudflare)http://127.0.0.1:8787Wrangler default port
Production (Fastly)https://mocktioneer.edgecompute.appExample deployment

Endpoints Overview

Auction Endpoints

MethodPathDescription
POST/openrtb2/auctionOpenRTB 2.x bid request
POST/e/dtb/bidAPS TAM bid request
POST/adserver/mediateAuction mediation

Asset Endpoints

MethodPathDescription
GET/static/creatives/{W}x{H}.htmlHTML creative wrapper
GET/static/img/{W}x{H}.svgSVG creative image

Tracking Endpoints

MethodPathDescription
GET/pixelTracking pixel
GET/clickClick landing page
GET/aps/winAPS win notification

Utility Endpoints

MethodPathDescription
GET/Service info page
GET/_/sizesSupported sizes with pricing

Common Headers

Request Headers

HeaderRequiredDescription
Content-TypeYes (POST)Must be application/json for POST requests
HostNoUsed to construct creative URLs

Response Headers

All responses include CORS headers (Access-Control-Allow-Origin: *, etc.). See CORS Preflight for details.

Supported Ad Sizes

Mocktioneer supports these standard IAB sizes with fixed CPM pricing:

SizeNameCPM
970x250Billboard$4.20
970x90Large Leaderboard$3.80
300x600Half Page$3.50
160x600Wide Skyscraper$3.20
728x90Leaderboard$3.00
320x480Mobile Interstitial Portrait$2.80
480x320Mobile Interstitial Landscape$2.80
336x280Large Rectangle$2.60
300x250Medium Rectangle$2.50
320x100Large Mobile Banner$2.20
468x60Banner$2.00
320x50Mobile Leaderboard$1.80
300x50Mobile Banner$1.70

Programmatic Access

Use the /_/sizes endpoint to get this list programmatically.

Non-standard sizes:

  • Return 404 for HTML creative endpoints and 422 for SVG creative endpoints
  • Are coerced to 300x250 for auction endpoints
  • Are skipped for APS responses

Error Responses

Errors are returned as JSON:

json
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Description of the error"
  }
}

HTTP Status Codes

CodeMeaning
200Success
204Success (no content)
400Bad request (malformed JSON)
404Not found
422Validation error
500Internal server error

CORS Preflight

All endpoints support OPTIONS requests for CORS preflight and include these headers in responses:

HeaderValue
Access-Control-Allow-Origin*
Access-Control-Allow-MethodsGET, POST, OPTIONS
Access-Control-Allow-Headers*, content-type
bash
curl -X OPTIONS http://127.0.0.1:8787/openrtb2/auction \
  -H "Origin: https://example.com" \
  -H "Access-Control-Request-Method: POST"
# Returns 204 No Content with CORS headers

Sizes Endpoint

Returns all supported ad sizes with their CPM values as JSON.

GET /_/sizes

Response

json
{
  "sizes": [
    { "width": 160, "height": 600, "cpm": 3.2 },
    { "width": 300, "height": 50, "cpm": 1.7 },
    { "width": 300, "height": 250, "cpm": 2.5 },
    { "width": 300, "height": 600, "cpm": 3.5 },
    { "width": 320, "height": 50, "cpm": 1.8 },
    { "width": 320, "height": 100, "cpm": 2.2 },
    { "width": 320, "height": 480, "cpm": 2.8 },
    { "width": 336, "height": 280, "cpm": 2.6 },
    { "width": 468, "height": 60, "cpm": 2.0 },
    { "width": 480, "height": 320, "cpm": 2.8 },
    { "width": 728, "height": 90, "cpm": 3.0 },
    { "width": 970, "height": 90, "cpm": 3.8 },
    { "width": 970, "height": 250, "cpm": 4.2 }
  ]
}

Example

bash
curl http://127.0.0.1:8787/_/sizes | jq .

This endpoint is useful for:

  • Generating test fixtures
  • Keeping external configurations in sync
  • Validating supported sizes programmatically

Built with EdgeZero