Fixed periods

 

Request a fixed period

To request a fixed period, there are start and end attributes. Nonetheless, syntax shortcuts allow you to directly obtain calendar periods.

It is also possible to apply filters directly within a period in order to obtain, for example, all Mondays, the 1st day of every month, all 8:00am time slots, etc.

NotationDescription
&period={Y:'2018'}Year 2018
&period={S:'2018-01'}1st semester of 2018
&period={D:{start:'2018-01-01',end:'2018-06-30'}}1st semester of 2018
&period={Q:'2018-02'}2nd quarter of 2018
&period={M:'2018-02'}February 2018
&period={W:'2018-02'}2nd week of 2018 (from the 7th of January to the 13th)
&period={D:{start:'2018-01-07',end:'2018-01-13'}}2nd week of 2018 (from the 7th of January to the 13th)
&period={D:'2018-02-21'}21st of February 2018
&period={H:'2018-02-21T08'}Visits that started during the 8th hour of the 21th February 2018 (from 8am to 8:59:59am)
Find out more about this parameter.
&period={MN:{start:'2018-02-21T08:00',end:'2018-02-21T08:29'}}Visits that started between 8am and 8:29:59am on the 21st February 2018
Find out more about this parameter.
&period={He:'2018-02-21T08'}All the events that happened during the 8th hour of the 21st February 2018 (from 8am to 8:59:59am)
Find out more about this parameter.
&period={MNe:{start:'2018-02-21T08:00',end:'2018-02-21T08:29'}}All the events that happened between 8am and 8:29:59am on the 21st February 2018
Find out more about this parameter.
&period={MNe:{start:'2018-06-16T08:00',end:'2018-06-16T12:30'},MNe:{start:'2018-06-16T14:00',end:'2018-06-16T18:30'}}All the events from 8am to 12.30pm and 2pm to 6.30pm on the 16th of June 2018
&period={D:'2018-02-21',W:'2018-02'}21st of February 2018 and the second week of 2018
&period={D:{start:'2018-01-01',end:'2018-06-30'},filter:{DW:1}}All Mondays (DW:1) in the first 6 months of 2018
&period={D:{start:'2018-01-01',end:'2018-06-30'},filter:{DM:1}}All 1st days of the month (DM:1) in the first 6 months of 2018
&period={D:{start:'2018-01-01',end:'2018-06-30'},filter:{DM:{1,15}}}All the first 15th days of the month (DM:1,15) in the first 6 months of 2018

These fixed periods must be fully completed in order to return results. For example, if we are in the middle of December 2018, requesting the year 2018 won’t work.

 

Request several fixed periods

The syntax is the same as it is for single periods. Each period must simply be named according to the pn syntax, and the periods must be separated with commas.

Example:

&period={p1:{D:2018-05-03},p2:{D:2018-05-05},p3:{D:2018-05-09}}

Here, 3 periods are declared. They correspond to the 3rd, 5th, and 9th of May 2018.

  • The multi-period mode is limited to 3 periods maximum.
  • The period defined as p1 will be the reference point for the 2 other requested periods.
  • Only filters and sorting applied to the metrics from this reference period will be authorized.
  • The dataset for API calls drawing on multiple periods will not exceed 100 rows of results for performance reasons.
  • It is also possible to compare 2 hour-based time frames: e.g.
https://apirest.atinternet-solutions.com/data/v2/html/getData?&columns={d_source,p1.m_visits,p2.m_visits,dif:{m_visits,p1,p2}}&sort={-p1.m_visits}&space={s:xxxxx}&period={p1:{H:{start:'2018-10-26T01',end:'2018-10-26T04'}},p2:{H:{start:'2018-10-11T01',end:'2018-10-11T04'}}}
Please refer to this note if you’re using SSO to login to AT Internet services.
  • This compares the 26th of October 2018, between 1am and 4.59am, versus the 11th of October 2018, between 1am and 4.59am (it also works with “MN” instead of “H”.
  • Finally, multi-periods requested from the API should either be for the current day (real-time data) or for the previous day(s). It is not possible to combine, in the same API call, periods from the current day with periods prior to the current day.
Last update: 20/01/2020