# FCALL_RO

> Call a read-only function from a loaded function library.

URL: https://docs.hotkv.com/commands/fcall_ro/

```
FCALL_RO function numkeys [key [key ...]] [arg [arg ...]]
```

- Group: Scripting and functions
- Complexity: Depends on the function
- HotKV Cloud: all plans
- On-Premise: no license needed

`FCALL_RO` calls a function like [FCALL](https://docs.hotkv.com/commands/fcall/index.md), but only a function
registered with the `no-writes` flag. Because the command is read-only, you
can send it to read-only replicas and grant it to users who may not write.

## Return value

The function's return value, converted as described for
[EVAL](https://docs.hotkv.com/commands/eval/index.md).

Errors, in addition to those of `FCALL`:

- `ERR Can not execute a script with write flag using *_ro command.` when the
  function was registered without `no-writes`.

## Examples

```
127.0.0.1:6379> FUNCTION LOAD "#!lua name=readers\nredis.register_function{function_name='peek', callback=function(keys) return redis.call('GET', keys[1]) end, flags={'no-writes'}}"
"readers"
127.0.0.1:6379> SET greeting "hello"
OK
127.0.0.1:6379> FCALL_RO peek 1 greeting
"hello"
```

## Compatibility

Same as Redis 7 and Valkey 8.

## See also

[FCALL](https://docs.hotkv.com/commands/fcall/index.md), [EVAL_RO](https://docs.hotkv.com/commands/eval_ro/index.md),
[FUNCTION LOAD](https://docs.hotkv.com/commands/function-load/index.md)