FLAT format for Batch Reporting (API)
New flat format for Batch Reporting exports
Eulerian is introducing a flattened response format, designed to make API data simpler to use for data, BI and marketing teams. With this format, the response comes back as a table: explicitly described columns, followed by rows of values you can use directly in an ETL, a dashboard, a notebook, a data warehouse or a CSV export.
1. Why the change?
Until now, some Reporting API responses were structured as nested analytics blocks. This format, modelled on the Google Analytics API, keeps them compatible with existing tools:
- dimensions kept separate from metrics;
- values wrapped in several JSON levels;
- client-side parsing logic you have to rebuild;
- a mapping between columns and values that is sometimes hard to read.
The new flat format has one simple aim: to make Eulerian data easier to read, transform, load and maintain in your existing data tools.
2. How do you enable the flat format?
The flat format is used through the Batch Reporting endpoint:
Add the following parameter to the request body:
{"output": {"type": "flat"}}
For example:
{
"output": {
"type": "flat"
},
"reports": [
{
"dateRanges": [
{
"range": "YESTERDAY"
}
],
"dimensions": [
{
"field": "website_name",
"name": "website_name"
},
{
"name" : "Date",
"field": "date_day"
}
],
"kind": "rt#website",
"metrics": [
{
"field": "visit",
"name": "Sessions (visits)"
},
{
"field": "realscartvalid",
"name": "Sales (transactions)"
},
{
"field": "realscartvalidamount",
"name": "Revenue"
}
]
}
]
}
Once this mode is enabled, the API response comes back in tabular form.
3. What flat mode changes
Before: a nested structure
In the old format, a value could sit deep inside a structure, for example:
{
"data": [
{
"columnHeader": {
"dimensions": [{ "field": "ope_name", "name": "campaign" }],
"metrics": [
{ "field": "click", "name": "inbound clicks", "affinity": "int" }
]
},
"data": [
{ "dimensions": ["Google"], "metrics": [[{ "values": ["29222"] }]] }
]
}
]
}
This format is still complete, but you need specific logic to rebuild a usable table from it.
After: a tabular response
With the flat format, the response is organised around two main blocks:
- columnHeader: describes the available columns;
- data: holds the rows of values, in the same order as columnHeader.
Simplified example:
{
"content": {
"columnHeader": [
{
"field": "date_day",
"type": "dimension",
"name": "Date",
"dataType": "date"
},
{
"field": "website_name",
"type": "dimension",
"name": "website_name",
"dataType": "string"
},
{
"field": "media_key",
"type": "dimension",
"name": "media_key",
"dataType": "string"
},
{ "field": "hit", "type": "metric", "name": "hit", "dataType": "int" },
{ "field": "visit", "type": "metric", "name": "visit", "dataType": "int" }
],
"data": [
["2026-04-21", "demo-fr", "PARTNER", 3, 1],
["2026-04-21", "demo-fr", "PARTNER", 0, 0]
],
"rowCount": 2,
"totalRowCount": 2
},
"error": 0
}
4. Reading the response
The principle is deliberately simple:
| Item | Role |
|---|---|
| columnHeader | Ordered list of the columns returned |
| field | Technical identifier of the column |
| name | Human-readable name of the column |
| type | Whether it is a dimension or a metric |
| dataType | Expected data type: date, string, int, float and so on |
| data | List of result rows |
| rowCount | Number of rows returned in the response |
| totalRowCount | Total number of rows available for the request |
Each row in data is an array.
Read each value according to the position of the matching column in columnHeader.
5. Date dimensions in flat mode
flat mode also lets you request date dimensions of the date_XXX type.
For example, depending on the granularity you need, you can use dimensions such as:
date_daydate_hourdate_weekdate_year
The list of dimensions is available through the Dimensions (opens in a new window) API
This makes common reporting uses easier:
- analysis by day;
- analysis by hour;
- feeding time-based dashboards;
- aggregation in a data warehouse;
- CSV export or BI table with explicit date columns.
7. Client-side integration example
The integration logic is to:
- read columnHeader;
- get the field values;
- go through each row of data;
- rebuild a key-value object.
JavaScript example:
const payload = await response.json();
const columns = payload.content.columnHeader;
const fields = columns.map((column) => column.field);
const rows = payload.content.data.map((line) => {
return Object.fromEntries(fields.map((field, index) => [field, line[index]]));
});
console.log(rows[0]);
Expected result:
{
"date_hour": "2026-04-21T00",
"website_name": "demo-fr",
"media_key": "PARTNER",
"hit": 3,
"visit": 1
}
9. Integration best practice
Do
- Use
fieldas the technical identifier in your code. - Use
nameas the display label if you need one. - Always read the column order from
columnHeader. - Do not hard-code column indexes.
- Use
dataTypeto type the values before storing them or calculating with them. - Compare
rowCountandtotalRowCountto check the volumes returned.
Avoid
- Assuming the column order will always stay the same.
- Parsing the values without reading
columnHeader. - Mixing display logic and technical logic.
- Ignoring the
datedimensions available inflatmode.