# How to Integrate Retool with Moz

- Tool: Retool
- Difficulty: Intermediate
- Time required: 20 minutes
- Last updated: April 2026

## TL;DR

Connect Retool to Moz by creating a REST API Resource pointing to the Moz API (lsapi.seomoz.com/v2), authenticated with your Access ID and Secret Key using HTTP Basic Auth. Build SEO tracking dashboards that surface Domain Authority, Page Authority, Spam Score, and link metrics for URLs and domains — enabling marketing and SEO teams to monitor competitive DA/PA trends from within Retool.

## Why Connect Retool to Moz?

Digital marketing and SEO teams rely on Moz's Domain Authority and Page Authority metrics as standard benchmarks for evaluating website strength and competitive positioning. Checking DA and PA for client sites, competitor domains, and link prospects is a routine task — but doing it through Moz's web interface one domain at a time, or through Moz's native reports that don't integrate with other data sources, is inefficient for agencies and in-house teams managing large portfolios.

Connecting Moz to Retool enables building a competitive SEO monitoring panel that batch-queries DA and PA for an entire list of domains — clients, competitors, and link prospects — displaying them in a sortable table alongside other marketing data from your database or CRM. Marketing agencies build client reporting dashboards that pull Moz metrics alongside Google Search Console data and rank tracking from other tools, creating a unified SEO performance view without manually copying numbers between platforms.

Moz's Links API v2 provides programmatic access to URL Metrics (DA, PA, Spam Score, link counts), anchor text data, and linking domain information. The API uses a credit-based system where each request consumes a certain number of rows, so batch queries using the URL Metrics endpoint (which returns metrics for multiple URLs in a single request) are more efficient than one-URL-at-a-time queries. The API is available on Moz Pro plans — Standard and above.

## Before you start

- A Retool account (Cloud or self-hosted) with permission to create Resources
- A Moz Pro account at moz.com with API access enabled — the Links API is available on Standard plan and above. Free accounts do not include API access.
- Your Moz API Access ID and Secret Key — find these at moz.com/products/pro/api under API Credentials. The Access ID looks like 'mozscape-xxxxxxxxxxxxxxxx' and the Secret Key is a longer alphanumeric string.
- Familiarity with Moz's DA/PA metrics: Domain Authority (0-100 scale, measures domain link strength), Page Authority (0-100 scale, measures individual page link strength), and Spam Score (0-17 scale, flags potentially spammy characteristics)
- Knowledge of Moz's API credit system: each API account has a monthly credit limit, and batch URL Metric queries consume credits based on the number of rows returned — plan your query frequency accordingly

## Step-by-step guide

### 1. Locate your Moz API credentials

Moz API credentials are available through the Moz Pro account portal. Log into your Moz account at moz.com and navigate to Products → Moz Pro → API (or go directly to moz.com/products/pro/api). You will see your API Credentials section displaying your Access ID and Secret Key.

The Access ID is a string in the format 'mozscape-[random characters]'. The Secret Key is a longer alphanumeric string. Both are needed for Basic Auth — the Access ID is the username and the Secret Key is the password.

Note your API credit allowance shown on the same page. The Moz API uses a credit system where batch URL Metrics queries consume 1 row per URL requested. Standard plan includes limited credits; higher plans include more. For a dashboard that queries DA for 20 competitor domains daily, calculate the monthly credit consumption to ensure your plan supports it.

The Moz Links API v2 base URL is: https://lsapi.seomoz.com/v2/

Key endpoints you will use:
- URL Metrics (batch): POST /url_metrics — returns DA, PA, Spam Score for up to 50 URLs per request
- Anchor Text: POST /anchor_text — returns top anchors for a domain
- Links: POST /links — returns link details for a domain
- Linking Domains: POST /linking_domains — returns domain-level link data

The POST URL Metrics endpoint is the most efficient for dashboard use — it accepts an array of URLs and returns metrics for all in a single request, consuming one credit per URL.

**Expected result:** You have your Moz API Access ID and Secret Key from the Moz Pro API credentials page. You know your monthly credit allowance and have verified that your plan includes API access.

### 2. Create the Moz REST API Resource in Retool

Navigate to the Resources tab in Retool and click Add Resource. Select REST API from the resource type list. Configure the resource:

- Name: 'Moz Links API'
- Base URL: https://lsapi.seomoz.com/v2

For authentication, select Basic Auth from the Auth dropdown:
- Username: your Moz API Access ID (the full string including 'mozscape-' prefix)
- Password: your Moz API Secret Key

Add default headers that will be sent with every request:
- Key: Content-Type, Value: application/json
- Key: Accept, Value: application/json

