Skip to content

Pre-bid API Reference

The Pre-bid binary exposes a small HTTP/1.1 API. There are two endpoints: one for lookups, one for health checks. Both speak plain HTTP and respond with JSON (lookup) or a status code (health check).

The binary runs locally on your bidder host. The base URL is whatever address and port the binary is bound to — typically http://localhost:9898. The examples below use that default.

Every lookup request must include an API key in the k query parameter. Your Pinokio account manager will provide the key.

There is no header-based authentication and no token refresh. The key is configured into the binary and into your bidder; rotation happens out of band.

A few rules apply to every lookup:

  • The total request size must not exceed 8 KB.
  • The request URL and all parameter names must be lowercase.
  • All parameter values must be URL-encoded.
  • Parameter values must not contain any of: #, @, =, ;.
  • Data passed in Pre-bid lookups should match what you pass to Post-bid for the same impression — that is what lets us close the loop between the two.

Submits a bid request for prediction. Returns a JSON payload that your bidder can use to decide whether to drop the bid, log it for review, or proceed normally.

The supply chain is passed as a path segment, not a query parameter. The format mirrors the OpenRTB schain string:

/api/v1/ivt/lookup?schain=<version>,<complete>!<node>!<node>!...

Each node is comma-delimited: asi,sid,hp,rid,name,domain. Nodes are separated with !. Example:

schain=1.0,1!rtbmarket.net,742934582496,1,bid-request-815715,publisher,mobilepub.net!adbridge.io,633,1,bid-request550974,intermediary,sspbridge.com

The query string follows the ? after the schain segment.

Most parameter names match the equivalent Post-bid parameters so you can populate both from the same source. The full list:

ParameterRequiredDescription
pYesPinokio Partner ID (UUID). Identifies your account.
kYesAPI key.
pubYesPublisher ID — same value as field #2 in the ads.txt.
nodeYesBidder or prebid instance / server identifier.
ipYesClient IP address.
uaYesUser agent string (URL-encoded).
uidYesUnique user identifier — cookie ID on web, IFA on mobile/CTV.
ifaConditionalDevice IFA (IDFA / AAID). Required on mobile and CTV.
appConditionalApp ID / bundle ID. Required for in-app and CTV traffic. Case-sensitive.
sidYesSupplier ID — domain of the supplier/exchange. Matches field #1 in ads.txt.
adtYesAd type. Integer: 1 Banner, 2 Video, 3 Audio, 4 Native.
dvtYesDevice type. See device type values.
ratNoRendered ad type. See rendered ad type values.
advNoAdvertiser ID.
plcNoPlacement ID.
creNoCreative ID.
cbNoCache buster — random value to force tag reload.
dimNoCreative dimensions, format {Width}x{Height}.
aidNoAd ID — unique identifier for the creative.
geoNoTwo-letter ISO country code.
p1p5NoCustom reporting dimensions. Not unique per request — used for grouping in reports.
Pre-bid lookup URL
http://localhost:9898/api/v1/ivt/lookup
?schain=1.0,1!rtbmarket.net,742934582496,1,bid-request-815715,publisher,mobilepub.net
!adbridge.io,633,1,bid-request550974,intermediary,sspbridge.com
?p=1b6c4502-dfef-4875-b2e9-4d1abb7f039a
&k=rePVI7t
&node=US-worker-1
&pub=1
&ua=Mozilla%2F5.0%20%28Linux%3B%20Android%2012%3B%20SM-A525F%29%20AppleWebKit%2F537.36
&ip=34.147.173.143
&uid={UID}
&ifa=204787CA-13E7-44EA-BAC6-3AABBE993565
&app=1712942862
&rid=6711-a5741770-00b1-4fb7-9a8a-0c3fc6d5cf7a
&sid=supplyhub.com
&adt=3
&dvt=4
&rat=2
&adv=9230
&plc=1712942862-414x896
&cre=vXM93TtEu1nv5Z%2FgrRJTyCJ%2FMNjQ
&cb=SlN8FgEn6z
&dim=414x896
&aid=vXM93TtEu1nv5Z%2FgrRJTyCJ%2FMNjQ
&geo=JP
&p1=97451
&p2=8930
&p3=shop_Banner_GB
&p4=1107

The response is a JSON object with four top-level sections. Example:

Pre-bid response
{
"ipReputation": {
"ipBotActivity": false,
"ipHosting": false,
"ipVpn": false
},
"botRisk": {
"score": 0.30000000000000004,
"band": "low",
"confidence": 1
},
"components": {
"p_hard": 0.3,
"p_givt": 0,
"p_sivt": 0,
"p_hist": 0
},
"uaValid": false,
"schain": {
"valid": true,
"verified": true,
"complete": 1
}
}

The headline bot prediction.

FieldTypeDescription
scorenumberCombined risk prediction, 0.01.0. Higher means higher likelihood of invalid traffic.
bandstringBucketed risk level: low, medium, or high. Most bidders use this as the primary signal.
confidencenumberHow confident the model is in the prediction. 0 means there is not enough data yet to be confident; higher means more confidence.

The individual probabilities that feed into botRisk.score. Useful for debugging and for custom bidding logic that wants to weight categories differently.

FieldDescription
p_hardProbability based on hard signals (deterministic flags — known-bad IFAs, malformed UAs, etc.).
p_givtProbability of General Invalid Traffic — automated, declared, easily detectable.
p_sivtProbability of Sophisticated Invalid Traffic — bots that mimic human behavior.
p_histProbability based on historical patterns for this user / device / source.

Three boolean flags about the request IP.

FieldDescription
ipBotActivityThe IP is frequently seen recently to be used by bots.
ipHostingThe IP belongs to a hosting / datacenter range, not residential.
ipVpnThe IP is a known VPN exit node.

Boolean. false indicates the user agent is malformed, spoofed, or otherwise inconsistent with the rest of the request signals.

The result of validating the schain string passed in the path.

FieldDescription
validThe string parsed without errors.
verifiedEvery node in the chain matched our records.
completeThe complete flag from the schain string itself (1 or 0).
CodeMeaning
200Lookup succeeded. Body contains the JSON above.
400Bad request — usually a missing required parameter or a forbidden character.
401API key missing or invalid.
413Request too large (over 8 KB).
503Binary cannot serve lookups — see Troubleshooting.

Lightweight endpoint for monitoring. Returns no body — only a status code.

CodeMeaning
200Binary is healthy.
503Binary is up but cannot serve lookups.
curl
curl -i http://localhost:9898/health-check

We recommend polling this once every 10 seconds to once per minute from your monitoring system.


Used by dvt. Aligned with OpenRTB 2.6 / AdCOM 1.0.

ValueMeaning
1Mobile / tablet (legacy combined category)
2Personal computer (desktop / laptop)
3Connected TV
4Phone
5Tablet
6Connected device (Roku, Apple TV, Fire TV, consoles)
7Set-top box
8Digital out-of-home (DOOH)

Used by rat. Interpretation depends on the media type (adt).

ValueDisplayVideoAudioNative
0UnknownUnknownUnknownUnknown
1Rich mediaRich media
2StaticStatic
3Skippable in-streamSkippable in-stream
4Non-skippable in-streamNon-skippable in-stream
5Video discovery
6Bumper
7Outstream
8Masthead

For example, a rich-media display unit is adt=1, rat=1. A non-skippable in-stream video is adt=2, rat=4.