Skip to main content

Looker Integration

Oxygen integrates with Looker to enable automations to query Looker explores directly.

Prerequisites

  • A Looker instance with API access enabled
  • API credentials (client ID and client secret) from your Looker admin panel
  • Oxygen CLI installed

Configuration

Add your Looker integration to config.yml:

Configuration Options

  • client_id_var - Name of the environment variable storing your Looker API client ID
  • client_secret_var - Name of the environment variable storing your Looker API client secret
  • base_url - Your Looker instance URL including the API port (typically :19999)
  • explores - List of Looker explores to make available
    • model - The LookML model name
    • name - The explore name
    • description - Optional description for agent context

Authentication

Oxygen authenticates with Looker using OAuth 2.0 client credentials. On a deployment, add them to the workspace’s secrets (Settings → Secrets) under the names client_id_var and client_secret_var give; that is where oxyc looker test reads them. For a local run, store them as environment variables:
To generate API credentials in Looker:
1

Navigate to Looker Admin

Go to your Looker instance and navigate to Admin > Users.
2

Edit API keys

Select your user (or a service account) and click Edit Keys under the API section.
3

Create new API credentials

Click New API Key. Copy the Client ID and Client Secret — the secret is only shown once.
4

Set environment variables

Export the credentials in your shell or add them to your .env file:

Looker Filter Syntax

Looker uses its own filter syntax, not SQL expressions. Filters in a looker_query task use native Looker filter syntax:

Using Looker in Automations

Add a Looker query task to your automation:

Query Parameters

  • fields - List of dimension and measure names to include (use full view.field_name format)
  • filters - Map of field names to Looker filter expressions
  • filter_expression - Optional filter expression for complex OR conditions
  • sorts - List of sort objects, each with field and direction (asc or desc, defaults to asc)
  • limit - Maximum number of rows to return (use -1 for unlimited)

CLI Commands

Test Connection

oxyc is the Oxy CLI (npm i -g @oxy-hq/cli, then oxyc login). The check runs on your deployment, against what it serves: the integration from the workspace’s deployed config.yml, and the client ID and secret from the workspace’s secrets (Settings → Secrets, under the names client_id_var and client_secret_var give), not your shell’s environment. It signs in to Looker and lists the LookML models. You need to be a workspace admin. It exits 0 when the connection works and 9 when the check fails, naming the stage: resolve (a secret is missing), auth (Looker refused the credentials), or connect / timeout (base_url did not answer). An unknown integration name exits 5. --json prints the result as JSON.
oxy looker test --integration <name> moved to oxyc looker test; the old command was removed.
oxy looker sync and oxy looker list were removed. They wrote a metadata cache (and an overlay directory, looker/) that nothing at run time read. Name fields in full, as view.field_name, in the task.

Troubleshooting

  • Authentication errors - Verify your client ID and secret are correct and that they are stored in the workspace’s secrets under the names config.yml gives (oxyc looker test reports stage resolve when one is missing). API credentials may expire if rotated in the Looker admin panel.
  • Connection refused - Ensure the base_url includes the correct port (Looker API typically runs on port 19999).
  • Unknown field errors - Check that the explores listed in your configuration exist in Looker, that the field names are written view.field_name, and that your API credentials have permission to access them.
  • Query errors with filters - Looker uses its own filter syntax, not SQL. Use expressions like "last 30 days" instead of SQL date functions.