Get Report Data For Period (V2)
  • 13 Jan 2023
  • 6 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Get Report Data For Period (V2)

  • Dark
    Light
  • PDF

/profiles/{Profile ID}/reports/{Report ID}/?period={Period} returns the report data for a given period.

Method: GET

URI: /profiles/{Profile ID}/reports/{Report ID}/?period={Period}

Note: Add any optional parameters to the end of the URI. If you change the order of URI or required parameters, or place optional parameters before them, the call will not work.

Example Request
https://myDomain.com/v2_0/ReportService/profiles/CxoSsHxKlF6/reports/42df19b6d9f2/?start_period=current_month&format=xml

Example Response

<?xml version="1.0" encoding="utf-8" ?> 
<DimensionalReport>
   <ReportDefinition name="definition">
     <decimal name="accountID">18079</decimal> 
     <string name="profileID">CxoSsHxKlF6</string> 
     <string name="ID">42df19b6d9f2</string> 
     <string name="name">Cities</string> 
     <boolean name="isRealtime">false</boolean> 
     <string name="type">dimensional</string> 
     <list name="properties">
        <boolean name="isHierarchy">false</boolean> 
        <boolean name="intervalsEnabled">false</boolean> 
        <boolean name="IsSearchable">true</boolean> 
        <string name="internalID">topcities</string> 
        <boolean name="IsRealTimeCompatible">true</boolean> 
        <null name="ProfileCategory" /> 
        <string name="totals">all</string> 
        <boolean name="ContainsRealtimeData">false</boolean> 
        <string name="LastUpdate">3/17/2009 0:10:08</string> 
        <string name="datasource">engine</string> 
        <string name="enginesearchtime">4031.25</string> 
     </list>
     <list name="measures">
        <Measure>
           <string name="name">Visits</string> 
           <string name="ID">Users-0</string> 
           <decimal name="columnID">0</decimal> 
           <boolean name="AllowTotals">true</boolean> 
           <boolean name="Sortable">false</boolean> 
        </Measure>
     </list>
   </ReportDefinition>
   <list name="data">
      <DataRow name="2009">
         <list name="measures">
         <float name="Visits">107538</float> 
   </list>
   <list name="SubRows">
      <DataRow name="Atlanta, Georgia, United States">
         <list name="measures">
            <float name="Visits">10600</float> 
         </list>
      </DataRow>
         <DataRow name="Sunnyvale, California, United States">    
            <list name="measures">
               <float name="Visits">10056</float> 
            </list>
         </DataRow>
         <DataRow name="Redmond, Washington, United States">
            <list name="measures">
               <float name="Visits">9466</float> 
            </list>
         </DataRow>
         <DataRow name="Portland, Oregon, United States">
            <list name="measures">
               <float name="Visits">7368</float> 
            </list>
         </DataRow>
         <DataRow name="Honolulu, Hawaii, United States">
            <list name="measures">
               <float name="Visits">1</float> 
            </list>
         </DataRow>
         <DataRow name="Everett, Washington, United States">
            <list name="measures">
               <float name="Visits">1</float> 
            </list>
         </DataRow>
         <DataRow name="Gonzales, Louisiana, United States">
            <list name="measures">
               <float name="Visits">1</float> 
            </list>
         </DataRow>
      </list>
      </DataRow>
    </list>
</DimensionalReport>

Parameters:

end period

Use the end_period parameter to specify the ending day of a date range. You must also supply the beginning day. end_period is an optional parameter. If end_period is not supplied, the data returned will only be from the time specified by start_period. Supplying only start_period is the same as supplying start_period and end_period with the same value.

end_period = ending day of date range

Example: specifying January 1, 2020 to January 30, 2020

start_period=2020m01d01&end_period=2020m01d30

Example: specifying the past 7 days (from yesterday)

start_period=current_day-7&end_period=current_day-1

Example: specifying hourly data for March 21, 2020

start_period=2020m03d20h00&end_period=2020m03d21h24

Example: specifying hourly data for yesterday

start_period=current_day-1

Note: Several time period macros are available: CURRENT_HOUR, CURRENT_DAY, CURRENT_DAY_MIDNIGHT, CURRENT_MONTH and CURRENT_YEAR. Instead of a specific start and end date, you can identify relative time periods.

For example, to get data for last month, specify start_period=current_month-1.

To get hourly real-time data from midnight of the current day, up to the current hour, use CURRENT_DAY_MIDNIGHT. For example:

https://ws.webtrends.com/v3/Reporting/profiles/20476/Keymetrics/
?start_period=current_day_midnight&end_period=current_hour
&language=en-US&suppress_error_codes=true&format=html&period_type=trend

format

format = return data format
Example: specifying data formats

