About the Semantic Model API

The Semantic Model API provides access to semantic models that define the analytics data available for a Wix site. Each semantic model describes a specific analytics subject area (such as site traffic or revenue) and specifies the measures, dimensions, and parameters you can use to query it.

With the Semantic Model API, you can:

  • Retrieve a list of all semantic models available for a site.
  • Inspect a semantic model's schema to discover its available measures, dimensions, and parameters.
  • Query semantic model data with filters, sorting, and pagination to retrieve site analytics.

Before you begin

It's important to note the following points before starting to code:

  • Every query requires a time interval (interval). You can't query semantic model data without specifying a date range.
  • Field names used in queries must match the names returned by Get Semantic Model. Call Get Semantic Model first to discover available field names.
  • Some semantic model fields depend on other fields, listed in the field's dependencies property in the Get Semantic Model response. The field returns data only if at least one of its listed dependencies is also included in the query; otherwise it's silently omitted from results. For example, a measure might only return data when a specific dimension is also in the query.
  • A single query can return up to 1,000 rows. Use pagination to retrieve larger datasets.
  • By default, the API returns field values as raw typed values. Set formattingEnabled to true in your query to also receive a human-readable string for each value—for example, 1500 formatted as "$1,500.00".

Use cases

Terminology

  • Semantic model: A logical data structure that defines an analytics subject area (such as traffic or revenue) and the measures, dimensions, and parameters available for querying it.
  • Measure: A quantitative field available for aggregation. For example, total sessions, revenue, or order count.
  • Dimension: A categorical field used to group and filter data. For example, date, country, traffic source, or device type.
  • Parameter: An optional input that customizes query behavior. For example, date granularity.
Did this help?