> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # ListSemanticModels # Package: analytics # Namespace: SemanticModelsService # Method link: https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/list-semantic-models.md ## Permission Scopes: Site Analytics - read permissions: SCOPE.DC-ANALYTICS-AND-REPORTS.READ-SITE-ANALYTICS ## Introduction Retrieves a list of all available semantic models. --- ## REST API ### Schema ``` Method: listSemanticModels Description: Retrieves a list of all available semantic models. URL: https://www.wixapis.com/analytics/semantic-model/v3/semantic-models Method: GET Return type: ListSemanticModelsResponse - name: semanticModels | type: array | description: Available semantic models. | validation: maxItems 100 - name: id | type: string | description: Semantic model GUID. | validation: format GUID - name: slug | type: string | description: URL-friendly identifier for the semantic model. | validation: maxLength 5120 - name: measures | type: array | description: Quantitative fields available for aggregation, such as revenue, page views, or order count. | validation: maxItems 1000 - name: name | type: string | description: Field name. Use this value in the `fields` array of a query request to retrieve this field's data. | validation: maxLength 5120 - name: type | type: FieldTypeEnum | description: Data type of the field. - enum: - UNKNOWN: Unknown field type. - STRING: String. - NUMBER: Number. - BOOLEAN: Boolean. - DATE: Date without time. - DATE_TIME: Date and time. - OBJECT: Structured object with key-value pairs. - ARRAY: Array of values. - name: filters | type: FieldFilters | description: Supported filter operations for this field. - name: prefixes | type: array | description: Supported prefix modifiers for this field. | validation: maxItems 100 - enum: - IS: Positive match. For example, `IS` + `EQUAL` means "is equal to". - NOT: Negated match. For example, `NOT` + `EQUAL` means "is not equal to". - name: conditions | type: array | description: Supported comparison conditions for this field. | validation: maxItems 100 - enum: - EQUAL: Value equals the filter value. - GREATER_THAN: Value is greater than the filter value. - GREATER_THAN_OR_EQUAL: Value is greater than or equal to the filter value. - LESS_THAN: Value is less than the filter value. - LESS_THAN_OR_EQUAL: Value is less than or equal to the filter value. - NULL: Value is null. - EMPTY: Value is an empty string. - START_WITH: String value starts with the filter value. - END_WITH: String value ends with the filter value. - CONTAINS_ANY: For strings, matches if any of the filter values appear as a substring. For arrays, matches if any of the filter values are present in the array. - RANGE_II: Inclusive start, inclusive end range. The value must fall within `[a, b]`. - RANGE_IE: Inclusive start, exclusive end range. The value must fall within `[a, b)`. - RANGE_EI: Exclusive start, inclusive end range. The value must fall within `(a, b]`. - RANGE_EE: Exclusive start, exclusive end range. The value must fall within `(a, b)`. - CONTAINS_ALL: For strings, matches if all filter values appear as substrings. For arrays, matches if all filter values are present in the array. - name: sortable | type: boolean | description: Whether this field supports sorting. - name: enumerations | type: array | description: Allowed values for this field, if the field is an enumerated type. | validation: maxItems 100, maxLength 5120 - name: groupSlug | type: string | description: Grouping identifier. Fields with the same `groupSlug` are logically related. | validation: maxLength 5120 - name: description | type: string | description: Human-readable description of what this field represents. | validation: maxLength 5120 - name: dependencies | type: array | description: Other fields this field depends on. The field returns data only if at least one of these fields is also included in the query; otherwise it's silently omitted from results. | validation: maxItems 100, maxLength 5120 - name: dimensions | type: array | description: Categorical fields available for grouping data, such as traffic source, country, or product name. | validation: maxItems 1000 - name: parameters | type: array | description: Optional inputs that customize query behavior, such as currency or date granularity. | validation: maxItems 1000 - name: description | type: string | description: Human-readable description of the semantic model. | validation: maxLength 5120 - name: keywords | type: array | description: Keywords associated with the semantic model for search and discovery. | validation: maxItems 100, maxLength 5120 Possible Errors: HTTP Code: 401 | Status Code: UNAUTHENTICATED | Application Code: NO_ACCOUNT_IDENTITY | Description: The caller isn't authenticated. Provide valid credentials and try again. ``` ### Examples ### List all available semantic models. ```curl curl -X GET \ 'https://www.wixapis.com/analytics/semantic-model/v3/semantic-models' \ -H 'Content-type: application/json' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.analytics.SemanticModelsService.listSemanticModels() Description: Retrieves a list of all available semantic models. Return type: PROMISE - name: semanticModels | type: array | description: Available semantic models. | validation: maxItems 100 - name: _id | type: string | description: Semantic model GUID. | validation: format GUID - name: slug | type: string | description: URL-friendly identifier for the semantic model. | validation: maxLength 5120 - name: measures | type: array | description: Quantitative fields available for aggregation, such as revenue, page views, or order count. | validation: maxItems 1000 - name: name | type: string | description: Field name. Use this value in the `fields` array of a query request to retrieve this field's data. | validation: maxLength 5120 - name: type | type: FieldTypeEnum | description: Data type of the field. - enum: - UNKNOWN: Unknown field type. - STRING: String. - NUMBER: Number. - BOOLEAN: Boolean. - DATE: Date without time. - DATE_TIME: Date and time. - OBJECT: Structured object with key-value pairs. - ARRAY: Array of values. - name: filters | type: FieldFilters | description: Supported filter operations for this field. - name: prefixes | type: array | description: Supported prefix modifiers for this field. | validation: maxItems 100 - enum: - IS: Positive match. For example, `IS` + `EQUAL` means "is equal to". - NOT: Negated match. For example, `NOT` + `EQUAL` means "is not equal to". - name: conditions | type: array | description: Supported comparison conditions for this field. | validation: maxItems 100 - enum: - EQUAL: Value equals the filter value. - GREATER_THAN: Value is greater than the filter value. - GREATER_THAN_OR_EQUAL: Value is greater than or equal to the filter value. - LESS_THAN: Value is less than the filter value. - LESS_THAN_OR_EQUAL: Value is less than or equal to the filter value. - NULL: Value is null. - EMPTY: Value is an empty string. - START_WITH: String value starts with the filter value. - END_WITH: String value ends with the filter value. - CONTAINS_ANY: For strings, matches if any of the filter values appear as a substring. For arrays, matches if any of the filter values are present in the array. - RANGE_II: Inclusive start, inclusive end range. The value must fall within `[a, b]`. - RANGE_IE: Inclusive start, exclusive end range. The value must fall within `[a, b)`. - RANGE_EI: Exclusive start, inclusive end range. The value must fall within `(a, b]`. - RANGE_EE: Exclusive start, exclusive end range. The value must fall within `(a, b)`. - CONTAINS_ALL: For strings, matches if all filter values appear as substrings. For arrays, matches if all filter values are present in the array. - name: sortable | type: boolean | description: Whether this field supports sorting. - name: enumerations | type: array | description: Allowed values for this field, if the field is an enumerated type. | validation: maxItems 100, maxLength 5120 - name: groupSlug | type: string | description: Grouping identifier. Fields with the same `groupSlug` are logically related. | validation: maxLength 5120 - name: description | type: string | description: Human-readable description of what this field represents. | validation: maxLength 5120 - name: dependencies | type: array | description: Other fields this field depends on. The field returns data only if at least one of these fields is also included in the query; otherwise it's silently omitted from results. | validation: maxItems 100, maxLength 5120 - name: dimensions | type: array | description: Categorical fields available for grouping data, such as traffic source, country, or product name. | validation: maxItems 1000 - name: parameters | type: array | description: Optional inputs that customize query behavior, such as currency or date granularity. | validation: maxItems 1000 - name: description | type: string | description: Human-readable description of the semantic model. | validation: maxLength 5120 - name: keywords | type: array | description: Keywords associated with the semantic model for search and discovery. | validation: maxItems 100, maxLength 5120 Possible Errors: HTTP Code: 401 | Status Code: UNAUTHENTICATED | Application Code: NO_ACCOUNT_IDENTITY | Description: The caller isn't authenticated. Provide valid credentials and try again. ``` ### Examples ### List all available semantic models. ```javascript import { analyticsSemanticModel } from "@wix/analytics-semantic-model"; async function listSemanticModels() { const response = await analyticsSemanticModel.listSemanticModels(); } /* Promise resolves to: { "semanticModels": [ { "id": "cad7fd34-2c8b-4dda-8296-3f9d47fb484d", "slug": "traffic", "description": null, "keywords": null, "measures": [ { "name": "traffic.exit_ratio", "type": "NUMBER", "sortable": true, "description": "Exit rate: the percentage of page views that were the last in a site session. The exit rate indicates where people exit your site after visiting multiple pages." }, { "name": "traffic.pages_per_session_avg", "type": "NUMBER", "sortable": true, "description": "The average number of pages that were viewed during a site session." } ], "dimensions": [ { "name": "traffic.browser_family_name", "type": "STRING", "sortable": true, "description": "The web browser used by a visitor to access the site." }, { "name": "traffic.browser_version_code", "type": "STRING", "sortable": true, "description": "The version of the web browser used to access the site." } ] }, { "id": "a8e22fbb-f638-47c9-858c-4764f5e71715", "slug": "bookings-clients-at-risk", "description": null, "keywords": null, "measures": [ { "name": "clients_at_risk.attendees_count", "type": "NUMBER", "sortable": true, "description": null }, { "name": "clients_at_risk.avg_days_diff_between_sessions", "type": "NUMBER", "sortable": true, "description": null } ], "dimensions": [ { "name": "clients_at_risk.client_address", "type": "STRING", "sortable": true, "description": null }, { "name": "clients_at_risk.client_email", "type": "STRING", "sortable": true, "description": null } ] } ] } */ ``` ### listSemanticModels (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { analyticsSemanticModel } from '@wix/analytics-semantic-model'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { analyticsSemanticModel }, // Include the auth strategy and host as relevant }); async function listSemanticModels() { const response = await myWixClient.analyticsSemanticModel.listSemanticModels(); }; ``` ---