Publisher Stats
Getting started with the TrafficHaus Publisher Stats API is easy! This page will guide you through the process, step-by-step.
Get Your Key
Get your API key below. We recommend keeping this hidden in a safe place, as it is just like your password for the API.
API Key:
Get Your Stats
We offer API access to your stats via simple HTTP GET requests to our server, using query string parameters.
| Type | Parameter | Description |
|---|---|---|
| string | api_key | Required. This is where you pass in your API Key, this is required with every call to our TrafficHaus server. |
| string | start_date | Recommended. Specify a start date for the returned stats. Will default to yesterday if omitted. (Note: Selecting too long of a date range may lead to an error, as we limit the size of each request to 100MB or less.) |
| string | end_date | Recommended. Specify an end date for the returned stats. Will default to yesterday if omitted. (Note: Selecting too long of a date range may lead to an error, as we limit the size of each request to 100MB or less.) |
| string | zones | Optional. Include a comma-separated list of zone IDs to get a specific subset of your zones, or just omit to get them all. |
| string | geos | Optional. Include a comma-separated list of 2-letter country codes to get a specific regional subset, or just omit to include all countries. |
| string | group_by | Optional. By default, we will return your stats grouped by site and zone. You can also choose your own groupings from the following parameters: site, zone, geo, date and c1 |
| int | format | We offer a variety of formats for your convenience: 0 = raw JSON output (default), 1 = formatted output for dataTables, wrapped in a [data] envelope, 2 = extended output (datatables format plus additional [meta] envelope) |
Publisher RTB
Add RTB Site
The site you want to receive ads via RTB will need to be explicitly added and enabled after being added in the Sites tab. You can add your site by going to SITES & ZONES -> RTB Sites, clicking the Add RTB Site button and selecting your site from the list.



Notice the Key column in the table. That key is the RTB site identifier you will use as a param on the endpoint you will send RTB requests to.
RTB requests for that site(using that specific key) won't pass through until the site has been enabled(approved) by an admin.

