Catalog DR refresh for Backlinks Hub Page
Refresh domain rating on link directory sites from DataForSEO using the CLI or action from admin UI.
Connect your agent today
Draft from chat, review in your calendar, and publish only what you approve.
What this does
The catalog refresh updates domain rating (DR) on link_directory_sites for each Build Backlinks destination. OpenQuok reads the hostname from site_url, looks up or fetches DR through the global Directory SEO cache, then stores a rounded score on the site row.
Customers see that DR on the public hub, site detail pages, and the My Products directory grid. This path is separate from Directory analytics on a workspace (product URL and competitors).
Before you start
Set on the machine that runs the script (usually the same env as the backend API):
| Variable | Role |
|---|---|
| DATAFORSEO_API_KEY | DataForSEO credentials. When empty, the script uses an existing snapshot only. It does not call the provider. |
| DIRECTORY_SEO_ENABLED | Must be true for live lookups. |
The global cache TTL is DIRECTORY_SEO_CACHE_TTL_HOURS (default 7 days). Without --force, the script skips a paid API call when the snapshot is still fresh.
Warning
Each forced or stale refresh can bill DataForSEO. Test with --dry-run or --slug=… before you refresh every site.
Editors with the editor role can also run Refresh catalog DR on Secret admin → Link directory → Sites. That action calls the same backend service with published sites only and force enabled.
Run the CLI script
From the repo root:
pnpm --filter ./backend run script:refresh-link-directory-catalog-dr Equivalent:
pnpm --filter ./backend exec tsx scripts/refresh_link_directory_catalog_dr.ts Load backend/.env.development.local (or production env) so the script sees DataForSEO keys.
Command flags
| Flag | Effect |
|---|---|
| --force | Ignore the snapshot TTL. Call DataForSEO when the key is set. |
| --published-only | Process only rows where is_admin_published is true. |
| --slug=producthunt | Refresh one site by slug. |
| --site-id=<uuid> | Refresh one site by id. |
| --dry-run | Run lookups but do not write link_directory_sites. Snapshots may still update. |
Combine flags as needed. Example:
pnpm --filter ./backend run script:refresh-link-directory-catalog-dr -- --published-only --force What the database stores
Catalog site row
When the run succeeds and dry-run is off, each processed site updates:
| Column | Value |
|---|---|
| domain_rating | Rounded integer DR |
| metrics_updated_at | Time from the snapshot |
| metrics_source | dataforseo |
The script does not change domain_authority, monthly_visits, or other site copy fields. Enter DA and traffic in the site editor when you maintain them by hand.
Global DR cache
For each hostname, DirectorySeoService.refreshDomain may upsert seo_domain_metric_snapshots when the cache is stale or you use --force. It may append a row to seo_domain_metric_history after a live refresh. It does not run timeseries history backfill (that runs when a user opens Directory analytics charts).
Manual DR in the editor
You can type DR on a site in secret-admin. That value stays until the next catalog refresh overwrites domain_rating. Use manual entry when you have no DataForSEO key or you need a one-off correction.