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
Parameter | Data Type | Required | Description |
---|---|---|---|
token | String | Yes | Token generated by the user |
group | String | Yes | Possible values:
|
start | Date | Yes | YYYYMMDD format |
end | Date | Yes | YYYYMMDD format |
id | String | Optional Mandatory when used URL is not user status. | The id parameter specifies:
|
async | Integer | optional | Set 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:
Code | For |
---|---|
401 | Invalid tokens |
400 | Parameters errors |
500 | Server errors |
Results
Common Fields
Each result contains the following data:
Parameters | Notes |
---|---|
requests | |
requests_country | Requests 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_selected | auctions |
no_bid | impressions |
vtrX | (X = 0, 25, 50, 75, 100) |
revenue | If you are using the Publisher API, this is the publisher revenue. If you are using the Marketplace API, this is the marketplace revenue. |
cost | This 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_cancelled | clicks |
bids_failed | |
bids_fail_parsing | |
bids_fail_currency | |
bids_timeout | |
bids_filtered_blockrule | |
bids_filtered_floor_price | |
bid_price_sum | Available only through the Publisher API |
bid_selected_price_sum | Available only through the Publisher API |
bid_price_sum_publisher | Available only through the Marketplace API |
bid_price_sum_advertiser | Available only through the Marketplace API |
bid_price_selected_sum_advertiser | Available only through the Marketplace API |
bids_filtered_duration | intext_inventory |
bid_price_selected_sum_publisher | Available only through the Marketplace API |
human_blocked | Array containing all Human blocking categories statistics |
Specific Fields
Group | Results Also Contain |
---|---|
day | date |
zone |
|
insertion-order |
|
buyer |
|
buyer-zone |
|
ad |
|
ad-zone |
|
advertiser-publisher |
|
hour-zone |
|
day-content-owner |
|
day-content-owner-buyer |
|
deal |
|
buyer-deal |
|
country-zone |
|
Asynchronous Request Validations/Error Messages
The following field codes are added to every response to help you track job progress.
Code | Description | Message |
---|---|---|
-2 | There is an unexpected error. | { message: "Unexpected error, please try again later!", code: -2, execTime: 0.15433692932128906, } |
-1 | Your query enqueue has failed. | { message: "Enqueue failed, please try again later.", code: -1, execTime: 0.15433692932128906, } |
0 | Your query has been enqueued successfully. | { message: "Your query has been enqueued successfully.", code: 0, execTime: 0.15433692932128906, } |
1 | Your query is still waiting. | { message: "Your query is still waiting", code: 1, execTime: 0.15010690689086914, } |
2 | Your query is running. | { message: "Your query is running", code: 2, execTime: 0.15010690689086914, } |
3 | Your query has failed. See the message field for more information. | { message: "Query took too much time to process", code: 3, execTime: 0.15010690689086914, } |
4 | Your 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, } |