Labsco
exploreomni logo

omni-query

35

by exploreomni · part of exploreomni/omni-claude-skills

Run queries against Omni Analytics' semantic layer using the REST API, interpret results, and chain queries for multi-step analysis. Use this skill whenever…

🔥🔥🔥✓ VerifiedFreeQuick setup
🧩 One of 7 skills in the exploreomni/omni-claude-skills package — works on its own, and pairs well with its siblings.

This is the playbook your agent receives when the skill activates — you don't need to read it to use the skill, but it's here to audit before installing.

by exploreomni

Run queries against Omni Analytics' semantic layer using the REST API, interpret results, and chain queries for multi-step analysis. Use this skill whenever… npx skills add https://github.com/exploreomni/omni-claude-skills --skill omni-query Download ZIPGitHub35

Omni Query

Run queries against Omni's semantic layer via the REST API. Omni translates field selections into optimized SQL — you specify what you want (dimensions, measures, filters), not how to get it.

Tip: Use omni-model-explorer first if you don't know the available topics and fields.

API Discovery

When unsure whether an endpoint or parameter exists, fetch the OpenAPI spec:

curl -L "$OMNI_BASE_URL/openapi.json" \
 -H "Authorization: Bearer $OMNI_API_KEY"

Use this to verify endpoints, available parameters, and request/response schemas before making calls.

Handling Results

Default response: base64-encoded Apache Arrow table. Arrow results are binary — you cannot parse individual row data from the raw response. To verify a query returned data, check summary.row_count in the response.

For human-readable results, request CSV instead:

{ "query": { ... }, "resultType": "csv" }

Decoding Arrow Results

import base64, pyarrow as pa
arrow_bytes = base64.b64decode(response["data"])
reader = pa.ipc.open_stream(arrow_bytes)
df = reader.read_all().to_pandas()

Long-Running Queries

If the response includes remaining_job_ids, poll until complete:

curl -L -X POST "$OMNI_BASE_URL/api/v1/query/wait" \
 -H "Authorization: Bearer $OMNI_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{ "jobIds": ["job-id-1", "job-id-2"] }'

Multi-Step Analysis Pattern

For complex analysis, chain queries:

  • Broad query — understand the shape of the data

  • Inspect results — identify interesting segments or patterns

  • Focused follow-ups — filter based on findings

  • Synthesize — combine results into a narrative

Common Query Patterns

Time Series: fields + date dimension + ascending sort + date filter

Top N: fields + metric + descending sort + limit

Aggregation with Breakdown: multiple dimensions + multiple measures + descending sort by key metric

Known Bugs

  • IS_NOT_NULL filter generates IS NULL (reported Omni bug) — workaround: invert the filter logic or use the base view to apply the filter differently.

  • Boolean filters may be silently dropped when a pivots array is present — if boolean filters aren't applying, remove the pivot and test again.

Linking to Results

Queries are ephemeral — there is no persistent URL for a query result. To give the user a shareable link:

  • For existing dashboards: {OMNI_BASE_URL}/dashboards/{identifier} (the identifier comes from the document API response)

  • For new analysis: Create a document via omni-content-builder with the query as a queryPresentation, then share {OMNI_BASE_URL}/dashboards/{identifier}

Docs Reference

Related Skills

  • omni-model-explorer — discover fields and topics before querying

  • omni-content-explorer — find dashboards whose queries you can extract

  • omni-content-builder — turn query results into dashboards