The user-agents npm package generates weighted random User-Agent strings and fingerprint fields, refreshed daily from real-world browser traffic.
Overview
User Agents is a JavaScript library for picking random User-Agent headers and related browser fingerprint properties that reflect how often each profile appears in live traffic. A new package release is published each day so datasets stay current instead of aging over months.
Instantiation with optional filters yields a random agent and data object; filters can target device category, platform, regex patterns, custom functions, or combined arrays. Reusing a configured instance makes bulk generation much faster than rebuilding filters each time. Helpers return top-frequency agents from a filtered set.
The dataset comes from a rolling snapshot of roughly the last day of traffic, weighted by real usage frequency rather than uniform random choice. That skews results toward common browsers such as Chrome on Windows while still allowing niche profiles. Properties beyond the header string support richer emulation in automation and scraping.
The package is distributed on npm for Node and bundler workflows. Frequency data is provided by Intoli; high-traffic sites can contribute additional sources.
Key features
- Daily refreshed user-agent dataset
- Traffic-weighted random selection
- Browser fingerprint data fields
- Filter by device and platform
- Regex and custom filter functions
- Efficient bulk regeneration
- Top-frequency agent queries
- npm installable package
Use cases
- Realistic web scraping traffic
- Browser automation fingerprinting
- Testing with varied user agents
- Platform-specific agent generation