API: utils/domainProfile

better-web-search-mcp


better-web-search-mcp / utils/domainProfile

utils/domainProfile#

Interfaces#

DomainProfile#

Defined in: src/utils/domainProfile.ts:20

A per-domain capability profile.

Properties#

PropertyTypeDescriptionDefined in
api_patternsstring[]API endpoint patterns discovered for this domain.src/utils/domainProfile.ts:28
best_methodBestMethodThe extraction method that worked best on the last visit.src/utils/domainProfile.ts:30
frameworkFrameworkThe framework detected from HTML markers.src/utils/domainProfile.ts:24
has_json_ldbooleanWhether the page embeds JSON-LD structured data.src/utils/domainProfile.ts:26
requires_jsbooleanWhether the page needs JavaScript to produce content.src/utils/domainProfile.ts:22

ExtractionResult#

Defined in: src/utils/domainProfile.ts:34

The outcome of an extraction, used to build the profile.

Properties#

PropertyTypeDescriptionDefined in
apiPatternsstring[]API endpoint patterns discovered for this domain.src/utils/domainProfile.ts:38
bestMethodBestMethodThe extraction method that worked best on this visit.src/utils/domainProfile.ts:40
hasJsonLdbooleanWhether the page embeds JSON-LD structured data.src/utils/domainProfile.ts:36

Type Aliases#

BestMethod#

BestMethod = "hydration_data" | "readability" | "browser_api_intercept"

Defined in: src/utils/domainProfile.ts:14

The extraction method that worked best for a domain.


Framework#

Framework = "Next.js:Pages" | "Next.js:App" | "Nuxt" | "unknown"

Defined in: src/utils/domainProfile.ts:11

Frameworks the profiler can recognize from HTML markers.

Functions#

detectFramework()#

detectFramework(html): Framework

Defined in: src/utils/domainProfile.ts:61

Detect the framework a page runs on from HTML markers.

  • __NEXT_DATA__ → Next.js (Pages Router)
  • self.__next_f → Next.js (App Router)
  • __NUXT__ → Nuxt
  • otherwise → unknown

Parameters#

ParameterType
htmlstring

Returns#

Framework


profileFor()#

profileFor(domain, html, extractionResult): DomainProfile

Defined in: src/utils/domainProfile.ts:85

Build a domain profile from the raw HTML and the outcome of an extraction.

requires_js is true when the page’s visible text (after stripping tags, scripts, and styles) is shorter than 500 characters — a strong signal the content is rendered client-side. framework comes from the HTML markers, has_json_ld and api_patterns from the extraction result, and best_method records which extraction strategy worked best. The domain argument is kept in the signature for call-site stability and future per-domain merging.

Parameters#

ParameterType
domainstring
htmlstring
extractionResultExtractionResult

Returns#

DomainProfile