There is @jnrbsn's feed https://jnrbsn.github.io/user-agents/user-agents.json (@Matteus also recommended).
This project is a cron-based GitHub hosted scraper that gets its latest user agent strings from whatismybrowser.com and dumps it into json file
Includes permutations of user agent strings for Firefox, Chrome, Edge, and Safari with Linux, MacOS, and Windows operating systems
🔔 Note that using this feed potentially exposes you to legal risk as whatismybrowser.com has similar commercial offering via API subscription https://explore.whatismybrowser.com/useragents/explore/
Personally, for one of my non-profit experiment projects, I needed something like this and I decided to use @jnrbsn's feed. I needed to keep my user-agent string in my Python script up to date to the latest Chrome on Windows version.
Sharing the short (and Naïve) Python function I wrote to provide that for me:
import requests
def get_latest_user_agent(operating_system='windows', browser='chrome'):
url = f'https://jnrbsn.github.io/user-agents/user-agents.json'
r = requests.get(url)
r.raise_for_status()
user_agents = r.json()
for user_agent in user_agents:
if operating_system.lower() in user_agent.lower() and browser.lower() in user_agent.lower():
return user_agent
return None
print(get_latest_user_agent(operating_system='windows', browser='chrome'))
print(get_latest_user_agent(operating_system='linux', browser='chrome'))
print(get_latest_user_agent(operating_system='mac', browser='chrome'))
outputs:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36