Find your next open-source project

Search by name, purpose, or keyword — or paste a GitHub repository URL

psf/requests

Developer Tools

A Python HTTP library for sending HTTP/1.1 requests with sessions, auth, TLS verification and streaming.

54,644
11,516
Python
Apache-2.0
15 years old

Introduction

Requests is a Python library for making HTTP/1.1 requests without manually assembling query strings or form-encoding PUT and POST bodies. It is aimed at Python developers who need to call web APIs or download resources from application code.

The API centers on a few conveniences: responses expose status_code, headers, encoding, text and a json() method that parses JSON bodies; sessions persist cookies; and TLS/SSL verification follows browser-style defaults. The library also covers Basic and Digest authentication, automatic content decompression, multipart uploads, SOCKS proxies, connection timeouts, streaming downloads and .netrc handling (feature list).

Getting started

Requests requires Python 3.10 or newer (supported versions). Install from PyPI:

$ python -m pip install requests

A minimal authenticated request against httpbin looks like this (example):

>>> import requests
>>> r = requests.get('https://httpbin.org/basic-auth/user/pass', auth=('user', 'pass'))
>>> r.status_code
200
>>> r.json()
{'authenticated': True, ...}

A successful call returns a Response; inspect status_code to branch on HTTP status and call json() when the server returns JSON. The documentation covers sessions, timeouts, streaming and other options beyond this example.

Working from source

The repository can be cloned with a Git flag that ignores a bad commit timestamp, otherwise git clone may fail its integrity check:

git clone -c fetch.fsck.badTimezone=ignore https://github.com/psf/requests.git

The same setting can be applied globally with git config --global fetch.fsck.badTimezone ignore (clone notes).

Constraints

Requests targets Python 3.10+ and is distributed on PyPI under Apache-2.0. Applications that must pin an older Python version cannot use current releases. Network behavior such as proxy configuration, certificate verification and timeouts depends on how each call or session is configured; the library's defaults and available options are described in the documentation.

HotRepo's take

The project's standing is hard to separate from its age and reach: it has been on GitHub since 2011 and its README reports roughly 300 million PyPI downloads per week and over 4,000,000 dependent repositories (README). On the Python daily list for 2026-11-06 it added 126 stars, reaching position 3 on that day.

The most useful historical signal is about maintenance, not adoption. A 2019 Hacker News discussion around the move to the Python Software Foundation included a comment from the_mitsuhiko noting that releases and commits were concentrated in one person and that CI was failing at the time (discussion, comment); another commenter said they were considering urllib3 instead (reply). Those observations describe that moment and are not a current assessment, but they explain why contributors should check recent release activity before depending on a specific fix.

Written by AI from the project's README, updated . The project's own docs are the source of truth.

Hacker News

Requests moved to Python Software Foundation
▲ 111 · 57 comments · September 19, 2019
Python-Requests.org Domain Suspended
▲ 4 · 0 comments · May 23, 2022
Python Requests is getting an interesting alternative
▲ 3 · 2 comments · October 31, 2024