Redis · Example Payload

Redis Sorted Set Example

Redis Sorted Set (ZSET) operations for leaderboards and ranking

CacheDatabaseIn-MemoryKey-Value StoreNoSQLOpen-SourceStreaming

Redis Sorted Set Example is an example object payload from Redis, with 2 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

descriptionexamples

Example Payload

redis-sorted-set-example.json Raw ↑
{
  "description": "Redis Sorted Set (ZSET) operations for leaderboards and ranking",
  "examples": [
    {
      "operation": "ZADD",
      "description": "Add members with scores to a sorted set",
      "command": "ZADD leaderboard 1500 alice 1200 bob 1800 carol 900 dave",
      "explanation": "Adds four players with scores to the leaderboard sorted set.",
      "response": 4
    },
    {
      "operation": "ZRANGE with WITHSCORES",
      "description": "Get top N members by score",
      "command": "ZRANGE leaderboard 0 -1 BYSCORE REV WITHSCORES LIMIT 0 3",
      "explanation": "Get top 3 members in descending score order.",
      "response": ["carol", "1800", "alice", "1500", "bob", "1200"]
    },
    {
      "operation": "ZRANK",
      "description": "Get the rank of a member (0-indexed, ascending)",
      "command": "ZRANK leaderboard alice",
      "response": 2
    },
    {
      "operation": "ZINCRBY",
      "description": "Increment a member's score",
      "command": "ZINCRBY leaderboard 100 bob",
      "response": "1300"
    }
  ]
}

Work with this as data

Every example here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for examples

4 MCP tools reach this
  • find_examplesBrowse and filter every example in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This example
curl "https://apis.io/api/v1/examples/redis-sorted-set-example"
All examples
curl "https://apis.io/api/v1/examples?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.