Get an up-to-date list of top user agents
$ dotnet add package Arcasharp.UserAgentsArcasharp.UserAgents is a C# library that provides a collection of top user agents and methods to retrieve them. This package is based on the data provided by top-user-agents.
To get started with Arcasharp.UserAgents, follow these steps:
Install the package via NuGet:
dotnet add package Arcasharp.UserAgents
Add the necessary using directive in your code:
using Arcasharp.UserAgents;
Returns any of the top user-agents, at random.
string userAgent = UserAgents.PickAny();
Console.WriteLine(userAgent);
Returns all known top user-agents.
ReadOnlyCollection<string> userAgents = UserAgents.GetTopUserAgents();
foreach (var userAgent in userAgents)
{
Console.WriteLine(userAgent);
}
Returns the top user-agent.
string topUserAgent = UserAgents.GetTopUserAgent();
Console.WriteLine(topUserAgent);
Special thanks to Kiko Beats and top-user-agents contributors.