RTB API
Publisher APIThe Serving Engine is an HTTP GET API. Partners pass publisher, brand, geo, and optional traffic context as query-string parameters. PubAdHub returns JSON indicating whether an ad is available (status = 1) or not (status = 0), with bid and redirect details on success. Bid amounts are returned in USD only.
http://rtb.pubadhub.com
/serving-engine
Authentication
Publisher identification is provided through the required pubi query parameter ({PublisherID}). Your Account Manager will provide your Publisher Id. No additional authentication headers or tokens are specified for this endpoint.
Query Parameters
Query-string parameters. Required: pubi, bd, cc. Optional: ua, kw, ip, dl, clickid, subid, fbid, ref. Placeholders in curly braces are substituted with live values at request time.
pubi
Location: query
Your AM will provide you Publisher Id
Example: {PublisherID}
bd
Location: query
Brand domain
Example: {BrandDomain}
cc
Location: query
Country Code
Example: {CountryCode}
ua
Location: query
End user browser agent
Example: {UserAgent}
kw
Location: query
You can pass, user search keyword
Example: {KeywordFromUserSearch}
ip
Location: query
End user IP address
Example: {UserIpAddress}
dl
Location: query
This will use to redirect particular page, keep it empty if not available
Example: {DeepLink}
clickid
Location: query
Publisher click Id, In this param you can pass the Number, String and both
Example: {PublisherClickID}
subid
Location: query
Traffic Source
Example: {SourcesOfTraffic}
fbid
Location: query
Probable winning bid
Example: {FloorBid}
ref
Location: query
Referrer URL where Ad was displayed
Example: {Referrer}
| Name | Type | Required | Location | Description | Example |
|---|---|---|---|---|---|
| pubi | String | REQUIRED | query | Your AM will provide you Publisher Id | {PublisherID} |
| bd | URL | REQUIRED | query | Brand domain | {BrandDomain} |
| cc | String | REQUIRED | query | Country Code | {CountryCode} |
| ua | String | OPTIONAL | query | End user browser agent | {UserAgent} |
| kw | Number/String | OPTIONAL | query | You can pass, user search keyword | {KeywordFromUserSearch} |
| ip | IPV4/IPV6 | OPTIONAL | query | End user IP address | {UserIpAddress} |
| dl | URL | OPTIONAL | query | This will use to redirect particular page, keep it empty if not available | {DeepLink} |
| clickid | Number/String | OPTIONAL | query | Publisher click Id, In this param you can pass the Number, String and both | {PublisherClickID} |
| subid | String | OPTIONAL | query | Traffic Source | {SourcesOfTraffic} |
| fbid | Decimal | OPTIONAL | query | Probable winning bid | {FloorBid} |
| ref | String | OPTIONAL | query | Referrer URL where Ad was displayed | {Referrer} |
API format
http://rtb.pubadhub.com/serving-engine?pubi={PublisherID}&bd={BrandDomain}&ua={UserAgent}&kw={KeywordFromUserSearch}&cc={CountryCode}&ip={UserIpAddress}&dl={DeepLink}&clickid={PublisherClickID}&subid={SourcesOfTraffic}&fbid={FloorBid}&ref={Referrer}
Request example
GET /serving-engine?pubi={PublisherID}&bd={BrandDomain}&ua={UserAgent}&kw={KeywordFromUserSearch}&cc={CountryCode}&ip={UserIpAddress}&dl={DeepLink}&clickid={PublisherClickID}&subid={SourcesOfTraffic}&fbid={FloorBid}&ref={Referrer} HTTP/1.1
Host: rtb.pubadhub.com
Response
Ads available (`status` = 1). Includes bid_amount (USD), redirect_url, and is_deeplink. HTTP status code: NEEDS_REVIEW (not specified in the PDF).
{
"status": 1,
"bid_amount": "0.20",
"redirect_url": "https://ck.pubadhub.com//track?encyp=...............",
"is_deeplink": "Yes"
}
No-fill / no-bid (`status` = 0). Do not expect bid_amount or redirect_url in this response shape. HTTP status code: NEEDS_REVIEW (not specified in the PDF).
{
"status": 0
}
Missing required field (`status` = 0 with error). HTTP status code: NEEDS_REVIEW (not specified in the PDF).
{
"status": 0,
"error": "The country code is required."
}
Missing required field (`status` = 0 with error). HTTP status code: NEEDS_REVIEW (not specified in the PDF).
{
"status": 0,
"error": "The Brand Domain is required."
}
Response fields
status
0 or 1
1 => Success with Ads. 0 => No Ads
Example: 1
bid_amount
Decimal
The bid amount will be returned in USD only.
Example: 0.20
redirect_url
URL
It will return the ad's redirect URL. Hosted on the PubAdHub click/track domain and used for click / ad redirect tracking.
Example: https://ck.pubadhub.com/track?encyp=...............&pli=16&cc=US
is_deeplink
Yes/No
Yes => We do support deeplink and we have received deeplink in request parameter. No => Either we are not supporting deeplink or we have not received deeplink in request parameter
Example: Yes
error
String
Present on required-field error responses when status = 0.
Example: The country code is required.
| Name | Type | Description | Example |
|---|---|---|---|
| status | 0 or 1 | 1 => Success with Ads. 0 => No Ads | 1 |
| bid_amount | Decimal | The bid amount will be returned in USD only. | 0.20 |
| redirect_url | URL | It will return the ad's redirect URL. Hosted on the PubAdHub click/track domain and used for click / ad redirect tracking. | https://ck.pubadhub.com/track?encyp=...............&pli=16&cc=US |
| is_deeplink | Yes/No | Yes => We do support deeplink and we have received deeplink in request parameter. No => Either we are not supporting deeplink or we have not received deeplink in request parameter | Yes |
| error | String | Present on required-field error responses when status = 0. | The country code is required. |
Errors
Required Field Error — Country Code
The country code is required.
{
"status": 0,
"error": "The country code is required."
}
Required Field Error — Brand Domain
The Brand Domain is required.
{
"status": 0,
"error": "The Brand Domain is required."
}
Notes
Original PDF
This page is sourced from the official API PDF. The original file remains available.
RTB API.pdf