Skip to content

fix: align Domain API schemas with BuiltWith v23 docs - #22

Merged
zcaceres merged 3 commits into
mainfrom
fix/domain-api-v23-schema-alignment
Jul 8, 2026
Merged

fix: align Domain API schemas with BuiltWith v23 docs#22
zcaceres merged 3 commits into
mainfrom
fix/domain-api-v23-schema-alignment

Conversation

@zcaceres

@zcaceres zcaceres commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

Audited the code against the current BuiltWith Domain API v23 docs, then validated DomainResponseSchema against live payloads. Response schemas use z.strictObject(), so any field the live API returns that the code omits makes domain() / domainLive() throw on parse.

Doc audit — missing fields / params

  • Meta: add Umbrella (Global Router traffic rank)
  • Attributes: add EcommerceCategory, TTFB, SourceBytes
  • DomainParams: add includeTrustTRUST query param (inlines Trust data, extra API credit)
  • FDRANGE/LDRANGE: v23 joins dates with a pipe (YYYY-MM-DD|YYYY-MM-DD); the regex previously accepted/passed a dash join, which v23 rejects
  • Docs (cli.md, library.md) + tests updated

Live validation — 39-domain sweep (parked, foreign, ecommerce, SaaS, media, blog, gov/edu, nonprofit)

BuiltWith omits any field it lacks data for, so several fields the docs list as present are domain-dependent. Marked optional based on real absences:

  • Meta.Umbrella — absent on all sampled domains (docs overstate it)
  • Meta.Social — absent on 8/39
  • Attributes.Employees — absent on cnn.com (pre-existing latent bug: was non-optional)
  • Attributes.Followers — absent on neverssl.com

Sweep surfaced zero unknown keys across 39 domains, confirming the strictObject field set is complete for v23. strictObject still rejects genuinely new keys, so drift detection is unaffected.

Test plan

  • bun run lint / build / test — clean, 152 pass
  • Live parse check: cnn.com, allbirds.com, example.com, neverssl.com, stripe.com + 34 more all parse ✅
  • Added test asserting pipe range parses and legacy dash range is rejected

zcaceres added 3 commits July 8, 2026 08:47
Response schemas use z.strictObject(), so fields the live v23 API returns
but the code omits cause domain()/domainLive() to throw on parse. Add the
missing fields and correct the date-range separator.

- Meta: add Umbrella (Global Router traffic rank)
- Attributes: add EcommerceCategory, TTFB, SourceBytes
- DomainParams: add includeTrust -> TRUST query param
- FDRANGE/LDRANGE: pipe-joined YYYY-MM-DD|YYYY-MM-DD, not dash-joined
- Update CLI/library docs and tests to match
Validated DomainResponseSchema against live v23 payloads (cnn.com,
allbirds.com, example.com, neverssl.com, stripe.com). BuiltWith omits any
field it has no data for, so several fields the docs list as present are
domain-dependent:

- Meta.Umbrella: absent on all sampled domains -> optional (docs overstate it)
- Attributes.Employees: absent on cnn.com (pre-existing latent bug) -> optional
- Attributes.Followers: absent on neverssl.com -> optional

strictObject still rejects genuinely new/unknown keys, so drift detection
is unaffected.
39-domain live sweep (parked, foreign, ecommerce, SaaS, media, blog,
gov/edu, nonprofit): Meta.Social absent on 8 domains (example.org/net,
iana.org, rakuten.co.jp, naver.com, wikipedia.org, reddit.com,
overreacted.io). Sweep surfaced zero unknown keys, confirming the
strictObject field set is complete for v23.
@zcaceres
zcaceres merged commit fda9538 into main Jul 8, 2026
1 check passed
@zcaceres
zcaceres deleted the fix/domain-api-v23-schema-alignment branch July 8, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant