# Keyword, Competitor and Backlink Explorers

These three workspaces add external research to the local operator edition.
They use your own encrypted DataForSEO connection. No provider account, balance,
subscription, ranking guarantee or paid request is included. No private analytics
or page content is sent: each request carries only the explicit research query
and its displayed scope. Search results remain distinct from GSC/GA4 measurements.

## Workspaces

**Keyword Explorer** has four modes: a bulk overview (up to 20 keywords, one per
line), seed-keyword suggestions, related searches and topic ideas. Where supplied,
rows include estimated monthly volume, CPC in USD, paid competition, organic
keyword difficulty, intent, provider update time and up to 36 months of volume.
Local filters cover text, minimum volume, maximum difficulty, intent and English
question keywords. Missing values remain unavailable; zero stays zero.

**Competitor Explorer** has domain overview, ranked organic keywords, top pages,
search competitors and keyword gaps. A gap request uses the first domain as the
competitor with keywords and the second as the comparison domain missing them.
The provider searches its database; absence does not prove no real-world ranking.
Traffic and ad-equivalent values are provider estimates, not measured visits or
revenue. Overview includes ranking counts for positions 1–3, 1–10 and 1–20 when
provided. Repeated identical captures can be compared, row by row, in the UI.

**Backlink Explorer** has profile totals, individual backlinks, referring domains,
anchor text and monthly link history (up to 366 days per request). Select exact
domain/subdomains and live/all/lost status, plus dofollow/nofollow filters. Individual
backlinks also support new and broken-link filters. The provider's first/last seen,
broken/lost flags and index counts may lag the web. Rank is requested on the
provider's 0–100 scale. Spam scores are provider heuristics, not Google judgments
or automatic recommendations to disavow links.

All three retain dated local history. Reopen exact saved results without another
provider request, sort/filter locally, or export the filtered table to CSV and the
full normalized capture/provenance to JSON. CSV cells protect spreadsheet formula
prefixes. Rows can be added to a shortlist with revision-checked notes. A shortlist
item can create a deduplicated editorial-review task for an audited real website.
Neither saving, exporting nor task creation publishes content or sends outreach.

## Setup and billing

1. Open an Explorer → **Usage & connection**. Save your own API login/password.
   This reuses the same encrypted DataForSEO connection as Growth monitoring.
   Labs and Backlinks may require separate product activation, balance or fees
   with the provider; successful access to one does not establish access to all.
2. Review the shared Explorer monthly call cap and planning budget (default 100
   attempts / USD 10). This is separate from each Growth monitoring budget.
3. Select a research mode, keyword/domain and scope. Common geographic codes are
   shown, and custom provider-supported location/language codes can be entered.
4. Approve that exact input and its per-request allowance. **Run research — paid**
   queues one provider task. The local worker must be running. Every refresh and
   next provider page needs a new approval; opening saved data is free of new API
   requests. Pagination returns 10, 50 or 100 rows, with offsets up to 10,000.
5. Compare reported costs with the provider's bill. The request allowance is a
   local planning reservation, not a price quote or invoice ceiling. Unknown
   charges after timeouts or malformed responses remain possible. No retry is
   automatic. Set billing controls with DataForSEO too.

## Persistence and failure behavior

Explorer state is an optional field in the existing SQLite application state;
existing installations need no migration. No customer data is replaced. Bounds:
60 research captures, 100 returned rows per paged capture, 500 shortlist entries,
500 recent request records and 10 active queued requests. Export/remove captures
when full. Shortlist evidence survives deletion of its source capture.

The API validates inputs and only uses a fixed allowlist of provider endpoints.
Responses are bounded to 2.5 MB and requests time out after 60 seconds. No endpoint,
custom filter expression or arbitrary request URL can be supplied by the browser.
Only normalized bounded fields are retained; provider error bodies are not shown.

The worker atomically claims a request and reserves the allowance in the UTC-month
ledger before external IO. An idempotency key and active-query deduplication
prevent duplicate enqueue operations. Provider credentials are fingerprinted.
Cancellation, pause, provider changes or expired ownership prevent publication.
Expired requests fail permanently; no ambiguous paid call is retried. Known costs
are retained even if the output is discarded. An overage raises the recorded
allowance and pauses new Explorer work until the operator reviews settings.

**Pause & cancel active requests** prevents results from pending/running work.
A request already sent to the provider may still incur a charge. Merely changing
usage caps preserves prior spending and cannot undo a sent request.

## Provider contracts and validation

DataForSEO reference documentation:

- [Keyword overview](https://docs.dataforseo.com/v3/dataforseo_labs/google/keyword_overview/live/),
  [suggestions](https://docs.dataforseo.com/v3/dataforseo_labs/google/keyword_suggestions/live/),
  [related keywords](https://docs.dataforseo.com/v3/dataforseo_labs/google/related_keywords/live/),
  [ideas](https://docs.dataforseo.com/v3/dataforseo_labs/google/keyword_ideas/live/).
- [Domain overview](https://docs.dataforseo.com/v3/dataforseo_labs/google/domain_rank_overview/live/),
  [ranked keywords](https://docs.dataforseo.com/v3/dataforseo_labs/google/ranked_keywords/live/),
  [relevant pages](https://docs.dataforseo.com/v3/dataforseo_labs/google/relevant_pages/live/),
  [competitors](https://docs.dataforseo.com/v3/dataforseo_labs/google/competitors_domain/live/),
  [domain intersection](https://docs.dataforseo.com/v3/dataforseo_labs/google/domain_intersection/live/).
- [Backlink summary](https://docs.dataforseo.com/v3/backlinks/summary/live/),
  [backlinks](https://docs.dataforseo.com/v3/backlinks/backlinks/live/),
  [referring domains](https://docs.dataforseo.com/v3/backlinks/referring_domains/live/),
  [anchors](https://docs.dataforseo.com/v3/backlinks/anchors/live/),
  [history](https://docs.dataforseo.com/v3/backlinks/timeseries_summary/live/).

`tests/explorers.test.ts` covers contracts, missing/zero metrics, scope validation,
request approval, idempotency, costs/limits, cancellation, credential changes,
expired leases, shortlist and task behavior, CSV safety and request authentication.
`npm run test:explorers-ui` uses isolated temporary storage and a synthetic provider
with the actual API routes and browser. It exercises all modes, history/cache,
filters, notes, export, task handoff and responsive layouts. Development checks
make no paid calls and do not establish live provider entitlement or availability.

Local verification for this change: 180 tests and application/connector typechecks
pass, as does the production build. Official documented response examples were
parsed for eleven endpoints. The isolated Explorer browser test covers all 14
research modes; existing growth/content/intelligence and monitoring browser suites
also pass. Tests use no customer credentials or paid DataForSEO calls. The running
local app responds and its worker heartbeat is current.
