API reference · Web scraping
User-Agent Generator
Generate desktop or mobile user-agent strings using user_agent_type and user_agent_count (1–5). This local operation still has a catalog request price.
https://api.serpbase.dev/web/user-agentExample
curl -X POST 'https://api.serpbase.dev/web/user-agent' \
-H "Content-Type: application/json" \
-H 'X-API-Key: YOUR_API_KEY' \
--max-time 60 \
-d '{"user_agent_count":1,"user_agent_type":"desktop"}'{
"status": 0,
"credits_charged": 1,
"request_id": "r-4b27fe8a36d9ac303a5da7dd",
"product_id": "web_user_agent",
"action": "user_agent",
"source": "web",
"user_agents": [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0"
]
}Parameters
formatMore
markdown returns the same result as Markdown text (text/markdown) for language models: no envelope, no duplicate alias fields, no inline images. Same credits; failures keep the JSON envelope.
user_agent_countuser_agent_typecountryMore
Use one spelling at a time; the API validates the parameters and values supported by this product.
cursorMore
Use one spelling at a time; the API validates the parameters and values supported by this product.
deviceMore
Use one spelling at a time; the API validates the parameters and values supported by this product.
glMore
Use one spelling at a time; the API validates the parameters and values supported by this product.
hlMore
Use one spelling at a time; the API validates the parameters and values supported by this product.
htmlMore
Use one spelling at a time; the API validates the parameters and values supported by this product.
languageMore
Use one spelling at a time; the API validates the parameters and values supported by this product.
limitMore
Use one spelling at a time; the API validates the parameters and values supported by this product.
markdownMore
Use one spelling at a time; the API validates the parameters and values supported by this product.
mobileMore
Use one spelling at a time; the API validates the parameters and values supported by this product.
numMore
Use one spelling at a time; the API validates the parameters and values supported by this product.
pageMore
Use one spelling at a time; the API validates the parameters and values supported by this product.
qMore
Use one spelling at a time; the API validates the parameters and values supported by this product.
uanumMore
Use one spelling at a time; the API validates the parameters and values supported by this product.
uatypeMore
Use one spelling at a time; the API validates the parameters and values supported by this product.
The sample shows example parameters, not the complete request contract. Known fields are validated by the API; additional parameters are allowed.
What comes back
The fields are those in the response above; every endpoint also carries status, credits_charged and request_id.
If it fails
A failed request has a non-zero status and an error, and is not charged. The ones you will see here:
1000A parameter is missing or wrongFix the request1020No credits leftTop up1029Over your requests per secondWait Retry-After seconds1502 · 1504The source could not be read this timeRetry