requests

The popular package for calling websites and APIs from Python.

Also called: httpx, HTTP, API

Type
Term
Source
General
Language
Python

In plain English

Always set a timeout, otherwise a hanging server hangs your script forever.

Example

requests.get with a 15-second timeout fetches the listings from the API.

In code

import requests

r = requests.get("https://api.example.com/listings", params={"city": "Ubud"}, timeout=15)
r.raise_for_status()
items = r.json()

httpx is a newer alternative that also does async.

Learn more

Related terms

Added 2026-11-30 · Last reviewed 2026-11-30