Get Estate Statistics

Resource type: estateStatistics

With this API call, external applications (such as owner portals or third-party reporting tools) can retrieve calculated statistics for a specific property as structured JSON data.

The API call uses the exact same underlying logic and widget configuration as the property statistics view inside onOffice enterprise (Properties > Statistics tab) and the _objektstatistik macro. This ensures that key metrics – such as inquiries, viewings, exposé requests, and sent exposés – remain 100% consistent across onOffice enterprise and external portals without requiring external calculation logic.

Prerequisites & Rights

To execute this API call successfully, the API user must satisfy the following permission checks:

  • Property-level access: Visibility right for the property’s statistics tab (AccessControlShowStatisticTabInEstate).
  • Module-level access: Module permission for reporting (MODULE_REPORTING_TAB).

If these permission requirements are not met, the request will be rejected with SMARTAPI_ERR_ACCESS_VIOLATION.

Parameters

  • estateID  INTEGER. MANDATORY. The unique internal ID of the main property (> 0). Sub-estate or multi-language IDs are automatically normalized to the main property ID.

Request Example

{
"actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:get",
"resourcetype": "estateStatistics",
"parameters": {
"estateId": 1261
}
}

Response Parameters

The data element of a successful response contains the following fields:

  • widgetId INTEGER. MANDATORY. Technical ID of the statistics widget.
  • widgetType STRING. MANDATORY. Technical identifier of the widget type.
  • title STRING. MANDATORY. Display title of the statistics section.
  • groupByLabel STRING. MANDATORY. Header label for the category or grouping column.
  • targetLabel STRING. MANDATORY. Header label for the value or target metric column.
  • showSumRow BOOLEAN. MANDATORY. true if a summary/total row is configured for this widget, otherwise false.
  • rows ARRAY. MANDATORY. List of statistic data rows.
  • sum OBJECT. OPTIONAL. Present if showSumRow is true. Contains label (STRING) and value (MIXED).

Structure of items inside rows:

  • label STRING. MANDATORY. Descriptive text or channel name (e.g. Portal name, activity type).
  • value MIXED. MANDATORY: Numeric or formatted statistic value (formatted according to enterprise locale settings).

Response Examples

Example 1: Standard Key Figure Statistics (e.g. Inquiries / Portal requests / Activities)
{
  "status": {
    "code": 200,
    "errorcode": 0,
    "message": "OK"
  },
  "response": {
    "results": [
      {
        "actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:get",
        "resourceid": "undefined",
        "resourcetype": "estateStatistics",
        "cacheable": false,
        "identifier": "undefined",
        "data": {
          "meta": {
            "cntabsolute": 3
          },
          "records": [
            {
              "id": 81,
              "type": "estateStatistics",
              "elements": {
                "estateId": 1261,
                "widgetId": 81,
                "widgetType": "statisticDetailReportingActivities",
                "title": "Portalanfragen",
                "groupByLabel": "Herkunft/Kontakt der Aktivität",
                "targetLabel": "Anzahl Aktivitäten",
                "showSumRow": false,
                "rows": [
                  {
                    "label": "TEST AFM",
                    "value": "52"
                  }
                ]
              }
            },
            {
              "id": 83,
              "type": "estateStatistics",
              "elements": {
                "estateId": 1261,
                "widgetId": 83,
                "widgetType": "statisticDetailReportingActivities",
                "title": "Übersicht Aktivitäten",
                "groupByLabel": "Aktionsart",
                "targetLabel": "Anzahl Aktivitäten",
                "showSumRow": true,
                "rows": [
                  {
                    "label": "AGB bestätigt",
                    "value": "2"
                  },
                  {
                    "label": "Beleg",
                    "value": "2"
                  },
                  {
                    "label": "Bestätigung",
                    "value": "12"
                  },
                  {
                    "label": "Download",
                    "value": "2"
                  },
                  {
                    "label": "Email",
                    "value": "141"
                  },
                  {
                    "label": "Immofeedback / Terminnachbereitung",
                    "value": "1"
                  },
                  {
                    "label": "Meine eigene wichtige Aktionsart",
                    "value": "2"
                  },
                  {
                    "label": "PDF",
                    "value": "27"
                  },
                  {
                    "label": "Preisänderung",
                    "value": "5"
                  },
                  {
                    "label": "Sonstige",
                    "value": "2"
                  },
                  {
                    "label": "Statusänderung",
                    "value": "4"
                  },
                  {
                    "label": "Telefonat",
                    "value": "1"
                  },
                  {
                    "label": "Termin",
                    "value": "10"
                  },
                  {
                    "label": "Web-Exposé aufgerufen",
                    "value": "1"
                  },
                  {
                    "label": "Widerruf bestätigt",
                    "value": "4"
                  }
                ],
                "sumLabel": "Summe",
                "sumValue": "216"
              }
            },
            {
              "id": 281,
              "type": "estateStatistics",
              "elements": {
                "estateId": 1261,
                "widgetId": 281,
                "widgetType": "statisticDetailReportingActivities",
                "title": "Absagegründe",
                "groupByLabel": "Absagegrund",
                "targetLabel": "Anzahl verknüpfte Adressen",
                "showSumRow": true,
                "rows": [
                  {
                    "label": "Lage",
                    "value": "1"
                  },
                  {
                    "label": "Preis",
                    "value": "2"
                  }
                ],
                "sumLabel": "Summe",
                "sumValue": "3"
              }
            }
          ]
        },
        "status": {
          "errorcode": 0,
          "message": "OK"
        }
      }
    ]
  }
}
Example 2: Property Exists but No Active Statistics / Data Available

If the estate exists and the user is authorized, but no statistic widgets are configured or yield data for this property, a successful response with an empty statistics list is returned:

{
  {
"status": {
"code": 200,
"errorcode": 0,
"message": "OK"
},
"response": {
"results": [
{
"actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:get",
"resourceid": "undefined",
"resourcetype": "estateStatistics",
"cacheable": false,
"identifier": "undefined",
"data": {
"meta": {
"cntabsolute": 0
},
"records": []
},
"status": {
"errorcode": 0,
"message": "OK"
}
}
]
}
}