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
MethodPathDescription
GET/sync/startInitiate pixel sync redirect
GET/sync/donePixel sync callback (returns pixel)
GET/resolvePull sync identity resolution (S2S)

Utility Endpoints

MethodPathDescription
GET/Service info page
GET/_/sizesSupported ad sizes

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. All auction bids use a fixed price of $0.20 CPM.

SizeName
970x250Billboard
970x90Large Leaderboard
300x600Half Page
160x600Wide Skyscraper
728x90Leaderboard
320x480Mobile Interstitial Portrait
480x320Mobile Interstitial Landscape
336x280Large Rectangle
300x250Medium Rectangle
320x100Large Mobile Banner
468x60Banner
320x50Mobile Leaderboard
300x50Mobile Banner

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)
302Redirect (sync flow)
400Bad request (malformed JSON)
401Unauthorized (invalid token)
403Forbidden (domain not allowed)
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 standard ad sizes as JSON.

GET /_/sizes

Response

json
{
  "sizes": [
    { "width": 160, "height": 600 },
    { "width": 300, "height": 50 },
    { "width": 300, "height": 250 },
    { "width": 300, "height": 600 },
    { "width": 320, "height": 50 },
    { "width": 320, "height": 100 },
    { "width": 320, "height": 480 },
    { "width": 336, "height": 280 },
    { "width": 468, "height": 60 },
    { "width": 480, "height": 320 },
    { "width": 728, "height": 90 },
    { "width": 970, "height": 90 },
    { "width": 970, "height": 250 }
  ]
}

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