How does it work?

The Rest API is based on Rest URLs that are used to retrieve the data of your choice. In order to correctly extract the data you need, certain parameters must be entered. There are two different types of parameters possible, compulsory or optional:

 

Compulsory parameters

ParameterDescriptionExample
spaceAnalysis space (site, level 2, multi-sites)&space={s:123456}
periodAnalysis period (single, multiple, relative)&period={D:2016-12-25}
columnsList of dimensions/metrics to retrieve (separated by a comma in the call)&columns={d_page,m_visits}
 

Optional parameters

Parameter Value type Description Example
sort Character stringList of dimensions/metrics according to which the results will be sorted&sort={-m_visits}
filter Character stringFilters to be applied&filter={d_page:{$eq:’home’}}
page-num NumericPage number of the result set&page-num=2
max-results NumericNumber of results in the results page&max-results=500
sep « comma » or « dot »Decimal separator (dot by default)&sep=comma
lng Character stringLanguage of results&lng=fr
code Character stringShortcode of the Data Query template&code=2fHeCJ
segment IDSegment applied to the result set&segment=10000018
segmentdescDate (as per the “period“)To define the cohort period when using a visitor-based segment&segmentdesc={period:{D:2017-03-02}
include Character stringTo obtain complementary information (metadata, total, etc.)&include={context}
evo Character stringTo obtain the evolution of a group of metrics over a certain time period&evo={M,p1}
 

Example:

https://apirest.atinternet-solutions.com/data/v2/GetData?&period={D:2016-06-31}&space={s:123456}&columns={d_page,m_visits}&filter={d_page:{$eq:'home'}}&sort={m_visits}&page-num=2&max-results=10&sep=comma&lng=fr

Please refer to this note if you’re using SSO to login to AT Internet services.

This call will retrieve 10 results from page 2 (from the 11th to the 20th result) for the “Pages” dimension (d_page) with the “Visits” metric (m_visits) for site 123456 on 31 June 2016.

The results are filtered by page label (must be set to “home”) and sorted by increasing number of visits. They are presented in French and contain a comma as a decimal separator.

Last update: 27/12/2019