Générateur User-Agent

Générez des chaînes user-agent réalistes pour tests de scrapers et APIs

Generating Realistic User-Agent Strings for Testing

User-Agent strings identify the client making HTTP requests — but generating realistic ones for testing requires understanding the complex layering of browser, engine, platform, and compatibility tokens that modern browsers include. Whether you need to test how your server responds to mobile devices, verify bot detection logic, simulate specific browser versions for compatibility testing, or generate diverse UA strings for scraper development, a User-Agent Generator produces correctly formatted strings that match real browser patterns without requiring access to actual devices.

Select a browser, operating system, and device type to generate a realistic user-agent string matching that combination. Generate bot/crawler user-agents for testing Googlebot, Bingbot, and social media crawler detection. All generation uses hardcoded version data matching real browser release patterns — no external dependencies or API calls required.

Browser and Platform Combinations

The generator produces UA strings for all major browser/platform combinations:

  • Desktop browsers: Chrome, Firefox, Safari, Edge on Windows, macOS, and Linux
  • Mobile browsers: Chrome Mobile, Safari iOS, Samsung Internet, Firefox Mobile on Android and iOS
  • Tablet variants: iPad Safari, Android tablet Chrome with appropriate platform tokens
  • Legacy browsers: Internet Explorer 11, Edge Legacy for compatibility testing

Each generated string includes the correct engine tokens (Blink/Gecko/WebKit), platform identifiers (Windows NT version, macOS version, Linux kernel), and browser-specific tokens in the exact order real browsers use.

Bot and Crawler User-Agents

Testing bot detection and rendering requires accurate crawler UA strings:

  • Search engines: Googlebot (desktop and mobile), Bingbot, Yandex, Baidu Spider, DuckDuckBot
  • Social media: FacebookExternalHit, TwitterBot, LinkedInBot, WhatsApp
  • Monitoring: Pingdom, UptimeRobot, GTmetrix, PageSpeed Insights
  • Feed readers: Feedly, Feedbin, NewsBlur

Bot user-agents are particularly important for testing server-side rendering (SSR) logic that serves pre-rendered pages to crawlers, and for verifying that rate limiting or access controls correctly identify and handle automated traffic.

Testing Use Cases

Realistic user-agent generation serves multiple testing workflows:

  • Responsive design testing: Verify server-side device detection returns correct layouts for mobile, tablet, and desktop UAs
  • Feature detection: Test that your application serves appropriate polyfills or fallbacks for older browser versions
  • Analytics testing: Verify that your analytics system correctly categorizes traffic by browser, OS, and device type
  • Bot handling: Test that SEO bots receive pre-rendered content while real users get the interactive version
  • Rate limiting: Verify that your rate limiter does not treat different UAs from the same IP as different users
  • A/B testing verification: Confirm that experiments assign users consistently regardless of user-agent string variations

For web scraping development, rotating through diverse realistic user-agent strings helps avoid detection by anti-bot systems that flag repeated identical UA patterns. The generator produces strings with version numbers matching real browser release schedules, making them indistinguishable from genuine browser traffic.

Code Examples

Generated User-Agent String Examples

# Desktop Chrome on Windows 11:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

# Mobile Safari on iPhone (iOS 17):
Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1

# Firefox on Ubuntu Linux:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0

# Googlebot (Desktop):
Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

# Googlebot (Mobile — Smartphone):
Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Mobile Safari/537.36 (compatible; Googlebot/2.1)

# Using in HTTP requests:
curl -H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_0...)" https://example.com

Questions Fréquentes

Why would I need to generate user agent strings?

Generated user agent strings are useful for testing responsive designs, verifying bot detection logic, load testing with diverse client profiles, and ensuring your application handles different browsers correctly. They simulate real-world traffic patterns without needing actual devices.

Are the generated user agents realistic?

Yes. The generator produces user agent strings that match real-world formats with accurate version numbers, OS combinations, and rendering engine tokens. This ensures they pass basic validation checks and behave like genuine browser requests in your tests.

Can I generate bot user agents?

Yes. The generator can produce user agent strings for common crawlers and bots (Googlebot, Bingbot, etc.) in addition to standard browser user agents. This is useful for testing how your application responds to automated traffic and verifying crawler access rules.