Skip to main content
RapidDev - Software Development Agency
retool-integrationsREST API Resource

How to Integrate Retool with Looker

Connect Retool to Looker by creating a REST API Resource with Looker's API endpoint and client_id/client_secret OAuth authentication. Use Looker's Run Inline Query and Look endpoints to pull BI data into Retool operational dashboards, combining Looker's LookML-based analytics with Retool's editable UI components for data-driven internal tools.

What you'll learn

  • How to authenticate to Looker's API using client credentials and obtain access tokens
  • How to run Looker inline queries and pull Look results into Retool Table components
  • How to embed Looker Looks and dashboards in Retool using Custom Components
  • How to combine Looker analytics data with Retool's editable UI for operational workflows
  • How to handle Looker's token refresh within Retool's query architecture
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate15 min read35 minutesAnalyticsLast updated April 2026RapidDev Engineering Team
TL;DR

Connect Retool to Looker by creating a REST API Resource with Looker's API endpoint and client_id/client_secret OAuth authentication. Use Looker's Run Inline Query and Look endpoints to pull BI data into Retool operational dashboards, combining Looker's LookML-based analytics with Retool's editable UI components for data-driven internal tools.

Quick facts about this guide
FactValue
ToolLooker
CategoryAnalytics
MethodREST API Resource
DifficultyIntermediate
Time required35 minutes
Last updatedApril 2026

Pull Looker Analytics into Retool Operational Dashboards

Looker is a powerful BI platform with LookML data models that ensure consistent metric definitions across your organization. But Looker dashboards are read-only — they're great for reporting, but they can't take actions, update records, or combine analytics with operational workflows. Retool fills this gap by letting you pull Looker query results directly into apps that also have forms, buttons, and write-back capabilities.

With the Retool-Looker integration, you can pull any Looker Look result or run inline queries using your existing LookML dimensions and measures. A support team can see Looker-powered customer analytics alongside a support ticket form. An ops team can view Looker inventory metrics next to a replenishment tool. The Looker data brings your carefully defined metrics; Retool adds the UI for taking action based on those metrics.

Looker's API uses a two-step authentication flow: you first POST to /api/4.0/login to exchange your client credentials for an access token, then use that token for all subsequent requests. Retool's Custom Auth feature handles this multi-step flow gracefully. Alternatively, you can use a simpler approach with a JavaScript query that fetches the token on app load and stores it in a Retool variable for subsequent queries.

Integration method

REST API Resource

Looker connects to Retool through a REST API Resource using OAuth 2.0 client credentials flow — you exchange client_id and client_secret for an access token via /api/4.0/login, then include that token as a Bearer header on subsequent requests. Retool proxies all requests server-side through its backend, keeping your Looker credentials secure. You can pull query results, Look data, and dashboard data directly into Retool for operational dashboards that add editable UI on top of Looker's analytics.

