feat: add POST /{engine}/parse HTML parser endpoints. One source of truth for browser and raw mode selectors

This commit is contained in:
Rustem Kamalov
2026-05-05 05:07:59 +03:00
parent 3eaa30118e
commit ed23af7acc
35 changed files with 1446 additions and 263 deletions

View File

@@ -213,6 +213,84 @@ paths:
$ref: "#/components/responses/NotFoundError"
"500":
$ref: "#/components/responses/InternalServerError"
/google/parse:
post:
tags: [Search]
operationId: parseGoogleHTML
summary: Parse a Google SERP HTML document into structured results
description: >
Accepts raw Google SERP HTML in the request body and returns a standard
search envelope. Useful when an upstream provider delivers raw HTML
rather than JSON. No browser is used; parsing is done with goquery.
The body size limit is 10 MB.
requestBody:
required: true
content:
text/html:
schema:
type: string
description: Raw Google SERP HTML page
parameters:
- $ref: "#/components/parameters/FormatQuery"
responses:
"200":
description: Parsed search results envelope
content:
application/json:
schema:
$ref: "#/components/schemas/SearchEnvelope"
text/markdown:
schema:
type: string
text/plain:
schema:
type: string
application/x-ndjson:
schema:
type: string
"400":
$ref: "#/components/responses/BadRequestError"
"500":
$ref: "#/components/responses/InternalServerError"
/bing/parse:
post:
tags: [Search]
operationId: parseBingHTML
summary: Parse a Bing SERP HTML document into structured results
description: >
Accepts raw Bing SERP HTML in the request body and returns a standard
search envelope. Useful when an upstream provider delivers raw HTML
rather than JSON. No browser is used; parsing is done with goquery.
The body size limit is 10 MB.
requestBody:
required: true
content:
text/html:
schema:
type: string
description: Raw Bing SERP HTML page
parameters:
- $ref: "#/components/parameters/FormatQuery"
responses:
"200":
description: Parsed search results envelope
content:
application/json:
schema:
$ref: "#/components/schemas/SearchEnvelope"
text/markdown:
schema:
type: string
text/plain:
schema:
type: string
application/x-ndjson:
schema:
type: string
"400":
$ref: "#/components/responses/BadRequestError"
"500":
$ref: "#/components/responses/InternalServerError"
/mega/search:
get:
tags: [Mega]