API: utils/domainProfile
better-web-search-mcp / utils/domainProfile
utils/domainProfile#
Interfaces#
DomainProfile#
Defined in: src/utils/domainProfile.ts:20
A per-domain capability profile.
Properties#
| Property | Type | Description | Defined in |
|---|---|---|---|
api_patterns | string[] | API endpoint patterns discovered for this domain. | src/utils/domainProfile.ts:28 |
best_method | BestMethod | The extraction method that worked best on the last visit. | src/utils/domainProfile.ts:30 |
framework | Framework | The framework detected from HTML markers. | src/utils/domainProfile.ts:24 |
has_json_ld | boolean | Whether the page embeds JSON-LD structured data. | src/utils/domainProfile.ts:26 |
requires_js | boolean | Whether 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#
| Property | Type | Description | Defined in |
|---|---|---|---|
apiPatterns | string[] | API endpoint patterns discovered for this domain. | src/utils/domainProfile.ts:38 |
bestMethod | BestMethod | The extraction method that worked best on this visit. | src/utils/domainProfile.ts:40 |
hasJsonLd | boolean | Whether 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#
| Parameter | Type |
|---|---|
html | string |
Returns#
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#
| Parameter | Type |
|---|---|
domain | string |
html | string |
extractionResult | ExtractionResult |