curl --request GET \
--url https://api.tic.io/datasets/companies/{companyId}/financial-reports \
--header 'x-api-key: <api-key>'
{
"incomeStatement": [
{
"row": 123,
"column": 123,
"order": 123,
"localizedFieldName": "<string>",
"enFieldName": "<string>",
"displayFormat": "<string>",
"type": "<string>",
"value": "<any>",
"notes": "<string>",
"highlight": "green"
}
],
"balanceSheets": [
{
"row": 123,
"column": 123,
"order": 123,
"localizedFieldName": "<string>",
"enFieldName": "<string>",
"displayFormat": "<string>",
"type": "<string>",
"value": "<any>",
"notes": "<string>",
"highlight": "green"
}
],
"footnotes": [
{
"row": 123,
"column": 123,
"order": 123,
"localizedFieldName": "<string>",
"enFieldName": "<string>",
"displayFormat": "<string>",
"type": "<string>",
"value": "<any>",
"notes": "<string>",
"highlight": "green"
}
],
"keyMetrics": [
{
"row": 123,
"column": 123,
"order": 123,
"localizedFieldName": "<string>",
"enFieldName": "<string>",
"displayFormat": "<string>",
"type": "<string>",
"value": "<any>",
"notes": "<string>",
"highlight": "green"
}
],
"additionalInformation": [
{
"row": 123,
"column": 123,
"order": 123,
"localizedFieldName": "<string>",
"enFieldName": "<string>",
"displayFormat": "<string>",
"type": "<string>",
"value": "<any>",
"notes": "<string>",
"highlight": "green"
}
]
}
Retrieves all or specific financial report for period in a table format suited for simple visualization. If no language code is specificed Swedish is assumed.
curl --request GET \
--url https://api.tic.io/datasets/companies/{companyId}/financial-reports \
--header 'x-api-key: <api-key>'
{
"incomeStatement": [
{
"row": 123,
"column": 123,
"order": 123,
"localizedFieldName": "<string>",
"enFieldName": "<string>",
"displayFormat": "<string>",
"type": "<string>",
"value": "<any>",
"notes": "<string>",
"highlight": "green"
}
],
"balanceSheets": [
{
"row": 123,
"column": 123,
"order": 123,
"localizedFieldName": "<string>",
"enFieldName": "<string>",
"displayFormat": "<string>",
"type": "<string>",
"value": "<any>",
"notes": "<string>",
"highlight": "green"
}
],
"footnotes": [
{
"row": 123,
"column": 123,
"order": 123,
"localizedFieldName": "<string>",
"enFieldName": "<string>",
"displayFormat": "<string>",
"type": "<string>",
"value": "<any>",
"notes": "<string>",
"highlight": "green"
}
],
"keyMetrics": [
{
"row": 123,
"column": 123,
"order": 123,
"localizedFieldName": "<string>",
"enFieldName": "<string>",
"displayFormat": "<string>",
"type": "<string>",
"value": "<any>",
"notes": "<string>",
"highlight": "green"
}
],
"additionalInformation": [
{
"row": 123,
"column": 123,
"order": 123,
"localizedFieldName": "<string>",
"enFieldName": "<string>",
"displayFormat": "<string>",
"type": "<string>",
"value": "<any>",
"notes": "<string>",
"highlight": "green"
}
]
}
<html>
<head>
<script
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/handsontable/dist/handsontable.full.min.js"
></script>
<script
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/lodash/lodash.min.js"
></script>
</head>
<body>
<div id="grid" style="width: 100vw; height: 100vh"></div>
<script type="text/javascript" src="index.js"
</body>
</html>
const sourceData = "add your response here from the API";
const rows = _(sourceData).map('row').uniq().value();
const columns = _(sourceData).map('column').uniq().value();
const tableData = [];
_.forEach(rows, (row) => {
let rowData = [];
let first = _.find(
sourceData,
(item) => item.column == columns[0] && item.row == row
);
rowData.push(first.localizedFieldName);
_.forEach(columns, (column) => {
let match = _.find(
sourceData,
(item) => item.column == column && item.row == row
);
rowData.push(match.value);
});
tableData.push(rowData);
});
document.addEventListener('DOMContentLoaded', () => {
const grid = document.getElementById("grid");
// Helps styling the cells with the cellProperties
function customRenderer(hotInstance, td, row, column, prop, value, cellProperties) {
Handsontable.renderers.BaseRenderer.apply(this, arguments);
if (cellProperties.customData == 'undefined') {
console.log(
'Wierd emtpy custom data in row ' + row + ' and column ' + column
);
}
switch (cellProperties.customData?.type) {
case 'Int':
if (value != null)
return (td.innerHTML = value.toLocaleString('sv-SE', {
maximumFractionDigits: 0,
}));
break;
case 'String':
break;
case 'Decimal':
if (value != null)
return (td.innerHTML = value.toLocaleString('sv-SE', {
style: 'decimal', // style: 'percent'
minimumFractionDigits: 1,
maximumFractionDigits: 1,
}));
break;
case 'DateTime':
return (td.innerHTML = new Date(value).toLocaleDateString());
break;
case 'Percentage':
if (value != null)
return (td.innerHTML = (value * 0.01).toLocaleString('sv-SE', {
style: 'percent',
minimumFractionDigits: 1,
maximumFractionDigits: 1,
}));
break;
default:
break;
}
return (td.innerHTML = value);
}
const hotInstance = new Handsontable(grid, {
data: tableData,
licenseKey: 'non-commercial-and-evaluation',
rowHeaders: false,
colHeaders: false,
fixedColumnsStart: 1,
fixedRowsTop: 1,
manualColumnResize: true,
wordWrap: true,
autoColumnSize: true,
autoWrapRow: true,
autoWrapCol: true,
readOnly: true,
comments: true,
height: 'auto',
contextMenu: ['copy'],
className: 'htRight',
fillHandle: false,
stretchH: 'all',
cells(row, col) {
const cellProperties = {};
cellProperties.className = 'htLeft';
let match = _.find(
sourceData,
(item) => item.column == col - 1 && item.row == row
);
if (match?.notes != null) {
cellProperties.comment = {
value: match.notes,
readOnly: true,
style: { width: 200, height: 50 },
};
}
cellProperties.customData = match;
if (col == 0 || row == 0)
cellProperties.className = 'htRight font-bold';
if (col > 0 && row > 0)
cellProperties.renderer = customRenderer;
return cellProperties;
},
});
});
The company id
The language code of the annual report
Supply if you want to receive only a specific period as entered as YYYYMM
OK
The response is of type object
.