# `ApifyClient.API.Runs.RequestQueue.Head`
[🔗](https://github.com/social-growth-studio/apify-client-ex/blob/v1.0.0/lib/apify_client/api/runs/request_queue/head.ex#L1)

Provides API endpoints related to api/runs/request queue/head

# `get`

```elixir
@spec get(run_id :: String.t(), opts :: keyword()) ::
  {:ok, ApifyClient.Schemas.RequestQueueHead.t()}
  | {:error, ApifyClient.Error.t()}
```

Get the default request queue head for an Actor run

Returns the given number of first requests from the default request queue of the Actor run.

This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the
[Get request queue head](https://docs.apify.com/api/v2/request-queue-head-get) endpoint.

## Options

  * `limit`: How many items from queue should be returned.
  * `client_key`: A unique identifier of the client accessing the request queue. It must
    be a string between 1 and 32 characters long. This identifier is used to
    determine whether the queue was accessed by multiple clients. If
    `clientKey` is not provided,
    the system considers this API call to come from a new client. For
    details, see the `hadMultipleClients` field returned by the [Get request queue head](https://docs.apify.com/api/v2/request-queue-head-get) endpoint.
    

# `lock`

```elixir
@spec lock(run_id :: String.t(), opts :: keyword()) ::
  {:ok, ApifyClient.Schemas.LockedRequestQueueHead.t()}
  | {:error, ApifyClient.Error.t()}
```

Get and lock the default request queue head for an Actor run

Returns the given number of first requests from the default request queue of the Actor run
and locks them for the given time.

This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the
[Get and lock request queue head](https://docs.apify.com/api/v2/request-queue-head-lock-post) endpoint.

## Options

  * `lock_secs`: How long the requests will be locked for (in seconds).
  * `limit`: How many items from the queue should be returned.
  * `client_key`: A unique identifier of the client accessing the request queue. It must
    be a string between 1 and 32 characters long. This identifier is used to
    determine whether the queue was accessed by multiple clients. If
    `clientKey` is not provided,
    the system considers this API call to come from a new client. For
    details, see the `hadMultipleClients` field returned by the [Get request queue head](https://docs.apify.com/api/v2/request-queue-head-get) endpoint.
    

---

*Consult [api-reference.md](api-reference.md) for complete listing*