Prerequisites

  • A Looker instance (Google Cloud Looker or Looker core) with API access enabled
  • A Looker API client_id and client_secret (generated in Admin → Users → Edit user → API Keys)
  • Your Looker instance URL (e.g., https://yourcompany.looker.com)
  • A Retool account with permission to create Resources
  • Knowledge of your Looker Explore names, Look IDs, or dimension/measure names for queries

Step-by-step guide

1

Create a Looker REST API Resource with Custom Auth

Navigate to the Resources tab in Retool and click Add Resource. Select REST API. Name it 'Looker API'. In the Base URL field, enter your Looker API base URL — this is typically https://yourcompany.looker.com/api/4.0 (replace 'yourcompany' with your Looker instance subdomain). Do not include a trailing slash after the version number. Now configure authentication. Looker uses a two-step OAuth client credentials flow — you POST credentials to /login to get an access token, then use that token as a Bearer header. In the Authentication section, select Custom Auth. In the Custom Auth Login section, add a step to POST to /login with body parameters client_id and client_secret. Store the response access_token as a variable. Then in the Request Headers section of your resource, add: Authorization: Bearer {{ auth.access_token }}. Store your Looker credentials as Secret configuration variables (LOOKER_CLIENT_ID and LOOKER_CLIENT_SECRET) in Settings → Configuration Variables before referencing them in the Custom Auth steps. An alternative simpler approach: instead of Custom Auth, create a JavaScript query named getToken that runs on page load, POSTs to /api/4.0/login with your credentials, and stores the returned access_token in a Retool Variable named lookerToken. Then reference {{ lookerToken.value }} in subsequent query headers.

getToken.js
1// JavaScript query: getToken — runs on page load
2// Store result in a Variable component named 'lookerToken'
3const response = await fetch(
4 `${retoolContext.configVars.LOOKER_BASE_URL}/api/4.0/login`,
5 {
6 method: 'POST',
7 headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
8 body: `client_id=${retoolContext.configVars.LOOKER_CLIENT_ID}&client_secret=${retoolContext.configVars.LOOKER_CLIENT_SECRET}`
9 }
10);
11const data = await response.json();
12return data.access_token;

Pro tip: Looker access tokens expire after 1 hour by default. If your Retool app sessions last longer, add a refresh mechanism — either refresh the token via a periodic query or use Retool's Custom Auth with automatic token refresh configured.

Expected result: The Looker API resource is saved. The getToken JavaScript query successfully returns an access_token string when run, and the token value is stored in the lookerToken Variable component.

2

Run a Looker inline query to pull analytics data

With authentication configured, create a query to run an inline Looker query against one of your Explores. Create a query named runLookerQuery. Select the Looker API resource, set Method to POST, and set Path to /queries/run/json. This endpoint accepts a query specification as the JSON body and returns results as a JSON array — perfect for Retool Tables. The body structure specifies the model name, the Explore name, the fields (dimensions and measures) to include, any filters, and sort order: The model, view, and field names come from your LookML. Navigate to Looker's Explore section and look at the field picker — the field names in API format are shown in the URL or in the field's info panel as model_name::view_name.field_name. Set the body fields dynamically based on dropdown selectors in your Retool app. Add a Dropdown component named dropdown_explore where users select which Explore to query, and multi-select checkboxes for which fields to include. This creates a flexible analytics query tool without requiring LookML knowledge from operators. Bind the query result (data) directly to a Retool Table. The inline query response is already a flat JSON array — no transformer needed for basic display, though you may want one for number formatting.

query_body.json
1// Query body for Looker /queries/run/json endpoint
2{
3 "model": "your_model_name",
4 "view": "{{ dropdown_explore.value || 'orders' }}",
5 "fields": [
6 "orders.created_date",
7 "orders.count",
8 "orders.total_revenue",
9 "customers.name"
10 ],
11 "filters": {
12 "orders.created_date": "{{ dateRange.value ? `${moment(dateRange.value[0]).format('YYYY/MM/DD')} to ${moment(dateRange.value[1]).format('YYYY/MM/DD')}` : '30 days' }}"
13 },
14 "sorts": ["orders.created_date desc"],
15 "limit": "{{ pagination.pageSize || 500 }}",
16 "query_timezone": "America/Los_Angeles"
17}

Pro tip: Use Looker's Explore interface to prototype your query first — run it in Looker, then copy the model/view/fields structure from the URL parameters to use in your Retool inline query body.

Expected result: The inline query runs and returns a flat JSON array of results matching your LookML field specifications. The Table component displays the data with Looker-defined metric names as column headers.

3

Fetch existing Look results by Look ID

If your Looker instance has pre-built Looks (saved queries with visualizations), you can pull those results directly into Retool without redefining the query parameters. This is simpler than inline queries and ensures Retool uses exactly the same query definition as the Look in Looker. Create a query named getLookResults. Set Method to GET, Path to /looks/{{ textInput_lookId.value }}/run/json. Add the Authorization header dynamically: key = Authorization, value = Bearer {{ lookerToken.value }} (if using the variable approach) or rely on the resource-level auth configuration. You can add filters to Look results as URL parameters. For example, to filter a Look by customer_id, add: URL parameter key = filters[customers.id], value = {{ textInput_customerId.value }}. Multiple filters can be added as separate URL parameters. Build a Look browser by also creating a getLooks query (GET, /looks?fields=id,title,description,folder,created_at) that lists all available Looks. Bind this to a Table, and when a row is selected, populate the textInput_lookId with the selected Look's ID and trigger getLookResults. This gives operators a point-and-click interface for running any Look in your organization. For complex integrations that connect multiple Looker Looks with operational data from different databases, RapidDev's team can help design the multi-query architecture and transformer logic.

transformer.js
1// JavaScript transformer — format Look results for display
2// Looker returns field names as 'view_name.field_name' format
3// This transformer renames them to more readable labels
4const results = data || [];
5if (results.length === 0) return [];
6
7// Get the keys from the first result to build the mapping
8const keys = Object.keys(results[0]);
9
10// Reformat field names: 'orders.total_revenue' -> 'Total Revenue'
11const formatKey = key => key
12 .split('.').pop() // remove 'view_name.' prefix
13 .split('_') // split on underscores
14 .map(w => w.charAt(0).toUpperCase() + w.slice(1)) // title case
15 .join(' ');
16
17return results.map(row => {
18 const formatted = {};
19 keys.forEach(key => {
20 formatted[formatKey(key)] = row[key];
21 });
22 return formatted;
23});

Pro tip: Looker Look IDs are stable — find them by navigating to a Look in Looker and reading the number from the URL (looker.com/looks/123 has ID 123). Store commonly used Look IDs in a Retool Database table for easy access in your app.

Expected result: The getLookResults query returns the Look's data as a flat JSON array. The transformer renames Looker's dot-notation field names to readable column headers for the Retool Table.

4

Embed a Looker dashboard in Retool using Custom Components

For cases where you want the full Looker visualization experience inside Retool (charts, pivots, visualizations that would be complex to recreate), use Retool's Custom Component to embed a Looker dashboard or Look via iframe. Drag a Custom Component from the Component panel onto your canvas. In the Custom Component editor, replace the default code with an iframe that loads your Looker dashboard or Look with embed parameters. Looker supports signed embed URLs for secure embedding. You'll need to generate a signed URL server-side using Looker's embed SDK — this requires your embed secret (different from the API credentials) and generates a time-limited URL with user context. For simpler use cases where your Retool app is inside your company network and you use SSO with Looker, you can embed the dashboard URL directly without signed embedding since users will already be authenticated to Looker via SSO when they access Retool. Add Looker filtering by including filter parameters in the embed URL. Looker embed URLs accept ?field_name=value parameters that pre-filter the embedded dashboard. Bind these to Retool component values to create synchronized filtering between your Retool UI and the embedded Looker visualization.

custom_component.html
1// Custom Component HTML for Looker embed
2// Replace LOOKER_URL and DASHBOARD_ID with your values
3const html = `
4<style>
5 iframe {
6 width: 100%;
7 height: 600px;
8 border: none;
9 border-radius: 4px;
10 }
11</style>
12<iframe
13 src="https://yourcompany.looker.com/embed/dashboards/${Retool.widgetConfig?.dashboardId || '1'}?allow_login_screen=false&embed_domain=https://retool.yourcompany.com"
14 allowfullscreen
15/>`;
16
17// In the Custom Component, render this HTML
18// Pass dashboardId from Retool as a widgetConfig prop

Pro tip: Looker's SSO-based embedding requires the Looker embed secret to generate signed URLs. This is more secure than embedding public dashboard URLs. Set up a Retool Workflow or external endpoint to generate signed embed URLs using Looker's embed SDK.

Expected result: The Custom Component renders an embedded Looker dashboard or Look inside the Retool app. Users can interact with the Looker visualization while also using Retool's operational components in the same view.

5

Build a Looker metrics dashboard with operational actions

Assemble the complete dashboard that combines Looker analytics with Retool actions. The goal is to give operational teams Looker-quality metrics alongside the ability to act on those metrics without switching tools. Layout recommendation: Left column (35% width) — Looker-powered metrics table using the inline query or Look result approach. Right column (65% width) — operational panel with forms, buttons, and write-back queries. Example: A customer success team dashboard where the left panel shows Looker's customer health scores and churn risk metrics (from your carefully maintained LookML models), and the right panel shows the selected customer's account details with buttons to create a task in Asana, log a call note to Salesforce, or update a customer status in your PostgreSQL database. Connect the panels via Retool's selectedRow mechanism. When a rep clicks a row in the Looker metrics Table, the selectedRow.customer_id populates the customer detail panel on the right. Add a refresh mechanism: a Refresh button that clears the lookerToken variable and re-runs the getToken query to get a fresh access token, then re-runs all Looker queries. This handles the 1-hour token expiry for long-running sessions. Add loading states (using Retool's component loading prop bound to runLookerQuery.isFetching) so users know when Looker data is being fetched — Looker queries on large datasets can take 10-30 seconds.

