Component evidence

DataForSEO Backlinks Target Normalizer (lib/dataforseoBacklinksTarget.ts)

open-seo · src/server/lib/dataforseoBacklinksTarget.ts · typescript · MIT
integrationscrapingcrmtag:dataforseotag:backlinkstag:url-parsingtag:normalization

Parses and normalizes a backlinks research target into API/display forms, resolving scope, subdomain inclusion, and path prefix for DataForSEO backlink queries.

Source preview first 800 characters · full source over MCP
// Source: https://github.com/every-app/open-seo | License: MIT | Copyright 2026 Ben Senescu
// Provided via justclaw.it.com; keep this notice with the code.
import { AppError } from "@/server/lib/errors";
import {
  resolveBacklinksScope,
  type BacklinksScopeWithLegacy,
} from "@/types/schemas/backlinks";
import {
  parseResearchTarget,
  type ResearchScope,
} from "@/shared/researchScope";

type NormalizedBacklinkTarget = {
  apiTarget: string;
  displayTarget: string;
  scope: ResearchScope;
  /** DataForSEO `include_subdomains`; ignored by the API for page targets. */
  includeSubdomains: boolean;
  /**
   * Subfolder scope only: the normalized path driving the url_to/url prefix
   * filters (the API itself has no prefix targeting). `""` for other scopes.
   */
  path: string;
};

typ

... (truncated -- full source via MCP)