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 toconfig.yml:
Configuration Options
client_id_var- Name of the environment variable storing your Looker API client IDclient_secret_var- Name of the environment variable storing your Looker API client secretbase_url- Your Looker instance URL including the API port (typically:19999)explores- List of Looker explores to make availablemodel- The LookML model namename- The explore namedescription- 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 namesclient_id_var and client_secret_var give; that is where oxyc looker test reads them. For a local run, store them as environment variables:
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 alooker_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 fullview.field_nameformat)filters- Map of field names to Looker filter expressionsfilter_expression- Optional filter expression for complex OR conditionssorts- List of sort objects, each withfieldanddirection(ascordesc, defaults toasc)limit- Maximum number of rows to return (use-1for 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.ymlgives (oxyc looker testreports stageresolvewhen one is missing). API credentials may expire if rotated in the Looker admin panel. - Connection refused - Ensure the
base_urlincludes the correct port (Looker API typically runs on port19999). - 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.