Click Save Changes.

Store the credentials in Retool Configuration Variables (Settings → Configuration Variables) named MOZ_ACCESS_ID and MOZ_SECRET_KEY, both marked as secret. Update the resource's Basic Auth fields to reference these variables: Username: {{ retoolContext.configVars.MOZ_ACCESS_ID }}, Password: {{ retoolContext.configVars.MOZ_SECRET_KEY }}.

Verify the resource by creating a test query:
- Method: POST
- Path: /url_metrics
- Body: { "targets": ["moz.com"], "metrics": ["domain_authority", "page_authority", "spam_score"] }

Run the query. A successful response returns a results array with one entry for moz.com, showing its Domain Authority (currently in the 90+ range), Page Authority, and Spam Score. If you receive a 401 error, verify the Access ID and Secret Key are correctly configured.

**Expected result:** The Moz Links API Resource appears in the Resources list. A test POST to /url_metrics for moz.com returns domain authority metrics, confirming the Basic Auth credentials and resource configuration are working correctly.

### 3. Build a batch URL metrics query for multiple domains

The Moz API's /url_metrics endpoint accepts an array of URLs and returns metrics for all of them in a single request, making it the efficient choice for dashboard use. Build a query that accepts a user-entered list of domains and fetches all their metrics simultaneously.

Create a new query using the Moz Links API resource:
- Method: POST
- Path: /url_metrics
- Body type: Raw JSON
- Body: a JSON object with a 'targets' array and a 'metrics' array specifying which metrics to return

For the 'targets' array, reference a state variable or text area input that contains the list of domains. Parse newline-separated input into an array using a JavaScript expression in the body.

The 'metrics' array specifies which Moz metrics to return. Key metrics to request: domain_authority, page_authority, spam_score, links (total links), root_domains_to_root_domain (linking unique domains), external_links. Including only the metrics you need reduces response size and credit consumption.

The response returns a results array where each item corresponds to one target URL, containing the requested metric values. Map the results back to the original URL list using the array index.

Write a JavaScript transformer that maps the results to a display-ready array with formatted metric values. Bind to a Table component sorted by Domain Authority descending.

```
// POST /url_metrics request body
// References a TextArea component where users enter domains (one per line)
{
  "targets": {{ domainTextArea.value.split('\n').map(d => d.trim()).filter(Boolean).slice(0, 50) }},
  "metrics": [
    "domain_authority",
    "page_authority",
    "spam_score",
    "root_domains_to_root_domain",
    "external_links"
  ]
}

// ---
// JavaScript transformer for Moz URL Metrics response
const results = data?.results || [];
const targets = domainTextArea.value
  .split('\n')
  .map(d => d.trim())
  .filter(Boolean)
  .slice(0, 50);

return results.map((result, index) => ({
  domain: targets[index] || result.url || 'Unknown',
  domain_authority: result.domain_authority ?? 'N/A',
  page_authority: result.page_authority ?? 'N/A',
  spam_score: result.spam_score ?? 0,
  linking_domains: result.root_domains_to_root_domain ?? 0,
  total_links: result.external_links ?? 0,
  spam_risk: (result.spam_score || 0) > 7 ? 'High'
    : (result.spam_score || 0) > 4 ? 'Medium'
    : 'Low',
  quality_tier: (result.domain_authority || 0) >= 50 ? 'Premium'
    : (result.domain_authority || 0) >= 30 ? 'Good'
    : (result.domain_authority || 0) >= 10 ? 'Marginal'
    : 'Poor'
})).sort((a, b) => (b.domain_authority || 0) - (a.domain_authority || 0));
```

**Expected result:** A Table displays all entered domains with their Domain Authority, Page Authority, Spam Score, and computed Quality Tier, sorted by DA descending. Domains above DA 50 are easily identifiable as high-quality link prospects. The query consumes one Moz API credit per domain entered.

### 4. Track DA/PA changes over time using historical snapshots

To show DA/PA trends rather than just point-in-time values, build a historical tracking system using Retool Database or a connected PostgreSQL table. Each time the dashboard is refreshed, store the current Moz metrics alongside a timestamp — this builds a time series that shows whether domains are gaining or losing authority.

Create a Retool Database table (from the Resources panel → Add Resource → Retool Database) with columns: domain (text), domain_authority (integer), page_authority (integer), spam_score (integer), snapshot_date (date), and notes (text, optional).

After your Moz metrics query runs, add a button labeled 'Save Snapshot' that triggers a write query: INSERT INTO da_snapshots (domain, domain_authority, page_authority, spam_score, snapshot_date) VALUES using the current Moz results data. Use Retool's GUI mode for the insert query to prevent SQL injection.

