STATS API

For general information, see SFX APIs: Using JSON.

📘

Async Feature

You can run asynchronous requests to extract data and avoid exceeding the 80-second limit and receiving error messages.

Parameters

ParameterData TypeRequiredDescription
tokenStringYesToken generated by the user
groupStringYesPossible values:
  • day
  • zone
  • insertion-order
  • buyer
  • buyer-zone
  • ad
  • advertiser-publisher
  • hour-zone
  • day-content-owner
  • day-content-owner-buyer
  • deal
  • buyer-deal
  • country-zone
startDateYesYYYYMMDD format
endDateYesYYYYMMDD format
idStringOptional

Mandatory when used URL is not user status.
The id parameter specifies:
    Publisher identifier using /api/stats/publisherMarketplace identifier using /api/stats/market-place
asyncIntegeroptionalSet to 1 to extract data asynchronously. With this feature, you can avoid exceeding the 80-second limit for synchronous requests and not receive timeout error messages.

Sample Request

Here is a sample URL constructed using the parameters above:

https://sfx.freewheel.tv/api/stats/publisher?token=148948978644a48d88fg78g6&group=day&start=20130725&end=20130730&id=1731

Response

The response is a JSON object with:

  • Results (the resultset)
  • Count (number of results in resultset)
  • ExecTime (execution time of the request in seconds)
  • Parameters (parameters received from client)

If an error occurs, the corresponding http codes will be returned:

CodeFor
401Invalid tokens
400Parameters errors
500Server errors

Results

Common Fields

Each result contains the following data:

ParametersNotes
requests
requests_countryRequests from the local country
bids_filtered_deal_id
bids_done
bids_lost(auctions - (no_bid + all bids_filtered + all bids_fail(ed) + bids_cancelled + bids_timeout))
bids_selectedauctions
no_bidimpressions
vtrX(X = 0, 25, 50, 75, 100)
revenueIf you are using the Publisher API, this is the publisher revenue.

If you are using the Marketplace API, this is the marketplace revenue.
costThis is available only from the Marketplace API.

This is what the Marketplace pays to the publisher and can therefore be considered the publisher revenue.
bids_cancelledclicks
bids_failed
bids_fail_parsing
bids_fail_currency
bids_timeout
bids_filtered_blockrule
bids_filtered_floor_price
bid_price_sumAvailable only through the Publisher API
bid_selected_price_sumAvailable only through the Publisher API
bid_price_sum_publisherAvailable only through the Marketplace API
bid_price_sum_advertiserAvailable only through the Marketplace API
bid_price_selected_sum_advertiserAvailable only through the Marketplace API
bids_filtered_durationintext_inventory
bid_price_selected_sum_publisherAvailable only through the Marketplace API
human_blockedArray containing all Human blocking categories statistics

Specific Fields

GroupResults Also Contain
daydate
zone
  • zone_id
  • zone_name
  • site_id
  • site_name
  • publisher_id
  • publisher_name
insertion-order
  • buyer_id
  • buyer_name
  • insertion_order_id
  • insertion_order_name
buyer
  • buyer_id
  • buyer_name

  • dsp_id
  • dsp_name
  • trading_desk_id
  • trading_desk_name
buyer-zone
  • buyer_id
  • buyer_name
  • zone_id
  • zone_name
  • site_id

  • site_name
  • publisher_id
  • publisher_name
ad
  • ad_id
  • ad_name
  • buyer_id
  • campaign_id
  • campaign_name
  • advertiser_id
  • advertiser_name
  • dsp_id
  • dsp_name
  • trading_desk_id
  • trading_desk_name
  • buyer_name
  • insertion_order_id
  • insertion_order_name
  • io_number (contains IO internal reference, if not set, property is not sent)
ad-zone
  • insertion_order_id
  • insertion_order_name
advertiser-publisher
  • advertiser_id
  • advertiser_name
  • publisher_id
  • publisher_name
hour-zone
  • hour
  • zone_id
  • zone_name
  • site_id
  • site_name
  • publisher_id
  • publisher_name
day-content-owner
  • date
  • content_owner_id
  • content_owner_name
day-content-owner-buyer
  • date
  • content_owner_id
  • content_owner_name
  • buyer
deal
  • deal_id (public id)
  • deal_name
  • deal_priority (First look, Same as buyer, Buyer group number, Remnant)
  • offered (replaces auctions from the common fields)
buyer-deal
  • buyer_id
  • buyer_name
  • dsp_id
  • dsp_name
  • trading_desk_id</li
  • trading_desk_name
  • deal_id (public id)
  • deal_name
  • deal_priority (First look, Same as buyer, Buyer group number, Remnant)
  • offered (replaces auctions from the common fields)
country-zone
  • country-id
  • country-name

Asynchronous Request Validations/Error Messages

The following field codes are added to every response to help you track job progress.

CodeDescriptionMessage
-2There is an unexpected error.{
message: "Unexpected error, please try again later!",
code: -2,
execTime: 0.15433692932128906,
}
-1Your query enqueue has failed.{
message: "Enqueue failed, please try again later.",
code: -1,
execTime: 0.15433692932128906,
}
0Your query has been enqueued successfully.{
message: "Your query has been enqueued successfully.",
code: 0,
execTime: 0.15433692932128906,
}
1Your query is still waiting.{
message: "Your query is still waiting",
code: 1,
execTime: 0.15010690689086914,
}
2Your query is running.{
message: "Your query is running",
code: 2,
execTime: 0.15010690689086914,
}
3Your query has failed. See the message field for more information.{
message: "Query took too much time to process",
code: 3,
execTime: 0.15010690689086914,
}
4Your query has completed. Your data is the value for the results key.{
code: 4,
results: [ {impression:234},{impression:2434}],
count: 2,
parameters: {start: "20200302",
end: "20200302",
group: "zone",
},
execTime: 0.16909384727478027,
}