# urllib3 — card for AI agents

HTTP client with thread-safe connection pooling, file uploads and advanced features.

Category: HTTP clients and networking · PyPI package `urllib3` · latest version 2.8.0 (checked 2026-11-01)
Install: `pip install urllib3`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Numbers (AgentGid data)
- Gid Score: 74.6 (#215 of all tools, 15 of 126 in its category)
- Used in 98 public projects set up for AI coding agents (1.6%)
- Downloads last week: 375,704,621 (as of 2026-11-24), +10.2% over 4 weeks
- GitHub stars: 4,086 (as of 2026-11-24)
- Last push: 2026-11-14

## Often used with
Requests 89.8%, Pydantic 67.3%, charset-normalizer 62.2%, Click 56.1%, PyYAML 56.1%, python-dotenv 55.1%

## Checked alternatives (same job)
- Requests: https://agentgid.com/tools/requests-py/agent.md
- httpx: https://agentgid.com/tools/httpx/agent.md
- aiohttp: https://agentgid.com/tools/aiohttp/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/urllib3/
- Repository: https://github.com/urllib3/urllib3


## urllib3: dependable web requests from Python code

urllib3 is a free Python library your app uses to talk to other websites and online services. It reuses connections, tries again when a service hiccups, stops waiting after a time limit and checks secure connections. Popular tools such as Requests and Python's own installer are built on it, so it is often already in your project.

### Where to use it
- Survive a busy outside service: Your app reads prices or orders from another service that sometimes answers "busy"; it waits a moment and tries again instead of failing.
- Send data to a webhook: When an order is paid, your backend posts its details to a chat bot, a shop or a partner's system.
- Upload a file to a service: Your app sends a report or a photo to another service the same way a browser form would.
- Never hang on a slow service: A partner's server stops answering; your page gives up after a few seconds and shows a message instead of freezing.
- Download big files in pieces: Your app fetches a large export or video and writes it to disk bit by bit, so memory stays low.
- Many requests from worker threads: A background job checks hundreds of links at once from several threads and shares one set of open connections.

### How to start
- Install urllib3 into your project's Python environment (Python 3.10 or newer).

```
$ python -m pip install urllib3
```

- Make one PoolManager for your app and send requests through it.

```
import urllib3
# Creating a PoolManager instance for sending requests.
http = urllib3.PoolManager()
# Sending a GET request and getting back response as HTTPResponse object.
resp = http.request("GET", "https://httpbin.org/robots.txt")
# Print the returned data.
print(resp.data)
```

- Read the answer: resp.status, resp.headers, resp.data, or resp.json() for JSON.

### License
Free to use in any project, including paid and closed-source apps, under the MIT license. Keep its copyright and license notice if you ship its files.

### Good to know
- It needs Python 3.10 or newer and a system with OpenSSL 1.1.1 or newer. Old servers such as Amazon Linux 2 fail on import.
- Without a timeout it may wait as long as the system allows, possibly forever. Always set one.
- By default it retries only safe kinds of requests. A failed POST, such as a payment, is not sent twice unless you ask for it.
- The old 1.26 line no longer gets updates. Version 2.8.0 fixed two high-severity security issues, so stay current.
- It is a low-level tool. For everyday code most people use Requests, which is built on it.

Checked 2026-11-10 against: https://github.com/urllib3/urllib3/blob/main/README.md, https://github.com/urllib3/urllib3/blob/main/LICENSE.txt, https://pypi.org/pypi/urllib3/json, https://urllib3.readthedocs.io/en/stable/, https://urllib3.readthedocs.io/en/stable/user-guide.html, https://urllib3.readthedocs.io/en/stable/advanced-usage.html, https://urllib3.readthedocs.io/en/stable/reference/urllib3.util.html, https://urllib3.readthedocs.io/en/stable/v2-migration-guide.html, https://urllib3.readthedocs.io/en/stable/changelog.html

### Mistakes to avoid
- Don't: http.request("GET", url) with no timeout → Do: urllib3.PoolManager(timeout=urllib3.Timeout(connect=2.0, read=10.0)) or timeout= on each request (Without a timeout the read waits for the system default, which can be forever.)
- Don't: Assuming a 404 or 500 raises an exception → Do: Check resp.status (for example if resp.status >= 400) before using resp.data (request() returns the response for any status; in our run a 404 came back with no exception.)
- Don't: Retry(status_forcelist=[503]) and expecting a failed POST to be retried → Do: Retry only idempotent calls, or pass allowed_methods including POST when the server handles duplicates safely (POST is not in the default list of retried methods.)
- Don't: Code from urllib3 1.x tutorials, for example HTTPResponse(strict=...) or urllib3.contrib.securetransport → Do: Use urllib3 2.x code; remove strict and the removed contrib modules (urllib3 2 removed several old modules and parameters.)
- Don't: cert_reqs="CERT_NONE" to silence a certificate error → Do: Keep verification on; point ca_certs at a proper bundle such as certifi.where() (Turning verification off lets anyone in the middle read or change the traffic.)

### Questions
- Can I use it in a paid, closed-source app? Yes. It is MIT-licensed; keep the copyright and license notice with its files.
- Does it raise an error for a 404 or 500 answer? No. You get a response with its status code and check resp.status yourself (our run got 404 with no exception).
- How many times does it retry by default? Three retries and up to three redirects, unless you change the retries setting.
- Does it check HTTPS certificates? Yes, by default. You can switch it off, but the docs strongly advise against it.
- Why does pip install an old urllib3 1.26 in my project? Usually an old botocore (AWS) version asks for it; upgrading to Python 3.10+ and a current botocore lets urllib3 2 install.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