RTB Request Object
Object: bidrequest
| Attribute | Required | Description |
|---|---|---|
| id | yes | Unique ID of the bid request. |
| imp | yes | Array of Imp objects representing the impressions offered. |
| site | yes | Details via a site object about the publisher's website. |
| device | yes | Details via a device object about the user's device to which the impression will be delivered. |
| user | no | Details via a user object about the human user of the device. |
| tmax | no | Maximum time in milliseconds before considering as a request timeout. |
Object: imp
| Attribute | Required | Description |
|---|---|---|
| id | yes | Unique ID of the impression. |
| banner | only for banner/iframe imps | A banner object. |
| bidfloor | no; default 0.001 | Minimum bid for this impression expressed in CPM. |
| ext | yes; if using single endpoint | Placeholder for exchange-specific extensions to OpenRTB. |
If banner object is not set, the Traffichaus zone will be defaulted to pop-under type (if using single endpoint)
Supported ext attributes
| Attribute | Required | Description |
|---|---|---|
| th_location | yes; if using single endpoint | The location of the zone the ad is assigned to. Required to be one of the supported Traffichaus locations based on the zone platform type. |
| th_zone_platform_type | recommended; if using single endpoint | The platform type of the zone the ad is assigned to. Required to be one of the supported Traffichaus platform types. |
| zone_id | recommended | The zone ID of the publisher's site for which an impression is requested. |
Object: site
| Attribute | Required | Description |
|---|---|---|
| id | no | Unique ID of the requesting site. |
| domain | recommended | Domain of the site (e.g., "example.com"). |
| page | no | URL of the page where the impression will be shown. |
| ref | no | Referrer URL that caused navigation to the current page. |
| cat | no; default IAB25 | The IAB content category of the site. |
| keywords | no | Comma separated list of keywords about the site. |
| ext | yes; if using single endpoint | Placeholder for exchange-specific extensions to OpenRTB. |
Supported ext attributes
| Attribute | Required | Description |
|---|---|---|
| th_site_key | yes; if using single endpoint | The RTB site key assigned to the site after being added as a RTB Site to Traffichaus. |
| zone_id | recommended(if not set in imp object's ext data) | The zone ID of the publisher's site for which the impressions are requested. |
Object: device
| Attribute | Required | Description |
|---|---|---|
| ip | recommended | IP address of device. |
| ua | yes | Browser user agent string. |
| language | recommended | Device language. Only ISO 639-1 Alpha-2 or Alpha-3 codes. |
| geo | recommended | Location of the device defined by a geo object . |
| os | recommended | Device operating system (e.g., "iOS", "Android", "Linux", "Windows"). |
| devicetype | no | The general type of device. |
| carrier | no | Carrier or ISP (e.g., "VERIZON"). |
| connectiontype | no | The type of connection the device uses(e.g., Ethernet, 2G, 3G, WiFI) - use integer values as given by the official OpenRTR documentation. |
| ext | no | Placeholder for exchange-specific extensions to OpenRTB. |
Object: geo
| Attribute | Required | Description |
|---|---|---|
| country | recommended | Country code using ISO 3166-1 alpha-2. |
| ext | no | Placeholder for exchange-specific extensions to OpenRTB. |
Object: banner
| Attribute | Required | Description |
|---|---|---|
| w | yes | Width of the required ad in pixels. |
| h | yes | Height of the required ad in pixels. |
RTB Response Object
Object: bidresponse
| Attribute | Required | Description |
|---|---|---|
| id | yes | ID of the bid request to which this is a response. |
| seatbid | yes | Collection of bids made by the bidder on behalf of a specific seat. |
Object: seatbid
| Attribute | Required | Description |
|---|---|---|
| bid | yes | Array of 1+bid objects each related to an impression. Multiple bids can relate to the same impression. |
Object: bid
| Attribute | Required | Description |
|---|---|---|
| id | yes | Bidder generated bid ID. |
| impid | yes | ID of the imp object in the related bid request. |
| price | yes | Bid price expressed as CPM. |
| nurl | yes | Win notice URL called by the exchange if the bid wins. |
| adm | yes | The XML ad markup. |
RTB Single Endpoint
https://syndication.traffichaus.com/adserve/rtb.php
Perform RTB Requests - Single Endpoint
{
"id": "d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa",
"seatbid": [
{
"bid": [
{
"id": "384878",
"impid": 6145298465,
"price": 0.064,
"nurl": "https:\/\/syndication.traffichaus.com\/adserve\/rtb_notify.php?bidid=8a541a82af5bafa0f3cbd0b1fc5ad6",
"adm": "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><ad><iframeAd><url><![CDATA[https:\/\/syndication.traffichaus.com\/adserve\/index.php?rtb&z=42750&ba=175842&rkey=900bb860edffe77f131b0d8975d65e]]><\/url><\/iframeAd><\/ad>"
}
]
}
]
}
If no bid ads are currently available for your specific zone, the expected HTTP response is 204 No Content.
RTB Multiple Endpoints
If you can't set the custom attributes for RTB site key and ad location (th_site_key and th_location) you can use this multiple endpoint method.
Each platform type + ad space type + ad location combo has its own endpoint enabled for RTB requests.
| Platform | Ad Space | Ad Location | Endpoint |
|---|---|---|---|
| Desktop | Display | In Player | http://syndication.traffichaus.com/rtb/desktop/display/in-player |
| Supported ad sizes: 300x250, 250x250 | |||
| Desktop | Display | Next to Video | http://syndication.traffichaus.com/rtb/desktop/display/next-to-video |
| Supported ad sizes: 300x250, 315x300 | |||
| Desktop | Display | Leaderboard | http://syndication.traffichaus.com/rtb/desktop/display/leaderboard |
| Supported ad sizes: 728x90, 468x60, 480x100 | |||
| Desktop | Display | Footer | http://syndication.traffichaus.com/rtb/desktop/display/footer |
| Supported ad sizes: 900x250, 950x250, 300x250, 600x250, 728x90, 1x1 | |||
| Desktop | Display | Skyscraper | http://syndication.traffichaus.com/rtb/desktop/display/skyscraper |
| Supported ad sizes: 160x600 | |||
| Desktop | Display | Tower | http://syndication.traffichaus.com/rtb/desktop/display/tower |
| Supported ad sizes: 300x600 | |||
| Desktop | Display | IM Floater | http://syndication.traffichaus.com/rtb/desktop/display/im-floater |
| Supported ad sizes: 250x170, 300x250, 30x30, 300x100 | |||
| Desktop | Display | Index Cube | http://syndication.traffichaus.com/rtb/desktop/display/index-cube |
| Supported ad sizes: 320x240, 300x250, 468x60, 160x160, 200x250, 920x360, 300x315, 250x250, 200x200, 155x276 | |||
| Desktop | Display | Under Video | http://syndication.traffichaus.com/rtb/desktop/display/under-video- |
| Supported ad sizes: 720x250, 728x90 | |||
| Desktop | Display | Header | http://syndication.traffichaus.com/rtb/desktop/display/header |
| Supported ad sizes: 300x100 | |||
| Desktop | Display | Middle Banner | http://syndication.traffichaus.com/rtb/desktop/display/middle-banner |
| Supported ad sizes: 600x250, 728x90, 600x400, 600x195, 960x384, 420x580, 345x80 | |||
| Desktop | Display | Members Dating | http://syndication.traffichaus.com/rtb/desktop/display/members-dating |
| Supported ad sizes: 300x250, 300x100, 300x85, 728x90, 160x120, 300x50, 960x150, 510x350, 30x30, 300x350, 600x400 | |||
| Desktop | Display | Full Page Banner | http://syndication.traffichaus.com/rtb/desktop/display/full-page-banner |
| Supported ad sizes: | |||
| Desktop | Display | Mainstream | http://syndication.traffichaus.com/rtb/desktop/display/mainstream |
| Supported ad sizes: | |||
| Desktop | Display | Interstitial | http://syndication.traffichaus.com/rtb/desktop/display/interstitial |
| Supported ad sizes: 300x250, 300x350 | |||
| Desktop | Display | Pixel | http://syndication.traffichaus.com/rtb/desktop/display/pixel |
| Supported ad sizes: 1x1 | |||
| Desktop | Pop Under | Pop Under | http://syndication.traffichaus.com/rtb/desktop/pop-under/pop-under |
| Desktop | Video Ads | In Stream Pre-Roll | http://syndication.traffichaus.com/rtb/desktop/video-ads/in-stream-pre_roll |
| Desktop | Video Ads | Video Floater | http://syndication.traffichaus.com/rtb/desktop/video-ads/video-floater |
| Desktop | Push Notifications | Push Notification | http://syndication.traffichaus.com/rtb/desktop/push-notifications/push-notification |
| Desktop | Push Notifications | In-Page Push | http://syndication.traffichaus.com/rtb/desktop/push-notifications/in_page-push |
| Desktop | Postitial | Fullpage Postitial | http://syndication.traffichaus.com/rtb/desktop/postitial/fullpage-postitial |
| Desktop | Native | Native | http://syndication.traffichaus.com/rtb/desktop/native/native |
| Desktop | SMS Clicks | SMS Clicks | http://syndication.traffichaus.com/rtb/desktop/sms-clicks/sms-clicks |
| Mobile | Mobile Redirect | Mobile Redirect | http://syndication.traffichaus.com/rtb/mobile/mobile-redirect/mobile-redirect |
| Mobile | Display | Header | http://syndication.traffichaus.com/rtb/mobile/display/header |
| Supported ad sizes: 300x100, 728x90, 300x75, 320x75, 300x99, 300x250, 300x50, 320x100 | |||
| Mobile | Display | Middle Banner | http://syndication.traffichaus.com/rtb/mobile/display/middle-banner |
| Supported ad sizes: 300x100, 300x250, 375x200 | |||
| Mobile | Display | IM Floater | http://syndication.traffichaus.com/rtb/mobile/display/im-floater |
| Supported ad sizes: 300x100, 300x250 | |||
| Mobile | Display | Footer | http://syndication.traffichaus.com/rtb/mobile/display/footer |
| Supported ad sizes: 300x250, 300x100 | |||
| Mobile | Display | Interstitial | http://syndication.traffichaus.com/rtb/mobile/display/interstitial |
| Supported ad sizes: 300x250 | |||
| Mobile | Display | Post Roll | http://syndication.traffichaus.com/rtb/mobile/display/post-roll |
| Supported ad sizes: | |||
| Mobile | Display | Under Player | http://syndication.traffichaus.com/rtb/mobile/display/under-player |
| Supported ad sizes: 300x100, 300x250 | |||
| Mobile | Display | Index Cube | http://syndication.traffichaus.com/rtb/mobile/display/index-cube |
| Supported ad sizes: 1080x1920 | |||
| Mobile | Pop Under | Pop Under | http://syndication.traffichaus.com/rtb/mobile/pop-under/pop-under |
| Mobile | Video Ads | In Stream Pre-Roll | http://syndication.traffichaus.com/rtb/mobile/video-ads/in-stream-pre_roll |
| Mobile | Video Ads | Video Floater | http://syndication.traffichaus.com/rtb/mobile/video-ads/video-floater |
| Mobile | Postitial | Postitial | http://syndication.traffichaus.com/rtb/mobile/postitial/postitial |
| Mobile | Native | Native | http://syndication.traffichaus.com/rtb/mobile/native/native |
| Tablet | Display | Index Cube | http://syndication.traffichaus.com/rtb/tablet/display/index-cube |
| Supported ad sizes: | |||
| Tablet | Display | Next to Video | http://syndication.traffichaus.com/rtb/tablet/display/next-to-video |
| Supported ad sizes: 300x250 | |||
| Tablet | Display | Interstitial | http://syndication.traffichaus.com/rtb/tablet/display/interstitial |
| Supported ad sizes: 300x250 | |||
| Tablet | Display | Footer | http://syndication.traffichaus.com/rtb/tablet/display/footer |
| Supported ad sizes: 300x250 | |||
| Tablet | Display | Tower | http://syndication.traffichaus.com/rtb/tablet/display/tower |
| Supported ad sizes: | |||
| Tablet | Display | Leaderboard | http://syndication.traffichaus.com/rtb/tablet/display/leaderboard |
| Supported ad sizes: | |||
| Tablet | Display | Under Video | http://syndication.traffichaus.com/rtb/tablet/display/under-video |
| Supported ad sizes: 720x250, 728x90 | |||
| Tablet | Pop Under | Pop Under | http://syndication.traffichaus.com/rtb/tablet/pop-under/pop-under |
| Tablet | Video Ads | In Stream Pre-Roll | http://syndication.traffichaus.com/rtb/tablet/video-ads/in-stream-pre_roll |
| Tablet | Video Ads | Video Floater | http://syndication.traffichaus.com/rtb/tablet/video-ads/video-floater |
| Tablet | Postitial | Postitial | http://syndication.traffichaus.com/rtb/tablet/postitial/postitial |
| Tablet | Native | Native | http://syndication.traffichaus.com/rtb/tablet/native/native |
Perform RTB Requests - Multiple Endpoints
{
"id": "d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa",
"seatbid": [
{
"bid": [
{
"id": "384878",
"impid": 6145298465,
"price": 0.064,
"nurl": "https:\/\/syndication.traffichaus.com\/adserve\/rtb_notify.php?bidid=8a541a82af5bafa0f3cbd0b1fc5ad6",
"adm": "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><ad><iframeAd><url><![CDATA[https:\/\/syndication.traffichaus.com\/adserve\/index.php?rtb&z=42750&ba=175842&rkey=900bb860edffe77f131b0d8975d65e]]><\/url><\/iframeAd><\/ad>"
}
]
}
]
}
Before performing RTB requests, select the endpoint suited for the type of zones you wish to requests ads for and make sure you get your site key.
All endpoints accept only valid RTB JSON POST requests with the following URL params:
| Type | Parameter | Description |
|---|---|---|
| string | key | Required. This is where you pass your RTB site key you got after adding your site to the RTB Sites list. |
If no bid ads are currently available for your specific zone, the expected HTTP response is 204 No Content.
Manage RTB Site Zones
Once a RTB request was successfully received, a new zone will be queued for creation under the site associated to the given key.
You can view your RTB zones under SITES & ZONES -> Zones

RTB Response Codes
| Code | Description |
|---|---|
| 400 | An invalid JSON RTB request body was received or the you didn't provide all of the required data (first of all check if you set the RTB site key). |
| 403 | The provided RTB site key is invalid or the RTB site has not been enabled on Traffichaus by an admin. |
| 500 | An internal error has occurred and we're probably looking into it. |
Publisher Sites
Getting started with the TrafficHaus Publishers API is easy! This page will guide you through the process, step-by-step.
Get Your Key
Get your API key below. We recommend keeping this hidden in a safe place, as it is just like your password for the API.
API Key:
Create Site
We offer API access to create sites via simple HTTP POST requests to our server, using query string parameters.
GET params
| Type | Parameter | Description |
|---|---|---|
| string | key | Required. This is where you pass in your API Key, this is required with every call to our TrafficHaus server. |
POST params
| Type | Parameter | Description |
|---|---|---|
| string | target | Required. This is where you send the api target, in this case "site". |
| string | action | Required. This is the action that you want the api to do, in this case creation. |
| string | site_name | Required. The name of the site. |
| string | site_url | Required. The url of the site. |
Get Sites
We offer API access to retrieve your sites via simple HTTP POST requests to our server, using query string parameters.
GET params
| Type | Parameter | Description |
|---|---|---|
| string | key | Required. This is where you pass in your API Key, this is required with every call to our TrafficHaus server. |
POST params
| Type | Parameter | Description |
|---|---|---|
| string | target | Required. This is where you send the api target, in this case "site". |
| string | action | Required. This is the action that you want the api to do, in this case creation. |
Publisher Zones
Getting started with the TrafficHaus Publishers API is easy! This page will guide you through the process, step-by-step.
Get Your Key
Get your API key below. We recommend keeping this hidden in a safe place, as it is just like your password for the API.
API Key:
Create Zone
We offer API access to create zones via simple HTTP POST requests to our server, using query string parameters.
GET params
| Type | Parameter | Description |
|---|---|---|
| string | key | Required. This is where you pass in your API Key, this is required with every call to our TrafficHaus server. |
POST params
| Type | Parameter | Description |
|---|---|---|
| string | target | Required. This is where you send the api target, in this case "zone". |
| string | action | Required. This is the action that you want the api to do, in this case creation. |
| string | site_id | Required. The site id. |
| string | platform_type | Required. The platform type. For example "Desktop". |
| string | ad_location | Required. The ad location type. For example "Native". |
| string | ad_space | Required. The Ad Space type. For example "Native" |
| string | ad_type | Required. The type of the ad zone. |
| string | zone_name | Required. The Name of the zone. |
| string | min_cpm | Required. The minimum cpm amount. |
| string | is_nsfw | Required. If the zone is Not Safe For Work. |
| string | accept_bidding | Required. If the zone accepts Bidding Ads. |
| string | dynamic | Optional. If the zone is a Native one, if dynamic is set to 1, the size of the zone is determined by the number of available ads, and the rows and columns params must be set to 0 for this to happen. |
| string | rows | Optional. If the zone is a Native one, the number of rows that the zone will output. |
| string | columns | Optional. If the zone is a Native one, the number of columns that the zone will output. |
Get Zones
We offer API access to retrieve your zones via simple HTTP POST requests to our server, using query string parameters.
GET params
| Type | Parameter | Description |
|---|---|---|
| string | key | Required. This is where you pass in your API Key, this is required with every call to our TrafficHaus server. |
POST params
| Type | Parameter | Description |
|---|---|---|
| string | target | Required. This is where you send the api target, in this case "zone". |
| string | action | Required. This is the action that you want the api to do, in this case retrieval. |
| string | site_id | Required. This is the site_id where the needed zones belong to. |
Change Ad Count
Sets how many ads should be active in a zone. The platform rebalances the weights of the zone's ads so the requested number are served. If the zone already serves that many ads the call returns an error stating the count is unchanged.
GET params
| Type | Parameter | Description |
|---|---|---|
| string | key | Required. This is where you pass in your API Key, this is required with every call to our TrafficHaus server. |
POST params
| Type | Parameter | Description |
|---|---|---|
| string | target | Required. In this case "zone". |
| string | action | Required. In this case "change_ad_count". |
| int | zone_id | Required. The zone whose active ad count you want to change. |
| int | ad_count | Required. The number of ads that should be active in the zone. |
Publisher Assets
Getting started with the TrafficHaus Publishers API is easy! This page will guide you through the process, step-by-step.
Get Your Key
Get your API key below. We recommend keeping this hidden in a safe place, as it is just like your password for the API.
API Key:
Get Assets
Returns the creative assets (media urls and dimensions) for the ads running on your zones within the given time window. Timestamps are UNIX timestamps (seconds).
GET params
| Type | Parameter | Description |
|---|---|---|
| string | key | Required. This is where you pass in your API Key, this is required with every call to our TrafficHaus server. |
POST params
| Type | Parameter | Description |
|---|---|---|
| string | target | Required. In this case "ads". |
| string | action | Required. In this case "assets". |
| int | start_timestamp | Required. Start of the window as a UNIX timestamp (seconds). |
| int | end_timestamp | Required. End of the window as a UNIX timestamp (seconds). |
Advertiser Stats
Getting started with the TrafficHaus Advertiser Stats API is easy! This page will guide you through the process, step-by-step.
Get Your Key
Get your API key below. We recommend keeping this hidden in a safe place, as it is just like your password for the API.
API Key:
Get Your Stats
We offer API access to your stats via simple HTTP GET requests to our server, using query string parameters.
| Type | Parameter | Description |
|---|---|---|
| string | api_key | Required. This is where you pass in your API Key, this is required with every call to our TrafficHaus server. |
| string | start_date | Recommended. Specify a start date for the returned stats. (Note: Selecting too long of a date range may lead to an error, as we limit the size of each request to 100MB or less.) |
| string | end_date | Recommended. Specify an end date for the returned stats. (Note: Selecting too long of a date range may lead to an error, as we limit the size of each request to 100MB or less.) |
| string | campaigns | Optional. Include a comma-separated list of campaign IDs to get a specific subset of your campaigns, or just omit to get them all. |
| string | group_by | Optional. By default, we will return your stats grouped by campaign and date. You can also choose to pull summary data by campaign or date by passing in one of the following parameters: campaign or date |
| int | format | We offer a variety of formats for your convenience: 0 = raw JSON output (default), 1 = formatted output for dataTables, wrapped in a [data] envelope, 2 = extended output (datatables format plus additional [meta] envelope) |
Advertiser RTB
Add RTB Campaign
You need to add an RTB campaign to start receiving requests.

The RTB campaign should have the following fields :
- A campaign name.
- An endpoint url that will receive the requests.
- Ad type: you can choose either banner or pop under. Video will be available soon. If you choose all, you will receive all available ad types.
- Serever zone : right now we have servers in US and EU. You may choose the best region that fits the location of your servers. Please keep in mind that the max response time is set to 150ms. If you choose all you will get requests from all available regions.
- Exclude publishers : you can remove requests from specific publishers by adding publisher ids separated by comma.
- Frequency : used to set the number of requests per seconds. Putting 0 will give the maximum requests. By default it is capped to 1000 req/s. If you need more please contact us.
- Countries : you can choose requests coming from all countries or you can choose among the list.
RTB Request Object
Object: bidrequest
| Attribute | Required | Description |
|---|---|---|
| id | yes | Unique ID of the bid request. |
| imp | yes | Array of Imp objects representing the impressions offered. |
| site | yes | Details via a site object about the publisher's website. |
| device | yes | Details via a device object about the user's device to which the impression will be delivered. |
| user | no | Details via a user object about the human user of the device. |
| tmax | no | Maximum time in milliseconds before considering as a request timeout. |
Object: imp
| Attribute | Required | Description |
|---|---|---|
| id | yes | Unique ID of the impression. |
| banner | only for banner/iframe imps | A banner object. |
| bidfloor | no; default 0.001 | Minimum bid for this impression expressed in CPM. |
| ext | yes; if using single endpoint | Placeholder for exchange-specific extensions to OpenRTB. |
If banner object is not set, the Traffichaus zone will be defaulted to pop-under type (if using single endpoint)
Supported ext attributes
| Attribute | Required | Description |
|---|---|---|
| th_location | yes; if using single endpoint | The location of the zone the ad is assigned to. Required to be one of the supported Traffichaus locations based on the zone platform type. |
| th_zone_platform_type | recommended; if using single endpoint | The platform type of the zone the ad is assigned to. Required to be one of the supported Traffichaus platform types. |
| zone_id | recommended | The zone ID of the publisher's site for which an impression is requested. |
Object: site
| Attribute | Required | Description |
|---|---|---|
| id | no | Unique ID of the requesting site. |
| domain | recommended | Domain of the site (e.g., "example.com"). |
| page | no | URL of the page where the impression will be shown. |
| ref | no | Referrer URL that caused navigation to the current page. |
| cat | no; default IAB25 | The IAB content category of the site. |
| keywords | no | Comma separated list of keywords about the site. |
| ext | yes; if using single endpoint | Placeholder for exchange-specific extensions to OpenRTB. |
Supported ext attributes
| Attribute | Required | Description |
|---|---|---|
| th_site_key | yes; if using single endpoint | The RTB site key assigned to the site after being added as a RTB Site to Traffichaus. |
| zone_id | recommended(if not set in imp object's ext data) | The zone ID of the publisher's site for which the impressions are requested. |
Object: device
| Attribute | Required | Description |
|---|---|---|
| ip | recommended | IP address of device. |
| ua | yes | Browser user agent string. |
| language | recommended | Device language. Only ISO 639-1 Alpha-2 or Alpha-3 codes. |
| geo | recommended | Location of the device defined by a geo object . |
| os | recommended | Device operating system (e.g., "iOS", "Android", "Linux", "Windows"). |
| devicetype | no | The general type of device. |
| carrier | no | Carrier or ISP (e.g., "VERIZON"). |
| connectiontype | no | The type of connection the device uses(e.g., Ethernet, 2G, 3G, WiFI) - use integer values as given by the official OpenRTR documentation. |
| ext | no | Placeholder for exchange-specific extensions to OpenRTB. |
Object: geo
| Attribute | Required | Description |
|---|---|---|
| country | recommended | Country code using ISO 3166-1 alpha-2. |
| ext | no | Placeholder for exchange-specific extensions to OpenRTB. |
Object: banner
| Attribute | Required | Description |
|---|---|---|
| w | yes | Width of the required ad in pixels. |
| h | yes | Height of the required ad in pixels. |
RTB Response Object
Object: bidresponse
| Attribute | Required | Description |
|---|---|---|
| id | yes | ID of the bid request to which this is a response. |
| seatbid | yes | Collection of bids made by the bidder on behalf of a specific seat. |
Object: seatbid
| Attribute | Required | Description |
|---|---|---|
| bid | yes | Array of 1+bid objects each related to an impression. Multiple bids can relate to the same impression. |
Object: bid
| Attribute | Required | Description |
|---|---|---|
| id | yes | Bidder generated bid ID. |
| impid | yes | ID of the imp object in the related bid request. |
| price | yes | Bid price expressed as CPM. |
| nurl | yes | Win notice URL called by the exchange if the bid wins. |
| adm | yes | The XML ad markup. |
Advertiser Bid Campaign
Getting started with the TrafficHaus Advertiser Stats API is easy! This page will guide you through the process, step-by-step.
What is implemented. The advertiser API currently supports creating a bidding campaign with the
bid_ad/createpayload documented on this page, plus pausing, resuming and stopping ads, and reading stats. Please do not infer other behaviour, ad locations, ad types, creative types, or bid rules from the TrafficHaus admin UI or the RTB docs — only what is described below is guaranteed by the campaign-create implementation.
Authentication
Campaign creation authenticates with your API key passed in the key query string parameter (api_key is used only by the stats endpoints and is not accepted here):
POST https://admin.traffichaus.com/api/v1/v1.php?key=YOUR_API_KEY
Accepted values — don't guess, ask the API
Several fields are validated against the live TrafficHaus catalog, and the valid set depends on the account, the is_nsfw flag and the targeting you send — so they are not a fixed list. Instead of hard-coding values, send the request: if a value is not accepted the API returns HTTP 400 with the exact list of accepted values for that field. Use that list as the source of truth.
| Field | Where the accepted values come back in the 400 response |
|---|---|
| ad_location | accepted_ad_locations |
| ad_type | accepted_ad_types (for the chosen ad_location) |
| creative.type | listed in message: “Accepted creative types for this type of ad are: …” |
| geo | accepted_geos |
| languages | accepted_languages |
| operating_systems | accepted_operating_systems (for the chosen device_type) |
| browsers | returned in accepted_operating_systems* (requires geo targeting) |
| carriers | accepted_carriers (for the chosen geo; requires geo targeting) |
| site_targeting_sites | accepted_site_targeting_sites (when using Premium Site Targeting) |
*The browser validation error currently reports its list under the accepted_operating_systems key.
Fixed value sets
These fields accept a fixed set of values:
| Field | Accepted values | Default |
|---|---|---|
| bid_type | cpm, cpc | cpm |
| device_type | Desktop, Mobile, Tablet (comma-separated) | all three |
| site_targeting | Run-of-Network, Premium Site Targeting | Run-of-Network |
| frequency_cap_type | user, zone, site, none | none |
| is_nsfw | 1, 0 | 1 |
Verified working example
This combination is confirmed working for API campaign creation:
| ad_location | ad_type | creative.type | bid_type |
|---|---|---|---|
| Native | Native Model Widget | banners | cpm |
Other ad locations / ad types accepted by the platform also work, but confirm the exact strings via the accepted_* lists above before relying on them.
Get Your Key
Get your API key below. We recommend keeping this hidden in a safe place, as it is just like your password for the API.
API Key:
Create Bidding Campaign
We offer API access to create bidding ads via simple HTTP POST requests to our server, using query string parameters.
GET params
| Type | Parameter | Description |
|---|---|---|
| string | key | Required. This is where you pass in your API Key, this is required with every call to our TrafficHaus server. |
POST params
| Type | Parameter | Description |
|---|---|---|
| string | target | Required. This is where you send the api target, in this case a bidding ad. |
| string | action | Required. This is the action that you want the api to do, in this case creation. |
| string | name | Required. The name of the campaign. |
| string | is_nsfw | Required. The type of the campign, safe for work or not. |
| string | geo | Optional. The full name of the geo targeting. Defaults to Global. Invalid values return accepted_geos. |
| string | device_type | Optional. The device targeting, comma-separated. Accepted: Desktop, Mobile, Tablet. Defaults to all three. |
| string | ad_location | Required. The Ad location type. |
| string | ad_type | Required. The Ad Type based on the selected ad location. |
| string | site_targeting | Optional. Site targeting, which can be Run-of-Network, or Premium Site Targeting which allows targeting on sites available on the selected ad type. Defaults to Run-of-Network. Premium Site Targeting also requires site_targeting_sites. |
| string | frequency_cap_type | Recommended. Frequency capping type, which can be site based, zone based, or user based. Defaults to unlimited. |
| string | frequency_cap_value | Recommended. Frequency capping value, which allows setting up the number of impressions allowed per Frequency capping type. |
| string | languages | Recommended. Language targeting. Defaults to all. Ex: English |
| string | operating_systems | Recommended. Operating system targeting. Defaults to all. Ex: IOS |
| string | browsers | Recommended. Browser targeting. Defaults to all. Ex: Chrome |
| string | carriers | Recommended. Carrier targeting based on the selected Geo. Defaults to all. Ex: Verizon |
| string | keywords | Recommended. Keyword targeting. Ex: Man, Woman |
| string | bid_type | Required. Type of bidding. Can be CPM or CPC. |
| float | bid_amount | Optional. Bid price. Defaults to 0.2. Ex: 1.2 |
| int | daily_budget | Recommended. Total daily budget. Defaults to unlimited. Ex: 200 |
| int | total_budget | Recommended. Total campaign budget. Defaults to unlimited. Ex: 2000 |
| object | creative | Required. Creative options. |
Responses
On success the API returns HTTP 200 with:
{
"success": 1
}
The created campaign and its creative enter a pending approval state and do not start serving until approved. The response does not currently include the new campaign/ad id.
On a validation failure the API returns HTTP 400 with success: 0, a human-readable message, and — for the catalog-validated fields — the list of accepted values. For example, an unsupported ad location:
{
"success": 0,
"message": "Bad ad_location.",
"accepted_ad_locations": ["native", "pop under", "..."]
}
Other representative error messages: "No creative specified.", "Bad creative type value. Accepted creative types for this type of ad are: banners,destination_url,landing_page.", "Bad bid type. Type must be 'CPC' OR 'CPM'.", and "This is not a valid advertiser api key."
Advertiser Manage Bid Ads
Once a bidding campaign has been created you can pause it, resume it, and list the ads running on a given zone. All requests are HTTP POST to the same endpoint, authenticated with your API key in the key query parameter.
Pause a bid ad
Pauses a bidding ad (and its campaign and creatives). Only ads currently active are affected.
| Type | Parameter | Description |
|---|---|---|
| string | target | Required. In this case "bid_ad". |
| string | action | Required. In this case "pause". |
| int | ad_id | Required. The id of the bid ad you want to pause. |
Response: {"success":1}
Resume a bid ad
Resumes a previously paused bidding ad (and its campaign and creatives).
| Type | Parameter | Description |
|---|---|---|
| string | target | Required. In this case "bid_ad". |
| string | action | Required. In this case "resume". |
| int | ad_id | Required. The id of the bid ad you want to resume. |
Response: {"success":1}
Get all ads by zone
Returns the bidding ads you own that target a given zone, including each ad's creatives and their resolved details (title, description, url, likes, photos, videos, price).
| Type | Parameter | Description |
|---|---|---|
| string | target | Required. In this case "bid_ad". |
| string | action | Required. In this case "get_all_ads_by_zone". |
| int | zone_id | Required. The zone id to list your ads for. |
Response: {"success":1,"zones":[{"ad_id":89085,"name":"Campaign name","status_type_id":1,"creatives":[ ... ]}]}
Advertiser Create Fixed Ad
Create a fixed ad
We offer API access to create fixed ads via simple HTTP POST requests to our server, using JSON.
Ad info
| Type | Parameter | Description |
|---|---|---|
| string | target | Required. Specify the the type of target you are trying to reach. In this case "fixed_ad". |
| string | action | Required. Specify the the type of action you are trying to make. In this case "create". |
| int | zone_id | Required. Specify the zone id you are trying to add this ad to. |
| string | name | Required. The name of the zone you are trying to create. (Ex: "My new ad") |
| string | geo | Required. The geo you would like to target. (Ex: US, CA) |
| int | is_nsfw | Required. If the zone is Not Safe For Work. 1 true, 0 false. |
| int | weight | Required. The weight of the ad. |
| int | biddable | Required. If this fixed ad is biddable or not. 1 true, 0 false. |
| string | type | Required. The type of ad delivery. (Ex: Cpm) |
| string | carrier | Required. The carrier the ad wants to target. (Ex: Verizon) |
| json | creative | Required. For a fixed ad to show it needs a creative. See the paramters below. |
Landing page creative
| Type | Parameter | Description |
|---|---|---|
| string | type | Required. The type of creative it should create. It most correlate with the types from our platform. (Ex: "landing_page") |
| string | url | Required. The url it should redirect to. |
Stop a fixed ad
Stops a fixed ad you own. The ad must belong to your account; once stopped it no longer serves.
| Type | Parameter | Description |
|---|---|---|
| string | target | Required. In this case "fixed_ad". |
| string | action | Required. In this case "stop". |
| int | ad_id | Required. The id of the fixed ad you want to stop. |
Response: {"success":1,"ad_id":89085,"status":"Stopped"}

