Python Requests default user agent
Requests sends python-requests/<version> unless a User-Agent header is set on the request or the Session. Below is its default user agent, what each part means, and how to change it.
python-requests/2.34.2
At a glance
| Type | HTTP client |
| Operator | Python Requests project |
| Version | 2.34.2 |
String breakdown
| Fragment | Meaning |
|---|---|
python-requests/2.34.2 | python-requests HTTP client, version 2.34.2 — a program or script, not a browser. |
Check and change it in code
See the default it sends
import requests
print(requests.utils.default_user_agent())Send your own instead
import requests
requests.get("https://example.com", headers={"User-Agent": "MyApp/1.0"})
Source: requests/utils.py (v2.34.2) · checked September 2026