refresh_looker.js
1// JavaScript query: refreshLooker — call this when token may have expired
2// Runs getToken, waits for it to complete, then re-runs all Looker queries
3await getToken.trigger();
4await runLookerQuery.trigger();
5// or getLookResults.trigger() depending on your approach
6return 'Refreshed';

Pro tip: Retool's query timeout defaults to 10 seconds. Looker queries on large datasets often exceed this. Go to your query's Advanced settings and increase the timeout to 60-120 seconds for complex Looker analytics queries.

Expected result: The combined dashboard shows Looker metrics in one panel and operational actions in another. Selecting a row in the Looker table automatically populates the action panel. The Refresh button handles token renewal for long-running sessions.

Common use cases

Build a Looker-powered operations dashboard with write-back

Create a Retool app that pulls Looker's sales performance metrics into a Table, then adds an action panel where managers can update forecasts or add notes. The Looker data (deals in pipeline, close rates by rep) is read-only, but the Retool layer adds write-back to your CRM database for forecast adjustments.

Retool Prompt

Build a sales operations panel that runs a Looker inline query for the 'Sales Pipeline' explore to get deals by stage and rep, displays results in a Retool Table, and adds an editable notes column that writes back to a PostgreSQL table with rep_id and forecast_notes fields.

Copy this prompt to try it in Retool