Create a second query that reads historical snapshots for the selected domains from the database. Write a transformer that computes month-over-month DA change for each domain by comparing the latest snapshot to the snapshot from 30 days ago.

Add a Line Chart component showing DA trends over time for selected domains. The chart's X-axis is the snapshot_date and Y-axis is domain_authority, with one series per domain. This converts Moz's point-in-time API data into trend intelligence that shows which competitors are building authority and which are declining.

For automated daily snapshots without manual button clicks, set up a Retool Workflow on a schedule that queries Moz for a predefined list of domains and writes the results to the snapshots table automatically.

```
// JavaScript transformer to compute DA change from historical snapshots
// Combines current Moz data with historical snapshots from database

const currentData = mozMetricsQuery.data || []; // transformed results array
const historicalData = historicalSnapshotsQuery.data || []; // database results

return currentData.map(current => {
  // Find the snapshot from approximately 30 days ago for this domain
  const thirtyDaysAgo = new Date();
  thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30);

  const historicalEntry = historicalData
    .filter(h =>
      h.domain === current.domain &&
      new Date(h.snapshot_date) <= thirtyDaysAgo
    )
    .sort((a, b) => new Date(b.snapshot_date) - new Date(a.snapshot_date))[0];

  const prevDA = historicalEntry?.domain_authority ?? null;
  const daChange = (prevDA !== null && current.domain_authority !== 'N/A')
    ? current.domain_authority - prevDA
    : null;

  return {
    ...current,
    prev_da: prevDA !== null ? prevDA : 'No history',
    da_change: daChange !== null ? daChange : 'N/A',
    da_trend: daChange === null ? '—'
      : daChange > 0 ? `+${daChange} ▲`
      : daChange < 0 ? `${daChange} ▼`
      : 'No change'
  };
});
```

**Expected result:** The dashboard shows current DA/PA metrics alongside month-over-month change values. A trend chart visualizes DA movement over time for tracked domains. The database table accumulates daily snapshots that provide increasingly richer historical context.

### 5. Build a linking domains analysis panel

Extend the SEO dashboard with a linking domains panel that queries Moz for the top domains linking to a specific URL. This gives SEO teams visibility into where a domain's link equity is coming from, informing link acquisition strategy and competitor analysis.

Create a query using the Moz Links API resource:
- Method: POST
- Path: /linking_domains
- Body: JSON object specifying the target domain, metric fields to return, and pagination

The /linking_domains endpoint accepts a single target and returns a list of domains that link to it, along with each linking domain's DA and the number of links from that domain. This is useful for understanding a competitor's link profile.

Set the query to run 'Only when' a domain is selected from the main metrics Table ({{ domainTable.selectedRow !== null }}). This avoids running the linking domains query on every domain load — only run it when an analyst specifically wants to investigate a particular domain's link profile.

Write a transformer that sorts linking domains by their own DA score (highest first, as these are the most valuable links), formats the domain counts, and flags self-referential links (when the linking domain is the same as or a subdomain of the target). Display the results in a detail panel or slide-out drawer component.

This combination — the main DA tracking table plus the linking domains drill-down — gives SEO teams both the portfolio overview and the detailed backlink intelligence they need without leaving the Retool dashboard.

```
// POST /linking_domains request body
// Runs when a domain is selected from the main metrics table
{
  "target": "{{ domainTable.selectedRow?.domain || 'moz.com' }}",
  "target_scope": "domain",
  "limit": 50,
  "metrics": ["domain_authority", "spam_score", "links_to_target"],
  "sort": "domain_authority_desc"
}

// ---
// JavaScript transformer for linking domains response
const results = data?.results || [];
const targetDomain = domainTable.selectedRow?.domain || '';

return results.map(link => ({
  linking_domain: link.root_domain || link.url || 'Unknown',
  linking_da: link.domain_authority ?? 0,
  links_to_target: link.links_to_target ?? 0,
  spam_score: link.spam_score ?? 0,
  is_self_referential: targetDomain
    ? (link.root_domain || '').includes(targetDomain.replace(/^www\./, ''))
    : false,
  quality: (link.domain_authority || 0) >= 50 ? 'High DA'
    : (link.domain_authority || 0) >= 30 ? 'Medium DA'
    : 'Low DA'
})).sort((a, b) => b.linking_da - a.linking_da);
```

