Number of elements (GetRowCount)
Before or after previewing the extract of your results, it's possible to know the number of rows contained in your query by clicking on the refresh button "- Rows" just below the dataset. Once the number of rows has been updated, the icon will automatically be grayed out.
You may also obtain your query's REST URL which will allow you to know the number of rows (GetRowCount parameter) by clicking on the icon.
Structure formats
To get a preview of the structure of your results, click on the "Structure" button to the right of the URL. You can display the 3 available output formats: JSON, HTML or XML.
Tip
This is only a preview. To select your desired format, you'll need to select the format you want (using radio buttons) directly in the URL generation bar.Export possibilities - API endpoint
Data Query lets you export your data in several different formats, according to your needs. With the choice of format, you can use the API to import data into your tools, and/or to reprocess the obtained data.
Formats
To import your data into a third-party tool, you can export your data via API, in 3 different formats:
- HTML
- XML
- JSON
You can then import the desired data, in your chosen format, into numerous third-party tools. You may choose the output format using the bar right above the URL:
Whenever you edit your template, this URL is automatically updated. You can easily use the URL by clicking the "Copy URL" icon. Once the string is highlighted, you can simply copy and paste it wherever you need (into your browser, for example).
Tip
You can edit the format directly in your API call:
https://apirest.atinternet-solutions.com/data/v2/xml/getData?&space={s:XXXXX}&period={R:{D:'-1'}}&max-results=20&page-num=1
Limits
Number of API calls
Calls to the REST API can be done in an unlimited manner; there are no limits in terms of quantity of calls during a given period. However, the number of simultaneous calls is limited per user, in order to guarantee consistent service levels.
Each user of the interface has a series of timeslots attributed to him/her during which he/she may call the API. A timeslot is occupied during the time that AT Internet processes the API call, and sends the data back to the user.
When a user users 5 timeslots simultaneously and tries to make a 6th call, he or she will receive the following error message: "Authorised frequency of calls exceeded" (Code 5001). The user will have to wait for one of the timeslots to open in order to be able to call AT Internet's API again.
Number of results rows per API call
You can extract up to 10,000 rows per API call (JSON and XML formats). To extract your analysis' entire dataset, you must use the pagination feature, which will allow you to extract data in batches of 10,000 rows at a time.
Shortcodes
Shortcode is a URL that is short and unique; any edits made to your template(s) will automatically be applied to the associated shortcode. It is therefore highly recommended to use the shortcode feature if you wish to integrate data via our API into third-party tools, or if you've built Excel tables with IQY. In doing so, you'll be able to publish your template and edit it, without having to change the URLs that you've automated with your technical team.
Tip
To obtain the shortcode, you must first save your template. It is also possible to overwrite the shortcode if necessary; you'll find more information on this topic in the "API" section.Mandatory and optional parameters
To retrieve data from your analysis that's currently being built, you must first have automatically set up:
- The site(s) on which your analysis is based
- At least 1 metric in your analysis
- At least 1 period in your analysis
If you don't modify the configuration, by default you'll have:
- The number of rows in your analysis limited to 20
- The format of your API call in JSON
- The date set to yesterday
> You can view all mandatory and optional parameters of the API in the API section.
Export possibilities - Export pop-up
If you wish to retrieve your data (in an Excel file, for example), you can export your results and your templates by clicking the "Export" button.
Two formats are available: CSV and IQY.
You can then give your file a name, and choose the decimal separator you prefer (period or comma).
CSV
The CSV format is a standard format for exchanging data.
By default, the file name is the same as the template name. If you have not saved your template, the default name is mycsv. Before exporting a file, you'll need to indicate which decimal separator you prefer, as well as the number of elements to be returned.
IQY
The IQY format is a format specific to Microsoft. It enables you to create interconnections between our API and Excel. Use it to build dynamic dashboards, for which you can update data directly from Excel, with no technical manœuvres needed.
Before exporting a file, you'll need to indicate which decimal separator you prefer, as well as the number of elements to be returned. You must also specify the parameters you wish to make dynamic. By making parameters dynamic, you'll be able to edit the value directly in your Excel file.
Tip
You may also make other parameters of your IQY dynamic, by opening your IQY using your code editor. You will need to replace the value of the parameter with '["Text","Text to display in the Excel pop-in"]'.For example with this IQY, the period to select must be made dynamic:
https://apirest.atinternet-solutions.com/v2/html/getData?&columns={d_time_date,m_visits}&sort={-m_visits}&space={s:XXXXXX}&period={D:{start:'["Start","Please enter a start date in the format YYYY-MM-DD"]',end:'["End","Please enter an end date in the format YYYY-MM-DD"]'}}&page-num=1&sep=comma&max-results=20
Please note that iqy connectors are no longer supported by Microsoft and may not work as smoothly as expected in some cases.
Configuration
To export your data according to the desired format, you will need to:
- Fill in the template's default period (this can be made dynamic using the IQY)
- Fill in at least one dimension and one metric
By default, there are 20 answers per page. You can set this to up to 1,000 rows in the interface, and 100,000 rows for a CSV. The page element lets you indicate the elements you wish to obtain. For example, for a call that sends back 60 rows, as there are only 20 rows per page, you'll find rows 21 to 40 when you select page 2.