The requests library

requests is a third-party Python library for sending HTTP requests simply. requests.get() and requests.post() return a response from which you read status_code, json() or text. You should set a maximum delay (timeout), check the status with raise_for_status() and not put API keys in the code.

Example

r = requests.get(url, params={'q': 'python'}, timeout=10)
r.raise_for_status()

Related concepts

The whole glossary