> ## Documentation Index
> Fetch the complete documentation index at: https://cubed3-feat-druid-driver-streaming.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Core Data APIs

> Query the Cube semantic layer using SQL, DAX, REST (JSON), or GraphQL protocols depending on your application needs.

Core Data APIs

Core Data APIs enable you to query and retrieve data from your Cube semantic layer using various protocols and formats, including SQL, DAX, REST (JSON), and GraphQL.

## Choosing the Right API

* To connect to [Microsoft Power BI][ref-powerbi], use the [DAX API][ref-dax-api]

* To connect to [Microsoft Excel][ref-excel], use [Cube Cloud for Excel][ref-cube-cloud-for-excel]

* To connect to [Google Sheets][ref-sheets], use [Cube Cloud for Sheets][ref-cube-cloud-for-sheets]

* To connect to AI assistants, use the [Model Context Protocol (MCP) server][ref-mcp-server]

* For internal or self-serve [business intelligence][cube-issbi], use [Semantic Layer Sync][ref-sls] if it supports your BI tools. Otherwise, connect via the [SQL API][ref-sql-api] directly

* For [embedded analytics][cube-ea] and [real-time analytics][cube-rta], use [REST (JSON) API][ref-rest-api] or [GraphQL API][ref-graphql-api]. When using the REST (JSON) API, the [JavaScript SDK][ref-js-sdk] can simplify integration with your front-end code

All Core Data APIs share common [querying concepts][ref-queries] and support authentication, security contexts, and access policies defined in your semantic layer.

<Note>
  See this [GitHub issue](https://github.com/cube-js/cube/issues/1744#issuecomment-2291680777)
  for an unofficial, community-maintained [client library for Python](https://github.com/mharrisb1/cube-http-client).
</Note>

## Data modeling

Support for data modeling features differ across APIs, integrations, and [visualization
tools][ref-viz-tools]. Some of the features with partial support are listed below:

| Feature                                        | ✅ Supported in                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Hierarchies][ref-hierarchies]                 | [Microsoft Power BI][ref-powerbi] via the [DAX API][ref-dax-api]<br />[Cube Cloud for Excel][ref-cube-cloud-for-excel]<br />[Cube Cloud for Sheets][ref-cube-cloud-for-sheets]<br />[Tableau][ref-tableau] via [Semantic Layer Sync][ref-sls]<br /><br />Also, supported in [Playground][ref-playground]                                                                                                                                      |
| Flat [folders][ref-folders]                    | [Microsoft Power BI][ref-powerbi] via the [DAX API][ref-dax-api]<br />[Cube Cloud for Excel][ref-cube-cloud-for-excel]<br />[Cube Cloud for Sheets][ref-cube-cloud-for-sheets]<br />[Tableau][ref-tableau] via [Semantic Layer Sync][ref-sls]<br />[Apache Superset][ref-superset] via [Semantic Layer Sync][ref-sls]<br />[Preset][ref-preset] via [Semantic Layer Sync][ref-sls]<br /><br />Also, supported in [Playground][ref-playground] |
| Nested [folders][ref-folders]                  | [Microsoft Power BI][ref-powerbi] via the [DAX API][ref-dax-api]                                                                                                                                                                                                                                                                                                                                                                              |
| [Custom time formats][ref-custom-time-formats] | [Playground][ref-playground] and [Workbooks][ref-workbooks]                                                                                                                                                                                                                                                                                                                                                                                   |

## Personal Core Data API Token

Cube users can generate a personal token to authenticate SQL API connections from
external tools like BI dashboards, notebooks, and SQL clients. Navigate to
**Preferences → Personal Core Data API Token** and click
**Generate Token**.

The token authenticates as that user, so all [groups][ref-groups],
[user attributes][ref-user-attributes], and [data access policies][ref-dap]
are applied to queries made with this token. The page also provides connection
instructions including host, port, and database name for your deployment.

## Authentication methods

Support for authentication methods differ across APIs, integrations, and [visualization
tools][ref-viz-tools]:

| Method                                                  | ✅ Supported in                                                                                           |
| ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| [User name and password][ref-auth-user-pass]            | [DAX API][ref-dax-api]<br />[Semantic Layer Sync][ref-sls]<br />[SQL API][ref-sql-api]                   |
| [Kerberos][ref-auth-kerberos] and [NTLM][ref-auth-ntlm] | [DAX API][ref-dax-api]                                                                                   |
| [Identity provider][ref-auth-idp]                       | [Cube Cloud for Excel][ref-cube-cloud-for-excel]<br />[Cube Cloud for Sheets][ref-cube-cloud-for-sheets] |
| [JSON Web Token][ref-auth-jwt]                          | [REST (JSON) API][ref-rest-api]<br />[GraphQL API][ref-graphql-api]                                      |

[cube-issbi]: https://cube.dev/use-cases/semantic-layer

[cube-ea]: https://cube.dev/use-cases/embedded-analytics

[cube-rta]: https://cube.dev/use-cases/real-time-analytics

[ref-queries]: /reference/core-data-apis/queries

[ref-sql-api]: /reference/core-data-apis/sql-api

[ref-dax-api]: /reference/core-data-apis/dax-api

[ref-rest-api]: /reference/core-data-apis/rest-api

[ref-graphql-api]: /reference/core-data-apis/graphql-api

[ref-sls]: /docs/integrations/semantic-layer-sync

[ref-js-sdk]: /reference/javascript-sdk

[ref-cube-cloud-for-excel]: /docs/integrations/microsoft-excel

[ref-cube-cloud-for-sheets]: /docs/integrations/google-sheets

[ref-mcp-server]: /docs/integrations/mcp-server

[ref-viz-tools]: /admin/connect-to-data/visualization-tools

[ref-hierarchies]: /reference/data-modeling/hierarchies

[ref-folders]: /reference/data-modeling/view#folders

[ref-powerbi]: /admin/connect-to-data/visualization-tools/powerbi

[ref-excel]: /admin/connect-to-data/visualization-tools/excel

[ref-sheets]: /admin/connect-to-data/visualization-tools/google-sheets

[ref-tableau]: /admin/connect-to-data/visualization-tools/tableau

[ref-auth-user-pass]: /embedding/authentication/jwt

[ref-auth-idp]: /embedding/authentication/jwt

[ref-auth-jwt]: /embedding/authentication/jwt

[ref-auth-kerberos]: /docs/integrations/power-bi/kerberos

[ref-auth-ntlm]: /docs/integrations/power-bi/ntlm

[ref-superset]: /admin/connect-to-data/visualization-tools/superset

[ref-preset]: /admin/connect-to-data/visualization-tools/superset

[ref-playground]: /admin/workspace/playground

[ref-custom-time-formats]: /reference/data-modeling/dimensions#format

[ref-workbooks]: /analytics/workbooks

[ref-groups]: /admin/users-and-permissions/user-groups

[ref-user-attributes]: /admin/users-and-permissions/user-attributes

[ref-dap]: /docs/data-modeling/data-access-policies
