RequestQueueClient
Index
Methods
add_request
Add a request to the queue.
https://docs.apify.com/api/v2#/reference/request-queues/request-collection/add-request
Parameters
request: dict
The request to add to the queue.
optionalkeyword-onlyforefront: bool | None = None
Whether to add the request to the head or the end of the queue.
Returns dict
batch_add_requests
Add requests to the request queue in batches.
Requests are split into batches based on size and processed in parallel.
https://docs.apify.com/api/v2#/reference/request-queues/batch-request-operations/add-requests
Parameters
requests: list[dict]
List of requests to be added to the queue.
optionalkeyword-onlyforefront: bool = False
Whether to add requests to the front of the queue.
optionalkeyword-onlymax_parallel: int = 1
Specifies the maximum number of parallel tasks for API calls. This is only applicable to the async client. For the sync client, this value must be set to 1, as parallel execution is not supported.
optionalkeyword-onlymax_unprocessed_requests_retries: int = 3
Number of retry attempts for unprocessed requests.
optionalkeyword-onlymin_delay_between_unprocessed_requests_retries: timedelta = timedelta(milliseconds=500)
Minimum delay between retry attempts for unprocessed requests.
Returns BatchAddRequestsResult
batch_delete_requests
Delete given requests from the queue.
https://docs.apify.com/api/v2#/reference/request-queues/batch-request-operations/delete-requests
Parameters
requests: list[dict]
List of the requests to delete.
Returns dict
delete
Delete the request queue.
https://docs.apify.com/api/v2#/reference/request-queues/queue/delete-request-queue
Returns None
delete_request
Delete a request from the queue.
https://docs.apify.com/api/v2#/reference/request-queues/request/delete-request
Parameters
request_id: str
ID of the request to delete.
Returns None
delete_request_lock
Delete the lock on a request.
https://docs.apify.com/api/v2#/reference/request-queues/request-lock/delete-request-lock
Parameters
request_id: str
ID of the request to delete the lock.
optionalkeyword-onlyforefront: bool | None = None
Whether to put the request in the beginning or the end of the queue after the lock is deleted.
Returns None
get
Retrieve the request queue.
https://docs.apify.com/api/v2#/reference/request-queues/queue/get-request-queue
Returns dict | None
get_request
Retrieve a request from the queue.
https://docs.apify.com/api/v2#/reference/request-queues/request/get-request
Parameters
request_id: str
ID of the request to retrieve.
Returns dict | None
list_and_lock_head
Retrieve a given number of unlocked requests from the beginning of the queue and lock them for a given time.
https://docs.apify.com/api/v2#/reference/request-queues/queue-head-with-locks/get-head-and-lock
Parameters
keyword-onlylock_secs: int
How long the requests will be locked for, in seconds.
optionalkeyword-onlylimit: int | None = None
How many requests to retrieve.
Returns dict
list_head
Retrieve a given number of requests from the beginning of the queue.
https://docs.apify.com/api/v2#/reference/request-queues/queue-head/get-head
Parameters
optionalkeyword-onlylimit: int | None = None
How many requests to retrieve.
Returns dict
list_requests
List requests in the queue.
https://docs.apify.com/api/v2#/reference/request-queues/request-collection/list-requests
Parameters
optionalkeyword-onlylimit: int | None = None
How many requests to retrieve.
optionalkeyword-onlyexclusive_start_id: str | None = None
All requests up to this one (including) are skipped from the result.
Returns dict
prolong_request_lock
Prolong the lock on a request.
https://docs.apify.com/api/v2#/reference/request-queues/request-lock/prolong-request-lock
Parameters
request_id: str
ID of the request to prolong the lock.
optionalkeyword-onlyforefront: bool | None = None
Whether to put the request in the beginning or the end of the queue after lock expires.
keyword-onlylock_secs: int
By how much to prolong the lock, in seconds.
Returns dict
update
Update the request queue with specified fields.
https://docs.apify.com/api/v2#/reference/request-queues/queue/update-request-queue
Parameters
optionalkeyword-onlyname: str | None = None
The new name for the request queue.
Returns dict
update_request
Update a request in the queue.
https://docs.apify.com/api/v2#/reference/request-queues/request/update-request
Parameters
request: dict
The updated request.
optionalkeyword-onlyforefront: bool | None = None
Whether to put the updated request in the beginning or the end of the queue.
Returns dict
Sub-client for manipulating a single request queue.