REST API Reference
HTTP API on port 5020 powered by Axum — RESTful endpoints for all 5 data types
SoliKV exposes two interfaces: the Redis protocol on port 6379 for RESP2 operations, and this REST API on port 5020 for HTTP access to all data types. Both share the same engine — AOF persistence covers both interfaces automatically.
Authentication
When the server is started with --requirepass <PASSWORD>, all REST API requests must include a Bearer token in the Authorization header. Without the flag, no authentication is required.
Key-Value (Strings)
/kv/:key
Get the value of a key. Returns 404 if key does not exist.
/kv/:key
Set a key to a string value with optional TTL.
ex = TTL in seconds, px = TTL in milliseconds (optional)/kv/:key
Delete a key. Returns the count of keys deleted.
Lists
/list/:key?start=0&stop=-1
Get a range of elements from the list (LRANGE). Defaults to all elements.
/list/:key/lpush
Push values to the head of the list. Returns new list length.
/list/:key/rpush
Push values to the tail of the list. Returns new list length.
/list/:key/lpop
Remove and return the first element.
/list/:key/rpop
Remove and return the last element.
Hashes
/hash/:key
Get all fields and values (HGETALL).
/hash/:key/:field
Get a single field value (HGET).
/hash/:key
Set one or more hash fields (HSET).
/hash/:key/:field
Delete a hash field (HDEL).
Sets
/set/:key
Get all members (SMEMBERS).
/set/:key
Add members (SADD). Returns count of new members added.
/set/:key/:member
Remove a member (SREM).
Sorted Sets
/zset/:key?start=0&stop=-1
Get members with scores in rank order (ZRANGE WITHSCORES).
/zset/:key
Add members with scores (ZADD).
HyperLogLog
/pfadd/:key
Add elements to a HyperLogLog. Returns 1 if any register was altered, 0 otherwise.
/pfcount/:key
Return the approximate cardinality of the HyperLogLog.
/pfmerge/:dest
Merge multiple HyperLogLogs into a destination key.
Bloom Filter
/bf/reserve/:key
Create an empty Bloom filter with a given error rate and capacity.
/bf/add/:key
Add an item to the Bloom filter. Returns 1 if newly added, 0 if it may have existed.
/bf/exists/:key/:item
Check if an item may exist in the filter. Returns 1 (maybe exists) or 0 (definitely not).
/bf/info/:key
Return information about a Bloom filter (capacity, size, filters, items inserted).
Geospatial
/geo/:key/add
Add geospatial items (longitude, latitude, member) to a sorted set.
/geo/:key/pos/:member
Return the longitude and latitude of a member.
/geo/:key/dist/:member1/:member2?unit=km
Return the distance between two members. Unit: m, km, ft, mi (default: m).
/geo/:key/search
Search for members within a radius or bounding box.
GEOHASH and GEOSEARCHSTORE are available via the POST /cmd generic endpoint.
Bitmap
/bitmap/:key/setbit
Set or clear the bit at offset. Returns the original bit value.
/bitmap/:key/getbit/:offset
Returns the bit value at offset. Returns 0 if key missing or offset beyond length.
/bitmap/:key/bitcount?start=N&end=N
Count set bits in the string. Optional start/end specify a byte range.
BITOP is available via the POST /cmd generic endpoint.
Generic Command Endpoint
Execute any Redis command via HTTP. This gives you access to all 100+ commands without needing dedicated REST endpoints.
/cmd
Execute any command by name with arguments.
Server
/info
Server information (equivalent to INFO command)
/dbsize
Returns the number of keys in the database