Docs
Log in
Free to use

The User Agents API is completely free to use, regardless of your Crawlbase plan. Rate-limited to 1 request per second.

Overview

Returns a random User-Agent string optimized for web crawling. The selection logic favors UAs that look natural in production traffic - modern Chrome, Firefox, and Safari builds across desktop and mobile, weighted to match real-world usage.

Endpoint:https://api.crawlbase.com/user_agents

Quickstart

curl 'https://api.crawlbase.com/user_agents?token=YOUR_TOKEN'

Returns a single User-Agent string. Use it directly in the User-Agent header of your outbound HTTP request.

Parameters

token
stringrequired
Your Crawlbase token. The endpoint is free, but the token is needed for rate-limit accounting.
device
desktop | tablet | mobiledesktop
Filter to a device class. Useful when your scraper needs realistic UAs for a specific platform mix.
size
integer1
Number of UAs to return per call. Maximum 10. Combine with device to pre-filter, then cache the batch client-side and rotate locally - that's both faster and avoids the 1 req/s rate limit.

Rate limit

1 request per second. Cache UA strings client-side and rotate them yourself rather than calling on every request - that's both faster and avoids hitting the limit.

When to use this

You only need this if you're running your own crawler against websites that don't go through Crawlbase. The Crawling API and Smart AI Proxy already handle UA randomization automatically - you don't need to set User-Agent on requests through them.