Need help with grequests?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

3.9K Stars 336 Forks BSD 2-Clause "Simplified" License 84 Commits 9 Opened issues


Requests + Gevent = <3

Services available


Need anything else?

Contributors list

GRequests: Asynchronous Requests

GRequests allows you to use Requests with Gevent to make asynchronous HTTP Requests easily.

|version| |pyversions|

Note: You should probably use

_ or
_ instead.


Usage is simple:

.. code-block:: python

import grequests

urls = [ '', '', '', '', 'http://fakedomain/', '' ]

Create a set of unsent Requests:

.. code-block:: python

>>> rs = (grequests.get(u) for u in urls)

Send them all at the same time:

.. code-block:: python

[, , , , None, ]

Optionally, in the event of a timeout or any other exception during the connection of the request, you can add an exception handler that will be called with the request and exception inside the main thread:

.. code-block:: python

>>> def exception_handler(request, exception):
...    print("Request failed")

>>> reqs = [ ... grequests.get('', timeout=0.001), ... grequests.get('http://fakedomain/'), ... grequests.get('')] >>>, exception_handler=exception_handler) Request failed Request failed [None, None, ]

For some speed/performance gains, you may also want to use

instead of
returns a generator of responses. Order of these responses does not map to the order of the requests you send out. The API for
is equivalent to the API for


Installation is easy with pip::

$ pip install grequests

.. |version| image:: :target:

.. |pyversions| image:: :target:

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.