Skip to content
NewDatafor 10.02 is out: subscriptions and metric alerts, in Slack and Teams
Datafor

Developers

The console is built on these APIs, and so is everything else.

Embed a report, sign your users in, pull rows out of a model or script the console, and every call runs under the caller’s own permissions.

HTML

<div id="report" style="height: 720px"></div>

<script>window.__dataforSDKBase = 'https://bi.example.com/datafor/content/datafor/ui/';</script>
<script src="https://bi.example.com/datafor/content/datafor/ui/datafor-loader.js"></script>

<script>
  const el = document.getElementById('report');

  function open(options) {
    return new Datafor.Visualizer(Object.assign({
      el,
      serverUrl: 'https://bi.example.com',      // origin only, no /datafor
      jwt: tokenFromYourBackend,                // see "Sign a token"
      onRedirectEvent: (next) => open(next),    // page, mode or drill-through changed
    }, options));
  }

  const report = open({ path: '/public/Retail/Executive Cockpit.datafor', mode: 'read' });
</script>

Four ways in

Way inWhat it is forWho it runs asReference
JavaScript SDKA report, or the report designer, drawn in your own page.An embed token your backend signsSDK embedding
Query APIRows from a model as JSON.Session, HTTP Basic or a JWTAPI reference
REST APIEverything the console does, from a script.Session, HTTP Basic or a JWTAPI reference
MCP serverQuestions from Claude, ChatGPT, Cursor and any MCP client.A personal token, read-onlyConnect guide

Query API

Ask the model for rows and draw them yourself

Name the measures and the levels, and Datafor writes the query, applies the caller’s rules and hands back JSON.

Request

curl -u analyst:••••••• -X POST \
  "https://bi.example.com/datafor/plugin/datafor/api/cube/query/executeSimple" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "q-7f3c2a",
    "schema": "Retail Chain Operations",
    "cube": "Retail Chain Operations",
    "rows": ["[Store].[Store Hierarchy].[region]"],
    "measures": ["Net Sales", "Sales Quantity"],
    "filters": [{
      "uniqueName": "[Date].[full_date].[full_date]",
      "comparator": "between",
      "value": ["2026-01-01", "2026-03-31"]
    }],
    "topRows": [{ "type": "top", "limit": 3, "measure": "Net Sales" }]
  }'

Response

{
  "hasMore": false,
  "chartData": [
    { "Region": "East",      "Net Sales": 239148.49, "Sales Quantity": 2555 },
    { "Region": "South",     "Net Sales": 167889.45, "Sales Quantity": 1852 },
    { "Region": "Southwest", "Net Sales": 135218.74, "Sales Quantity": 1339 }
  ],
  "metaData": [ ... ]
}

Try it against your own app.

A ninety-day trial runs on your own servers, and every call on this page works against its sample data.