user-agents icon indicating copy to clipboard operation
user-agents copied to clipboard

How to get the first 500 most-common user agents

Open LeMoussel opened this issue 6 years ago • 5 comments

Hi,

I do this userAgent = new UserAgents({ deviceCategory: 'desktop', userAgent: /^Mozilla/ }); to get Mozilla user agent on desktop device.

I want to get the first 500 most-common/recent Mozilla user agent on desktop device. To do that I probably need to do the filtering using the custom function.

I don't know how to filter to get the first 500 most-common/recent Mozilla user agent on desktop device.

Can you help me?

LeMoussel avatar Feb 20 '19 10:02 LeMoussel

This isn't supported by the current API, but it's a good feature suggestion.

sangaline avatar Feb 21 '19 17:02 sangaline

I see your blog post User-Agents — A random user agent generation library that's always up to date but I couldn't find any information about the UA file description.

In this file, does the UAs are sorted based on the weight?

LeMoussel avatar Feb 22 '19 06:02 LeMoussel

Yes, they are sorted based on weight. If you would like to parse the user-agents.json.gz file directly, then you can safely assume that they are sorted by decreasing weight. The weight is also included in each JSON entry.

sangaline avatar Feb 22 '19 17:02 sangaline

What is my user agent tool is giving you popular User Agent list on global scale.

web-apply avatar Mar 07 '20 08:03 web-apply

A related use case would be to get the 500 most recent UAs.

I assume the weight relates to the frequency the UAs are observed, rather than their age.

lonix1 avatar Mar 15 '23 03:03 lonix1