An open API service indexing awesome lists of open source software.

https://github.com/aero25x/random-user-agents

Randomize your user agents in your script to make yourself less noticeable
https://github.com/aero25x/random-user-agents

js-useragent python-user-agent python-useragent python-users random-user random-user-agent random-useragents rust rust-random-user-agent rust-user-agent ts-useragent ua-generator user-agent user-agent-generator useragent useragent-changer useragent-generator useragent-parser useragents

Last synced: 4 months ago
JSON representation

Randomize your user agents in your script to make yourself less noticeable

Awesome Lists containing this project

README

          

# Random User Agent Generator - Python, JavaScript, Rust, TypeScript, Go

[![Join our Telegram](https://img.shields.io/badge/Telegram-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white)](https://t.me/hidden_coding)
[![GitHub](https://img.shields.io/badge/GitHub-181717?style=for-the-badge&logo=github&logoColor=white)](https://github.com/aero25x)
[![Twitter](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=x&logoColor=white)](https://x.com/aero25x)
[![YouTube](https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@flaming_chameleon)
[![Reddit](https://img.shields.io/badge/Reddit-FF3A00?style=for-the-badge&logo=reddit&logoColor=white)](https://www.reddit.com/r/HiddenCode/)
[![GitHub Stars](https://img.shields.io/github/stars/Aero25x/random-user-agents?style=for-the-badge)](https://github.com/Aero25x/random-user-agents/stargazers)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)

> **Generate realistic random user agents for web scraping, browser automation, and testing. Supports Chrome, Firefox, Safari on Android, iOS, Windows, macOS, Linux, and Ubuntu devices.**

๐ŸŒ **[Try Online Generator](https://multitools.ovh/random-user-agent-generator/)** | ๐Ÿ“š **[Documentation](#usage)** | ๐Ÿค **[Contributing](#contributing)**

## ๐Ÿš€ Why Random User Agent Generator?

**Random User Agent Generator** is a lightweight, cross-platform library for generating authentic browser user agent strings. Perfect for:

- ๐Ÿ•ท๏ธ **Web Scraping** - Rotate user agents to avoid detection and blocking
- ๐Ÿค– **Browser Automation** - Selenium, Puppeteer, Playwright testing with realistic agents
- ๐Ÿงช **API Testing** - Test endpoints with different client configurations
- ๐Ÿ”’ **Privacy Tools** - Mask browser fingerprints and enhance anonymity
- ๐Ÿ“Š **Analytics Testing** - Simulate traffic from various devices and browsers

### โœจ Key Features

โœ… **Multi-language support** - Python, JavaScript, TypeScript, Rust, Go
โœ… **Realistic user agents** - Based on real browser version distributions
โœ… **Device targeting** - Android, iOS, Windows, macOS, Linux, Ubuntu
โœ… **Browser selection** - Chrome, Firefox, Safari, Edge support
โœ… **Zero dependencies** - Lightweight and fast
โœ… **MIT License** - Free for commercial use
โœ… **Actively maintained** - Regular updates with latest browser versions

## ๐Ÿ“ฆ Installation

### Python (pip)

```bash
git clonse https://github.com/Aero25x/random-user-agents.git
```

```python
from random_user_agents import generate_random_user_agent

# Generate random user agent
user_agent = generate_random_user_agent()
print(user_agent)

# Specific device and browser
android_chrome = generate_random_user_agent(device_type='android', browser_type='chrome')
ios_safari = generate_random_user_agent(device_type='ios', browser_type='safari')
```

### JavaScript / Node.js (npm)

```bash
git clonse https://github.com/Aero25x/random-user-agents.git
```

```javascript
const { generateRandomUserAgent } = require('random-user-agents');

// Random user agent
console.log(generateRandomUserAgent());

// Chrome on Windows
console.log(generateRandomUserAgent('windows', 'chrome'));

// Firefox on Linux
console.log(generateRandomUserAgent('linux', 'firefox'));
```

### TypeScript

```bash
git clonse https://github.com/Aero25x/random-user-agents.git
```

```typescript
import { generateRandomUserAgent } from 'random-user-agents';

const userAgent: string = generateRandomUserAgent('android', 'chrome');
console.log(userAgent);
```

### Rust (Cargo)

```bash
git clonse https://github.com/Aero25x/random-user-agents.git
```

```rust
use random_user_agents::generate_random_user_agent;

fn main() {
let user_agent = generate_random_user_agent(None, None);
println!("{}", user_agent);

// Android Chrome
let android_ua = generate_random_user_agent(Some("android"), Some("chrome"));
println!("{}", android_ua);
}
```

### Go (Golang)

```bash
go get github.com/Aero25x/random-user-agents
```

```go
package main

import (
"fmt"
rua "github.com/Aero25x/random-user-agents"
)

func main() {
// Random user agent
userAgent := rua.GenerateRandomUserAgent(nil, nil, nil, nil)
fmt.Println(userAgent)

// Android Chrome with version range
deviceType := "android"
browserType := "chrome"
chromeVersions := []int{120, 130}

ua := rua.GenerateRandomUserAgent(&deviceType, &browserType, chromeVersions, nil)
fmt.Println(ua)
}
```

### Manual Installation (Git Clone)

```bash
git clone https://github.com/Aero25x/random-user-agents.git
cd random-user-agents
```

## ๐Ÿ’ก Usage Examples

### Web Scraping with Python (Requests)

```python
import requests
from random_user_agents import generate_random_user_agent

headers = {
'User-Agent': generate_random_user_agent()
}

response = requests.get('https://example.com', headers=headers)
print(response.status_code)
```

### Selenium Browser Automation

```python
from selenium import webdriver
from random_user_agents import generate_random_user_agent

options = webdriver.ChromeOptions()
options.add_argument(f'user-agent={generate_random_user_agent("windows", "chrome")}')

driver = webdriver.Chrome(options=options)
driver.get('https://example.com')
```

### Puppeteer with JavaScript

```javascript
const puppeteer = require('puppeteer');
const { generateRandomUserAgent } = require('random-user-agents');

(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();

await page.setUserAgent(generateRandomUserAgent('windows', 'chrome'));
await page.goto('https://example.com');

await browser.close();
})();
```

### Axios HTTP Client

```javascript
const axios = require('axios');
const { generateRandomUserAgent } = require('random-user-agents');

axios.get('https://api.example.com', {
headers: {
'User-Agent': generateRandomUserAgent()
}
}).then(response => {
console.log(response.data);
});
```

### Fetch API (Browser/Node.js)

```javascript
fetch('https://api.example.com', {
headers: {
'User-Agent': generateRandomUserAgent('windows', 'firefox')
}
})
.then(response => response.json())
.then(data => console.log(data));
```

## ๐ŸŽฏ Supported Configurations

### Device Types
- `android` - Android smartphones and tablets
- `ios` - iPhone and iPad devices
- `windows` - Windows desktop (7, 10, 11)
- `macos` - macOS desktop
- `linux` - Linux distributions
- `ubuntu` - Ubuntu Linux

### Browser Types
- `chrome` - Google Chrome (80-130)
- `firefox` - Mozilla Firefox (90-125)
- `safari` - Apple Safari (iOS and macOS)
- `edge` - Microsoft Edge

### Example Output

```
Mozilla/5.0 (Linux; Android 13; SM-S908B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Mobile Safari/537.36

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

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

Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0
```

## ๐Ÿ”ง Advanced Usage

### Custom Version Ranges (Go)

```go
chromeVersions := []int{115, 120} // Chrome 115 to 120
firefoxVersions := []int{100, 110} // Firefox 100 to 110

userAgent := GenerateRandomUserAgent(nil, nil, chromeVersions, firefoxVersions)
```

### Batch Generation (Python)

```python
from random_user_agents import generate_random_user_agent

# Generate 100 unique user agents
user_agents = [generate_random_user_agent() for _ in range(100)]

# Generate mobile-only user agents
mobile_agents = [
generate_random_user_agent(device_type=device)
for device in ['android', 'ios'] * 50
]
```

### Rate Limiting Protection

```python
import time
import random
from random_user_agents import generate_random_user_agent

for url in urls:
headers = {'User-Agent': generate_random_user_agent()}
response = requests.get(url, headers=headers)

# Random delay between requests
time.sleep(random.uniform(1, 3))
```

## ๐Ÿ› ๏ธ Useful Tools & Resources

| Tool | Description | Link |
|------|-------------|------|
| ๐ŸŒ **User Agent Generator** | Online generator with copy function | [Open Tool](https://multitools.ovh/random-user-agent-generator/) |
| ๐Ÿงฌ **Base64 Converter** | Encode/decode Base64 strings | [Open Tool](https://multitools.ovh/base64-converter/) |
| ๐Ÿ” **RegEx Validator** | Test and validate Regular Expressions | [Open Tool](https://multitools.ovh/regex-validator/) |
| ๐Ÿ” **JWT Decoder** | Decode and verify JSON Web Tokens | [Open Tool](https://multitools.ovh/jwt-converter/) |
| โฑ๏ธ **Timestamp Converter** | Convert Unix timestamps | [Open Tool](https://multitools.ovh/timestamp/) |
| ๐ŸŒŽ **Time Zone Converter** | World time zone conversion | [Open Tool](https://multitools.ovh/world-time-zone/) |

## ๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

1. ๐Ÿด Fork the repository
2. ๐ŸŒฟ Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. โœ… Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. ๐Ÿ“ค Push to the branch (`git push origin feature/AmazingFeature`)
5. ๐ŸŽ‰ Open a Pull Request

### Development Setup

```bash
# Clone the repository
git clone https://github.com/Aero25x/random-user-agents.git
cd random-user-agents

# Install dependencies
pip install -r requirements.txt # Python
npm install # JavaScript/TypeScript
cargo build # Rust
go mod download # Go
```

## ๐Ÿ“ License

This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.

Free for personal and commercial use, modification, and distribution.

## ๐ŸŒŸ Star History

If this project helped you, please consider giving it a โญ๏ธ on GitHub!

[![Star History Chart](https://api.star-history.com/svg?repos=Aero25x/random-user-agents&type=Date)](https://star-history.com/#Aero25x/random-user-agents&Date)

## ๐Ÿ“ž Support & Contact

- ๐Ÿ’ฌ **Telegram Community**: [@hidden_coding](https://t.me/hidden_coding)
- ๐Ÿ› **Bug Reports**: [GitHub Issues](https://github.com/Aero25x/random-user-agents/issues)
- ๐Ÿ’ก **Feature Requests**: [GitHub Discussions](https://github.com/Aero25x/random-user-agents/discussions)
- ๐Ÿ“ง **Email**: Contact via GitHub profile

## ๐Ÿ”— Related Projects

- [fake-useragent](https://github.com/fake-useragent/fake-useragent) - Python user agent faker
- [user-agents](https://github.com/intoli/user-agents) - JavaScript user agent parser
- [random-useragent](https://github.com/skratchdot/random-useragent) - Node.js random user agents

## ๐Ÿ“Š Statistics

![GitHub repo size](https://img.shields.io/github/repo-size/Aero25x/random-user-agents)
![GitHub language count](https://img.shields.io/github/languages/count/Aero25x/random-user-agents)
![GitHub top language](https://img.shields.io/github/languages/top/Aero25x/random-user-agents)
![GitHub last commit](https://img.shields.io/github/last-commit/Aero25x/random-user-agents)
![GitHub issues](https://img.shields.io/github/issues/Aero25x/random-user-agents)
![GitHub pull requests](https://img.shields.io/github/issues-pr/Aero25x/random-user-agents)

---

**Made with โค๏ธ by [Aero25x](https://github.com/aero25x)**

Keywords: user agent generator, random user agent, fake user agent, web scraping, browser automation, selenium user agent, puppeteer user agent, playwright, http headers, user agent string, mobile user agent, desktop user agent, chrome user agent, firefox user agent, safari user agent, android user agent, ios user agent, windows user agent, linux user agent, python user agent, javascript user agent, rust user agent, golang user agent, typescript user agent, web crawler, bot detection bypass, anti bot, scraping tool, automation testing