serpcraft
A typed TypeScript CLI and library that scrapes and parses Google, Bing and DuckDuckGo into clean structured JSON.
// stack
// architecture
Per-engine parsers behind a shared base parser · typed core and result models · user-agent rotation and request pacing · dedicated error hierarchy · CLI with table and JSON output, single-engine or all-engines · Jest test suite
// overview
Getting structured search results programmatically means either an expensive API or a brittle custom scraper. serpcraft is the second thing done properly: one parser per engine behind a shared base parser, a typed core, user-agent rotation and pacing in the HTTP layer, its own error hierarchy, and a CLI that can query all three engines at once and render either a table or JSON.
// what was built
- ·Three engines — Google, Bing, DuckDuckGo — each with its own parser behind a common base, so adding an engine means adding a parser rather than touching the core.
- ·A typed result model means callers get the same structured shape regardless of which engine produced it.
- ·User-agent rotation and deliberate request pacing in the HTTP layer.
- ·A dedicated error hierarchy, so a parse failure and a network failure are distinguishable by type.
- ·Usable as both a CLI and a library, with table or JSON output and the ability to query every engine simultaneously.