Customer analytics detail panel with Looker Look embedding

Build a Retool customer lookup tool where searching by customer ID triggers a Looker API query to pull that customer's cohort metrics and LTV, combines it with raw order data from your database, and optionally embeds a specific Looker Look filtered to that customer using a Custom Component iframe.

Retool Prompt

Create a customer detail panel where entering a customer ID runs a Looker /looks/{look_id}/run/json query with a filter on customer_id, shows Looker-defined metrics in stat cards, and embeds a filtered Looker Look for purchase history using a Custom Component.

Copy this prompt to try it in Retool

Scheduled Looker report distribution with actions

Build a Retool Workflow that runs Looker queries on a schedule, formats the results into a report, and sends them to a Slack channel or emails them to a distribution list. Add the ability to trigger the report on demand from a Retool app button, giving managers immediate access to the latest analytics.

Retool Prompt

Build a report distribution dashboard that shows all configured Looker Looks with a 'Run and Send' button for each — clicking triggers a Retool Workflow that fetches the Look data from /looks/{id}/run/json, formats it as a CSV transformer, and sends it to a configured Slack channel.

Copy this prompt to try it in Retool

Troubleshooting

Authentication fails with 'Invalid client credentials' on /api/4.0/login

Cause: The client_id or client_secret is incorrect, or the API user in Looker doesn't have an API key configured. API keys are per-user in Looker and must be explicitly generated for the account you're using.

Solution: In Looker, go to Admin → Users, find the API service account user, click Edit, scroll to API Keys, and verify or regenerate the client_id and client_secret. Update your Retool configuration variables with the new values. Ensure the API is enabled for your Looker instance under Admin → API.

Inline query returns 'Unknown model' or 'Unknown view' error

Cause: The model name or view (explore) name in your query body doesn't match the LookML definition exactly. Looker's API uses the LookML model and explore names, which may differ from the display names shown in the Looker UI.

Solution: In Looker, navigate to the Explore you want to query. The URL will show the model name and explore name: looker.com/explore/MODEL_NAME/EXPLORE_NAME. Use these exact values in your inline query body. Check for case sensitivity — LookML names are typically lowercase with underscores.