Data format Parameter and value
JSON format=json
XML format=xml
XML2 ("XPath-friendly" XML for dynamic applications) format=xml2
HTML format=html (use this when importing data into Excel)
CSV format=csv (available for account-level and profile-level keymetrics)
RSS format=rss (use to specify an RSS 2.0 syndication feed)
ATOM format=atom (use to specify an ATOM 1.0 syndication feed)
For report data requests, all formats are supported. For "list" requests, only XML and JSON formats are supported.

language

Use the language parameter with a language ID, such as en or locale ID, such as en-GB to specify language and locale preferences for translating and formatting dates and numbers in report data. (See ISO 639-1 and ISO-3166 for codes.)

The languages available are those that appear in the Analytics user interface as preferences:

Language preference being selected in the Analytics user interface.
language = language code[-dialect designator]

Strictly speaking, language=en_GB is a locale identifier for English-language speakers in Great Britain. (A hyphen is used to designate a dialect of a language, so the dialect for a resident of Great Britain is en-GB). In practice, however, due to the widespread lack of understanding of this distinction, "-" and "_" are treated as equivalent.

period

Use the period parameter to specify the time span of interest and a trend length for report data. You can specify a relative time span or a specific time span.

Note: Before you can get data on specific hours or trend data, intervals must be turned on in the profile or custom report. To turn on intervals in the profile, edit the profile, then select: Analysis > Resource Control > "Include interval data in all custom reports for this profile". Trend data is not available for weekly or quarterly time spans.

period = time span * trend length

Example: getting data for a relative time span (current_hour, current_day, current_month, current_year)

Time span Parameter and value
Yesterday period=current_day-1
Two months ago period=current_month-2
Trending backward from February 28 period=2021m02d28*28
Rolling 7-days-to-date trend period=current_day-1*7
Year trend with holidays and annual cyclical data period=current_month-1*12

Example: getting data for a specific time span (year, quarter, month, week, day, hour)

Time span Parameter and value
2021 period=2021
First quarter of 2021 period=2021q01
January 2021 period=2021m01
January, February and March 2021 period=2021m03*3
23rd week of 2021 period=2021w23
January 1, 2021 period=2021m01d01
January 1, 2021 through January 6, 2021 period=2021m01d06*6
Noon on January 1, 2021 period=2021m01d01h12

range

Use the range parameter to specify the start and end rows of the range of rows to return. If you specify only end row, start row defaults to 1. If you do not use this parameter, all rows are returned.

Note: The range parameter cannot be used in drill-down reports, since they contain a hierarchy of ranges.

range = start row * end row

Example: specifying ranges

Range Parameter and value
First 100 rows range=100
Rows 101 to 200 range=101*200

search

Use the search parameter for reports to return only records containing the search string in their dimension value.

search = search string

Example: creating a report with only the rows whose dimension value contains "DVD": search=DVD

You can also use an advanced filtering string (for example, google.com+my.yahoo.com) from Analytics as a value, but operator characters in the string must be URL-encoded. See the URL Encoding Reference at: http://www.w3schools.com/TAGS/ref_urlencode.asp.

Example: using an advanced filtering string with the search parameter:

search=google.com%2Bmy.yahoo.com

start_period

Use the start_period parameter to specify the beginning day of a date range. end_period is an optional parameter. If end_period is not supplied, the data returned will only be from the time specified by start_period. Supplying only start_period is the same as supplying start_period and end_period with the same value.

start_period = first day of date range

Example: specifying January 1, 2020 to January 30, 2020

start_period=2020m01d01&end_period=2020m01d30

Example: specifying the past 7 days (from yesterday)

start_period=current_day-7&end_period=current_day-1

Note: Several time period macros are available: CURRENT_HOUR, CURRENT_DAY, CURRENT_DAY_MIDNIGHT, CURRENT_MONTH and CURRENT_YEAR. Instead of a specific start and end date, you can identify relative time periods.

For example, to get data for last month, specify start_period=current_month-1.

To get hourly real-time data from midnight of the current day, up to the current hour, use CURRENT_DAY_MIDNIGHT. For example:

https://ws.webtrends.com/v3/Reporting/profiles/20476/Keymetrics/
?start_period=current_day_midnight&end_period=current_hour
&language=en-US&suppress_error_codes=true&format=html&period_type=trend
Example: specifying hourly data for March 21, 2009

start_period=2009m03d20h00&end_period=2009m03d21h24

Example: specifying hourly data for yesterday

start_period=current_day-1

suppress error codes

Set the suppress_error_codes parameter to true if you do not want to be notified of error conditions for a request (the default is false).

suppress_error_codes = {true|false}
Example: Suppress errors for a request
suppress_error_codes=true

totals

The totals parameter specifies whether, or how, totals for measures are returned: all (default), only or none.

totals = {all | only | none}

Note: If you use the range or search parameter to return a subset of data, the totals returned are the subtotals for the entire period, rollup dimension, etc. For subsets of data, specify totals=none and use Excel to compute the totals.

What to return Parameter and value
No totals totals=none
All totals (the default) totals=all
Only totals totals=only

Was this article helpful?

What's Next