Skip to content
Bot & Threat Detection

Bot detector (UA)

The User-Agent detection API matches a string against a maintained bot signature list. Returns a flag and the matched signature, using the request header by.

GET https://api2.globus.studio/v2/bot_ua

Reference

Parameters

Name Type Required Description
ua string yes User-Agent to inspect. user_agent is an alias.
format string no plain or json. Default: plain.
is_bbcs bool no Legacy internal mode: return the matched signature or an empty string. Default: false.

Example request

curl -s "https://api2.globus.studio/v2/bot_ua?ua=Googlebot&format=json"
Open documentation

bot detector UA

The bot detector UA matches a User-Agent string against the signature list. It returns a flag that says whether the string contains a known bot token. The string is a claim, so the answer is a hint about the client, not proof of identity.

What the bot detector UA returns

The JSON body has a bot field with true or false. Plain text returns the same value as a word. A missing or empty User-Agent is an error: 400 with User-Agent is required, so an accidental empty value never reads as a clean result.

curl "https://api2.globus.studio/v2/bot_ua?ua=Googlebot&format=json"

How the match works

The list is static in data/bot_ua/signatures.json. A match means the string contains a known bot token. The check is case-insensitive and looks at the whole string. The endpoint reads ua or its user_agent alias and nothing else, so a caller sends the exact string it wants checked.

What it misses

The bot detector UA only sees the string it is given. A new bot with an unknown string passes. A real browser with an unusual extension can look like a bot. A string that names a search engine does not prove the request came from that engine. A script can copy a known string exactly. The list is a filter for known agents, not a classifier for all traffic. A short modern User-Agent is not a bot signal by itself.

Combine it with the network

Call the bot detector UA and the bot detector for the address. A Googlebot string from a Google range is a good sign. The same string from a residential connection is a mismatch. Log both results with the address and the decision.

A practical policy

Use the result to choose a rate limit, a challenge or a log level. Do not use it to ban an address. A false positive on a real customer costs more than a slow request from a scraper. The bot detector UA is one input in a decision that also looks at the network and the behaviour.

Logs and privacy

A User-Agent can contain a device model, an app version and a language. Treat it as personal data when it is tied to an address. Keep the raw string for a short period and store the parsed category longer. A support request can be answered with the category and the timestamp.

Client hints and short strings

A modern browser can send a short User-Agent and put the details in Sec-CH-UA headers. A short string is not a bot signal by itself. Read the hints when they are present, and keep the bot detector UA answer for the claimed identity. A browser that sends few details is still a browser.

A proxy can replace the header before the request reaches your code. Check the header where the request enters the system, not after a rewrite. If a CDN adds its own identifier, log both values and decide which one belongs to the client.

Store the category from the signature list and the raw string only when you need support. A log full of full User-Agent strings is harder to read and carries more personal data than the decision needs.

Limits

The signature list ships with the service, so it changes with a release, not in real time. The bot detector UA is fast and rate limited. For a full picture, read the User-Agent guide and the note on spoofing.

For anonymized traffic, use the Tor detector. For content generation, no User-Agent is involved. Keep the UA endpoint close to the place where the request enters the system, so the raw header is still available.

Further reading: MDN, User-Agent header.

Custom work

Need an API that does not exist yet?

Describe the task and the response format. We will estimate the endpoint, the integration and the maintenance.

Start a conversation