Sobes.tech
Junior

Where can I find information about which user agents can be used in requests?

sobes.tech AI

Answer from AI

Sources of information about user agents:

  1. Official documentation of browsers and platforms: Developer sites (Mozilla Developer Network, Google Developers) contain up-to-date data.
  2. Specialized databases and repositories: There are online resources that aggregate lists of User-Agent strings (e.g., User-Agent String.com, WhatIsMyBrowser.com).
  3. Web traffic analytics: Analytics tools (Google Analytics, Yandex.Metrica) allow you to see which User-Agents real users of your site are using.
  4. HTTP headers of real requests: Interception and analysis of HTTP requests (using browser developer tools or network sniffers like Wireshark) show User-Agents used by clients.
  5. Frameworks and libraries for web scraping/testing: Some libraries (e.g., Scrapy in Python) have built-in or easily integrable lists of User-Agents.

Examples of User-Agent strings:

  • Chrome on Windows:
    // Chrome 121.0.0.0 on Windows 10
    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
    
  • Firefox on macOS:
    // Firefox 122.0 on macOS
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:122.0) Gecko/20100101 Firefox/122.0
    
  • Safari on iOS:
    // Safari on iPhone
    Mozilla/5.0 (iPhone; CPU iPhone OS 17_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Mobile/15E148 Safari/604.1
    

The choice of specific User-Agents depends on testing goals (emulating certain browsers, devices, versions, etc.).