Token expiry causes queries to fail after 60 minutes with 401 errors

Cause: Looker access tokens expire after 1 hour by default. Retool Variables persist during a browser session, so if a user leaves the app open, the stored token becomes invalid and subsequent queries fail.

Solution: Add a token refresh mechanism. Either use Retool's Custom Auth with automatic refresh configured (re-run login steps on 401 responses), or add a periodic JavaScript query that checks token age and refreshes every 50 minutes using setInterval-style logic. The simplest fix is to add a 'Refresh Session' button that re-triggers the getToken query.

typescript
1// Add this event handler to catch 401 errors
2// Query on-failure handler: re-run getToken, then retry
3await getToken.trigger();
4return runLookerQuery.trigger();

Look results return different data than what Looker shows in the UI

Cause: The Look in Looker may apply a user-level or role-level data access control (LAC — Looker Access Control) that restricts which data the API user sees. The API runs as the service account user, not as the current Retool app user, so it may see more or less data than a typical Looker user.

Solution: Check whether the Looker API user has the same permissions as a typical end user, or whether it has admin-level access that bypasses row-level security. For production tools, consider using user-attribute-based filtering in your inline query body to apply the same restrictions that Looker applies to end users. Consult your Looker admin about API access permissions.

Best practices

  • Store Looker client_id and client_secret as Secret configuration variables — never include raw credentials in query body fields or JavaScript query code.
  • Use Looker's dedicated API service account rather than a personal user account — this ensures API access doesn't break when individuals leave your organization.
  • Implement token refresh logic for apps used in long sessions — Looker tokens expire in 1 hour, so either use Custom Auth with refresh or add a manual refresh button for long-running dashboards.
  • Use Look IDs for stable, pre-validated queries rather than constructing inline queries from scratch — this ensures your Retool data matches what stakeholders see in Looker's dashboards.
  • Increase Retool query timeout to 60+ seconds for Looker analytics queries — large dataset queries can take significantly longer than the default 10-second timeout.
  • Add transformers to rename Looker's dot-notation field names (view.field_name) to readable column headers before binding to Retool Table components.
  • Combine Looker data with write-back queries to your operational databases in the same app — this is the key advantage of using Retool over embedding Looker dashboards alone.
  • Cache frequently-run Looker query results in Retool Database using scheduled Workflows to avoid repeated API calls and reduce Looker query load during peak usage.

Alternatives

Frequently asked questions

Do I need Looker's embed secret to show Looker visualizations in Retool?

You need the embed secret only for signed SSO embedding, which provides secure, user-authenticated Looker dashboards inside Retool iframes. For API-based data pulls (fetching data and rendering it in Retool's own components), you only need the API client_id and client_secret. For simple internal tools where all users are already authenticated to both Retool and Looker via SSO, you can embed Looker iframes without signed URLs.

Can I write data back to Looker from Retool?

Looker is a read-only analytics layer — you cannot write data back to Looker. Write-back operations should target the underlying databases that Looker connects to. In a Retool app, you can use Looker API queries for read analytics while using direct database resource queries for write operations. This multi-resource pattern is a core Retool strength.

How do I use Looker user attributes in Retool API queries?

Looker user attributes control row-level security and data access. When querying via the API, the access context is the API user account, not the current Retool user. To apply user-specific filtering, pass filter parameters that mirror the user attribute restrictions. For multi-tenant tools, add explicit filter parameters based on the logged-in Retool user's organizational context rather than relying on Looker's user attribute system.

What's the difference between using Looker API and querying the underlying database directly in Retool?

Querying Looker's API ensures you use the same metric definitions, joins, and business logic defined in your LookML models. This means your Retool data matches what appears in Looker dashboards. Querying the database directly gives more flexibility but risks metric drift — the same calculation may be defined differently in raw SQL vs. LookML. For metrics that have been carefully defined in LookML, always go through the Looker API to maintain consistency.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Integrations are where projects stall

We wire Retool integrations like this one every week — auth, webhooks, edge cases included. Fixed-price builds from $13K, delivered in 6–10 weeks.

Talk to an integration engineer

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.