API Queries - Report

The report function gives you access to reports for your campaign folders. There are several optional parameters, for choosing date periods and grouping. If optional parameters are omitted, the default is today, grouped by keyword (equivalent to specifying: period=today, groupby=keyword).


Additional Parameters

  • groupby - Group by either keyword/category or date. Accepted values are "keyword" or "date". (Optional)
  • from_date & to_date - The report date range. Dates must be in the format YYYY-MM-DD. Note: Valid combinations are from_date and to_date parameters together, or period only. (Optional)
  • period - The report date period. Accepted values are "today", "yesterday", or a specified number of days or months such as "7 days" or "3 months". Note: Valid combinations are from_date and to_date parameters together, or period only. (Optional)

Note: Make sure to URL encode all values.


Example queries and responses:

  • In this example, we will show the default report: today, grouped by keyword/category (equivalent to specifying: period=today, groupby=keyword). As this is the default report view, we can omit the period and groupby parameters.

    Example query:

    https://bid.trellian.com/api.html?username=user&password=pass&api_key=key&mode=report

    Response:

    <results>
    <result Billed="55" Cost="17.60" Geo_Target="all" Keyword="Airfares" 
    Traffic_Type="all" Unbilled="215"/>
    <result Billed="25" Cost="6.50" Geo_Target="all" Keyword="Car Sales" 
    Traffic_Type="all" Unbilled="131"/>
    <result Billed="6" Cost="3.90" Geo_Target="all" Keyword="Cruises" 
    Traffic_Type="all" Unbilled="59"/>
    </results>


  • In this example, we will show a report for the last 7 days, grouped by date.

    Example query:

    https://bid.trellian.com/api.html?username=user&password=pass&api_key=key&mode=report&period=7%20days&groupby=date

    Response:

    <results> 
    <result Billed="1995" Cost="153.95" Date="2017-07-12" Unbilled="6873" /> 
    <result Billed="2712" Cost="196.90" Date="2017-07-13" Unbilled="8106" /> 
    <result Billed="2758" Cost="207.16" Date="2017-07-14" Unbilled="6065" /> 
    <result Billed="2560" Cost="196.02" Date="2017-07-15" Unbilled="5805" /> 
    <result Billed="2734" Cost="200.25" Date="2017-07-16" Unbilled="6104" /> 
    <result Billed="3040" Cost="213.60" Date="2017-07-17" Unbilled="7804" /> 
    <result Billed="1869" Cost="138.10" Date="2017-07-18" Unbilled="5589" /> 
    </results>
  • If there are no campaign folders in your account, the response will not be an error. Instead, this will be shown:

    </results>

Error Responses:

Possible error responses for this function are:

For a complete list of error responses, see the Error Codes manual page.