Skip to content
PubAdHub

RTB API

Publisher API

The 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.

Base URL http://rtb.pubadhub.com
GET /serving-engine
lock

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
String REQUIRED

Location: query

Your AM will provide you Publisher Id

Example: {PublisherID}

bd
URL REQUIRED

Location: query

Brand domain

Example: {BrandDomain}

cc
String REQUIRED

Location: query

Country Code

Example: {CountryCode}

ua
String OPTIONAL

Location: query

End user browser agent

Example: {UserAgent}

kw
Number/String OPTIONAL

Location: query

You can pass, user search keyword

Example: {KeywordFromUserSearch}

ip
IPV4/IPV6 OPTIONAL

Location: query

End user IP address

Example: {UserIpAddress}

dl
URL OPTIONAL

Location: query

This will use to redirect particular page, keep it empty if not available

Example: {DeepLink}

clickid
Number/String OPTIONAL

Location: query

Publisher click Id, In this param you can pass the Number, String and both

Example: {PublisherClickID}

subid
String OPTIONAL

Location: query

Traffic Source

Example: {SourcesOfTraffic}

fbid
Decimal OPTIONAL

Location: query

Probable winning bid

Example: {FloorBid}

ref
String OPTIONAL

Location: query

Referrer URL where Ad was displayed

Example: {Referrer}

API format

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).

JSON
{
    "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).

JSON
{
    "status": 0
}

Missing required field (`status` = 0 with error). HTTP status code: NEEDS_REVIEW (not specified in the PDF).

JSON
{
    "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).

JSON
{
    "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.

Errors

Required Field Error — Country Code

The country code is required.

JSON
{
    "status": 0,
    "error": "The country code is required."
}

Required Field Error — Brand Domain

The Brand Domain is required.

JSON
{
    "status": 0,
    "error": "The Brand Domain is required."
}

Notes

info
Call GET http://rtb.pubadhub.com/serving-engine with query-string parameters. Custom HTTP request headers are not documented for this endpoint.
info
Required parameters: pubi, bd, cc. Optional: ua, kw, ip, dl, clickid, subid, fbid, ref.
info
Always parse the JSON body and inspect status. status = 1 → success with ads (use bid_amount and redirect_url). status = 0 without error → No Ads. status = 0 with error → required-field / validation error.
info
bid_amount is a Decimal value returned in USD only.
info
On success, use redirect_url for click / redirect tracking. Example from the specification: https://ck.pubadhub.com/track?encyp=0u8IgckyXQH2G6xy32Spdvzx+3RdLspJK3aS0jauqYNcle0iQnejHVTmIgGpo1N+WgelHjtjiWjY/uxomP8rxQ==&rtuli=02bdc1e13a7b75c698114c94d61b3f5b&pli=16&cc=US
info
For deeplink campaigns, pass dl when available; otherwise leave it empty. is_deeplink indicates whether deeplink was supported and received in the request.
info
Missing required fields return status = 0 with an error message (for example, "The Brand Domain is required." or "The country code is required.").

Original PDF

This page is sourced from the official API PDF. The original file remains available.

RTB API.pdf

Related documentation

play_circle

Try it out

Fill the fields below, copy the generated cURL, or send a live request.

GET http://rtb.pubadhub.com/serving-engine
cURL

        
Response Status: