---
title: "Redis-like API interface"
method: GET
path: "/_fabric/{fabric}/_api/redis/{collection}/{command}"
tags: ["Redis"]
---

# Redis-like API interface

`GET /_fabric/{fabric}/_api/redis/{collection}/{command}`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_fabric/:fabric/_api/redis/:collection/:command/get.ts> (a function with typed inputs; its response is checked against the schema)

This API provides a REST API to access Redis databases. The REST API follows the same convention that the Redis Protocol uses. 

 Give the command name and parameters in the same order as the Redis protocol, separating commands with a '/'. The parameter suffixes can vary in number, depending upon the command. For example http://api.macrometa.io/_fabric/myfabric/_api/redis/SET/foo/bar. Query params can also be used along with suffixes, for example http://api.macrometa.io/_fabric/myfabric/_api/redis/SET/foo/bar?ex=100.

 Currently supported Redis commands :

 * **String:** - **APPEND**  - **DECR**  - **DECRBY**  - **GET**  - **GETDEL**  - **GETEX**  - **GETRANGE** - **GETSET**  - **INCR**  - **INCRBY**  - **INCRBYFLOAT**  - **MGET**  - **MSET**  - **MSETNX** - **PSETEX**  - **SET** - **SETBIT** - **SETEX**  - **SETNX** - **SETRANGE**  - **STRLEN**  - **BITCOUNT** - **BITOP** - **BITPOS** - **GETBIT**

 * **Hash:** - **HDEL**  - **HEXISTS**  - **HGET** - **HGETALL**  - **HINCRBY**  - **HINCRBYFLOAT**  - **HKEYS** - **HLEN**  - **HMGET**  - **HMSET**  - **HSCAN** - **HSET**  - **HSETNX**  - **HSTRLEN**  - **HRANDFIELD** - **HVALS**

 * **List:** - **LINDEX** - **LINSERT** - **LLEN** - **LMOVE** - **LPOP** - **LPOS** - **LPUSH** - **LPUSHX** - **LRANGE** - **LREM** - **LSET** - **LTRIM** - **RPOP** - **RPOPLPUSH** - **RPUSH** - **RPUSHX**

 *  **Set:** - **SADD** - **SCARD** - **SDIFF** - **SDIFFSTORE** - **SINTER** - **SINTERSTORE** - **SISMEMBER** - **SMEMBERS** - **SMISMEMBER** - **SMOVE** - **SPOP** - **SRANDMEMBER** - **SREM** - **SSCAN** - **SUNION** - **SUNIONSTORE**

 * **SortedSet:** - **ZADD** - **ZCARD** - **ZCOUNT** - **ZDIFF** - **ZDIFFSTORE** - **ZINCRBY** - **ZINTER** - **ZINTERSTORE** - **ZLEXCOUNT** - **ZMSCORE** - **ZPOPMAX** - **ZPOPMIN** - **ZRANDMEMBER** - **ZRANGE** - **ZRANGEBYLEX** - **ZRANGEBYSCORE** - **ZRANGESTORE** - **ZRANK** - **ZREM** - **ZREMRANGEBYLEX** - **ZREMRANGEBYRANK** - **ZREMRANGEBYSCORE** - **ZREVRANGE** - **ZREVRANGEBYLEX** - **ZREVRANGEBYSCORE** - **ZREVRANK** - **ZSCAN** - **ZSCORE** - **ZUNION** - **ZUNIONSTORE**

 * **Generic:** - **COPY** - **DEL** - **EXISTS** - **EXPIRE** - **EXPIREAT** - **PERSIST** - **PEXPIRE** - **PEXPIREAT** - **PTTL** - **RANDOMKEY** - **RENAME** - **RENAMENX** - **SCAN** - **TTL** - **TYPE** - **UNLINK**

 * **Server:** - **ECHO** - **PING** - **PIPELINE** - **DBSIZE** - **FLUSHDB** - **TIME**

## Path parameters

- `fabric` string, string, required
- `collection` string, string, required
- `command` string, string, required

## Response `200`

Successfully returned after execution.

- object
  - `code` integer: HTTP response code.
  - `result` unknown[]: Result depending upon Redis command. It can be a string, number or an array.
    - unknown

## Other responses

- `400`: Failed due to invalid command parameters. Verify that all parameters are correct.
- `401`: Failed because you do not have execute permissions.

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
