feat(api): v2 response shape - absolute rank, ad/organic split, slimmer fields

This commit is contained in:
Rustem Kamalov
2026-05-13 01:30:54 +03:00
parent 00630a5d31
commit b3ca4e0803
36 changed files with 972 additions and 279 deletions

View File

@@ -83,7 +83,7 @@ Engine parsers return the older internal shape:
- `Description`
- `Ad`
HTTP handlers convert this into the public v1 response through `core/response_builder.go`.
HTTP handlers convert this into the public v2 response through `core/response_builder.go`.
## HTTP Request Flow
@@ -118,7 +118,7 @@ HTTP request
## Public API Response
JSON endpoints return a v1 envelope.
JSON endpoints return a v2 envelope.
Top-level fields:
@@ -192,7 +192,7 @@ Only JSON responses use the response cache. Cached JSON refreshes request-scoped
`core/enrichment_domain.go` derives:
- `domain_info`: public suffix, SLD, and category booleans
- `domain_info`: public suffix, SLD, and collapsed category
- `classification`: content type and known source hint
Public suffix parsing uses `golang.org/x/net/publicsuffix`.