https://github.com/spider-rs/ua_generator
Pre-compiled random real User-Agents. Updated weekly for windows, mac, linux, and android
https://github.com/spider-rs/ua_generator
ua-generator user-agent-string useragent
Last synced: about 1 year ago
JSON representation
Pre-compiled random real User-Agents. Updated weekly for windows, mac, linux, and android
- Host: GitHub
- URL: https://github.com/spider-rs/ua_generator
- Owner: spider-rs
- License: mit
- Created: 2022-06-08T20:34:42.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-03T18:37:38.000Z (about 1 year ago)
- Last Synced: 2025-04-03T18:52:20.710Z (about 1 year ago)
- Topics: ua-generator, user-agent-string, useragent
- Language: Rust
- Homepage: https://docs.rs/ua_generator
- Size: 213 KB
- Stars: 31
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ua_generator
Generate random real User-Agents to use as spoofs.
## How to use
Example of generating a randomized user agent updated weekly.
```
cargo add ua_generator --git https://github.com/spider-rs/ua_generator.git
```
```rust
use ua_generator::ua::spoof_ua;
fn main() {
let ua = spoof_ua();
println!("{}", ua);
// Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36
};
```
The static files are checked and generated from the `build.rs` file to prevent extra need for API calls since they are limited and require authentication.
If you plan on using this building locally you need a valid API key from the [Spider Cloud API](https://spider.cloud/api-keys) and set the value to the env var `APILAYER_KEY`. You can run `BUILD_ENABLED=1 APILAYER_KEY=$APILAYER_KEY cargo build` to generate the static files. You can also change the API endpoint using the env variable `API_URL`.