**Expected result:** Clicking a domain in the main metrics table triggers the linking domains query and displays the top linking domains in a detail panel. The panel shows linking domain, its DA score, number of links to the target, and quality tier. High-DA linking domains appear at the top, giving SEO teams an immediate view of the domain's link profile quality.

## Best practices

- Store Moz API credentials (Access ID and Secret Key) in Retool Configuration Variables marked as secret — never hardcode them in query bodies or resource configurations.
- Use Moz's batch URL Metrics endpoint (/url_metrics with multiple targets) rather than querying one domain at a time — batch queries consume the same credits as individual queries while requiring fewer API calls.
- Request only the metric fields you need by specifying the 'metrics' array in the request body — unnecessary metrics increase response size without adding value to your dashboard.
- Build historical DA snapshots into the dashboard using a Retool Database table — point-in-time Moz data is useful, but trend data showing DA change over weeks and months is significantly more actionable for SEO strategy.
- Cache Moz API responses for at least 24 hours using Retool's query caching feature — DA/PA metrics are updated monthly by Moz, so querying more frequently wastes credits without providing fresher data.
- Monitor your Moz API credit consumption from the API credentials page — set up a Retool Workflow to alert when credit usage exceeds 80% of the monthly limit, so you can throttle dashboard queries before hitting the cap.
- Normalize domain URLs before querying Moz — strip protocols (http://, https://), www. prefixes, and trailing slashes to ensure consistent results. Moz treats 'www.example.com' and 'example.com' differently in some metric calculations.

## Use cases

### Build a competitive domain authority tracking dashboard

Create a Retool panel that batch-queries Moz's URL Metrics API for a list of competitor domains, displaying their Domain Authority, Page Authority, Spam Score, and total linking domains in a sortable Table. Marketing managers use this for weekly competitive intelligence checks, tracking whether competitor DAs are rising or falling relative to their own domain. Add a Chart showing DA trends over time for selected domains.

Prompt example:

```
Build a competitive SEO tracker with a text area input for entering up to 20 domain URLs (one per line). Query the Moz API's URL Metrics endpoint for all entered domains in a single batch request. Display a Table sorted by Domain Authority descending, with columns for domain, DA, PA, Spam Score, total links, and linking domains. Add a line chart showing DA trends over time if historical data is stored in the internal database.
```

### Create a link prospect qualification panel

Build a Retool panel for link building teams that evaluates a list of potential link partner sites by their Moz metrics. Import a CSV of prospect URLs, query Moz for their DA/PA and Spam Score, and automatically flag high-quality prospects (DA > 40, Spam Score < 5) vs. low-quality or spammy sites. Link builders use this to prioritize outreach efforts without manually checking each domain in the Moz interface.

Prompt example:

```
Create a link prospect evaluator that accepts a list of URLs from a text input. Query Moz's URL Metrics API for all URLs. Display a results Table with domain, DA, PA, Spam Score, and a computed quality tier (Premium: DA>50, Good: DA 30-50, Marginal: DA 10-30, Poor: DA<10). Highlight spam-risk rows in red where Spam Score > 7. Add a CSV export button for the qualified prospect list.
```

### Build a client SEO health report dashboard

Create a Retool reporting dashboard for an SEO agency that pulls Moz metrics for all client domains stored in an internal PostgreSQL table and presents a portfolio health overview. The dashboard shows each client's current DA, comparison to the previous month (stored historically), and trend direction. Account managers use this for monthly client reporting without manually pulling Moz metrics for each client.

Prompt example:

```
Build a client SEO portfolio dashboard that reads all client domains from a PostgreSQL table. For each domain, query Moz's URL Metrics API. Join the current Moz data with historical DA values stored in a monthly_da_snapshots table to compute month-over-month change. Display a Table with client name, domain, current DA, previous month DA, change, and trend arrow. Color positive changes green, negative changes red.
```

## Troubleshooting

### Moz API returns 401 Unauthorized when making requests from Retool

Cause: The Basic Auth credentials are incorrect — either the Access ID or Secret Key is wrong, or there is extra whitespace in the credential values. The Moz API uses Basic Auth with Access ID as username and Secret Key as password.

Solution: Verify the Access ID and Secret Key are copied exactly from the Moz API credentials page (moz.com/products/pro/api). Check for leading or trailing spaces in the Configuration Variable values. Ensure the Access ID includes the full string (e.g., 'mozscape-' prefix). Test the credentials directly with a curl command from your terminal to isolate whether the issue is with the credentials themselves or the Retool resource configuration.

### URL Metrics query returns 'over_limit' or 429 error during a batch request

Cause: The batch request exceeded the 50 URL maximum per request, or the monthly API credit limit has been reached, or rate limiting has been triggered by too many requests in a short time window.

Solution: Split domain lists larger than 50 into multiple batches and query sequentially or in parallel. Check your remaining monthly credits at moz.com/products/pro/api. If rate-limited, add a delay between batch queries using Retool Workflow's Wait block. The Moz API allows a maximum of 10 requests per second — for rapid-fire batch queries, reduce the concurrency.

```
// Limit domains to 50 per request (Moz API maximum)
const allDomains = domainTextArea.value.split('\n').map(d => d.trim()).filter(Boolean);
const batch = allDomains.slice(0, 50); // only query first 50
```

### Domain Authority values in the response are null or undefined for some domains

Cause: Moz may not have data for newly created domains, very small domains with no links, or domains that have not been crawled recently. The Moz index is updated periodically, and domains with no link profile may show null DA values.

Solution: Add null handling in your transformer using the nullish coalescing operator: domain_authority: result.domain_authority ?? 0. Display 'N/A' or 0 for domains with no Moz data. Consider filtering these out in the display if null DA domains are not useful for your analysis, or flag them separately in the table.

```
// Handle null Moz metrics safely
const da = result.domain_authority ?? null;
return {
  domain_authority: da !== null ? da : 'N/A',
  da_numeric: da || 0 // use 0 for sorting/calculations
};
```

### Historical DA trend chart shows gaps or incorrect comparisons between dates

Cause: The snapshot dates in the database are not at consistent intervals, or the domain strings stored in the database don't exactly match the domain strings from the current Moz query (e.g., 'example.com' vs 'www.example.com').

Solution: Normalize domain strings before storing and querying — strip 'www.' prefixes and trailing slashes from all domains. Store normalized forms in the snapshot table and normalize the current Moz results the same way before joining. Add a data validation step when inserting snapshots that checks the domain format matches your normalization convention.

```
// Normalize domain string for consistent storage and comparison
function normalizeDomain(domain) {
  return domain
    .toLowerCase()
    .replace(/^https?:\/\//, '')
    .replace(/^www\./, '')
    .replace(/\/$/, '')
    .trim();
}
```

## Frequently asked questions

### What Moz plan do I need to access the API from Retool?

Moz API access is available on Moz Pro plans at the Standard tier and above. The Free plan does not include API access. Check the API credentials page at moz.com/products/pro/api — if you see an Access ID and Secret Key, your plan includes API access. The number of API rows included per month varies by plan tier; Standard plans include fewer rows than Medium or Large plans.

### What is the difference between Domain Authority (DA) and Page Authority (PA) in the Moz API?

Domain Authority measures the overall link profile strength of an entire domain (or subdomain), predicting how well the domain is likely to rank in search results. Page Authority measures the link profile strength of a specific page URL, not the whole domain. Both use a 0-100 logarithmic scale. For competitive domain comparison, use Domain Authority. For evaluating the link strength of specific pages (e.g., a competitor's homepage vs. their blog), use Page Authority. The Moz /url_metrics endpoint returns both metrics for each queried URL.

### How often does Moz update its DA and PA metrics?

Moz updates Domain Authority and Page Authority metrics approximately once per month, typically in the first week of each month. The Moz web crawler continuously indexes the web, but the DA/PA scores are recalculated on a monthly cycle. This means querying the Moz API more than once a month for the same domains won't return different scores — the values remain constant until the next monthly update. For historical tracking dashboards, a monthly snapshot is sufficient.

### What is Spam Score and how should I interpret it in my Retool dashboard?

Spam Score is a Moz metric on a 0-17 scale that represents the number of spam-associated features a domain exhibits, based on analysis of known spammy sites. A score of 0-4 is Low, 5-7 is Medium, and 8-17 is High. A high Spam Score suggests potential link scheme participation, thin content, or other patterns associated with search engine penalties. Use Spam Score to flag link prospects that may be risky to get links from. It is not a definitive indicator of spam — some legitimate sites have elevated scores — but it's a useful screening signal for link building outreach.

### Can I use Retool to bulk-update or create Moz lists and campaigns through the API?

The Moz API (Links API v2) focuses on retrieving link metrics, backlink data, and keyword information — it does not provide endpoints for managing Moz campaign lists, site tracking settings, or account-level configurations. Those are managed through the Moz Pro web interface. For campaign and list management, you would need to use the Moz web app directly. Retool integration is best suited for reading and analyzing Moz data, not managing Moz account settings.

---

Source: https://www.rapidevelopers.com/retool-integrations/moz
© RapidDev — https://www.rapidevelopers.com/retool-integrations/moz
