v1

latestOpenAPI 3.1.02026-07-2419603.1 MB
Analytics

Fetch Real-time events

API that allows fetching raw Real-time events from the database. Real-time data is retained for only an hour and may be available with a slight delay (up to a couple of minutes), so we highly recommend getting the data older than 3 minutes (and newer than 60).

This API is not suitable for feeding external data warehouses as it is not a reliable source of complete data - for that purpose we recommend regular Raw data API or Exports.

Please note that each request must be authenticated.

post/api/analytics/v1/real-time-events/

Request body

website_idstring uuid required

ID of a website.

date_fromstring datetime required

Start datetime for the query (inclusive, in website's timezone).

date_tostring datetime required

End datetime for the query (exclusive, in website's timezone).

offsetinteger

Number of rows to skip before beginning to return rows.

limitinteger

Number of rows to return.

format'json' | 'json-kv' | 'csv'

Data format of a successful response (error responses are always in json).

column_format'id' | 'name'

Format of the columns header (in CSV responses) and metadata labels (in JSON responses). By default uses identifiers (id option), set to name to use human-readable names.

Example request

{
  "website_id": "70236925-724f-404e-b634-7b5633bc0bcc",
  "columns": [
    {
      "column_id": "resolution"
    },
    {
      "column_id": "device_type"
    }
  ],
  "date_from": "2024-02-10 12:23:00",
  "date_to": "2024-02-10 12:58:00",
  "filters": {
    "operator": "and",
    "conditions": [
      {
        "column_id": "browser_name",
        "condition": {
          "operator": "eq",
          "value": "FF"
        }
      }
    ]
  },
  "offset": 0,
  "limit": 100,
  "format": "json"
}

Response

OK

dataobject[]

Rows with results for the query.

Example response

{
  "data": [
    [
      "2018-12-03T00:21:03",
      "375x667",
      [
        1,
        "Smartphone"
      ]
    ]
  ],
  "meta": {
    "columns": [
      "timestamp",
      "resolution",
      "device_type"
    ],
    "scope": "Real-time event",
    "blended_datasets": [],
    "count": 1
  }
}