# LeetCode global contest ranking API

Get LeetCode Global Contest Rankings data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as output, page, raw, and retrieve structured data including global contest rank, leetCode username, published contest rating, public profile URL, and returned page-size metadata to display global rating tables, and link public profiles.

Documentation: https://openany.si/market/apis/leetcode/leetcode-global-contest-ranking-api/?offering=69d3368b-7624-45b4-8d0a-aaf17ff43174
API ID: 69d3368b-7624-45b4-8d0a-aaf17ff43174
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/leetcode/v1/global-ranking
Page update time: 2026-12-03T02:44:09.678Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.002 / billing credit
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract. Price update time: not supplied.
Contract update time: 2026-12-03T02:44:06.175Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "0",
    "max_cost_micro_usd": "2000",
    "quantities": [
      {
        "id": "upstream_credits",
        "label": "Actual API.SH credits consumed",
        "max_quantity": "1",
        "measure": "value",
        "pointer": "/credits_used",
        "price_micro_usd": "2000",
        "quantity_scale": 0,
        "source": "response",
        "unit": "credit",
        "unit_quantity": "1"
      }
    ],
    "rounding": "ceil",
    "variants": []
  }
}
```

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "LeetCode global contest ranking API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "page": {
          "type": "integer",
          "description": "Page number."
        },
        "raw": {
          "type": "string",
          "description": "0 leaves out the bulky `raw` source blocks (often 10-30x smaller).",
          "enum": [
            "0",
            "1"
          ]
        },
        "fields": {
          "type": "string",
          "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included."
        },
        "fresh": {
          "type": "string",
          "description": "1 skips the 24-hour cache and fetches live.",
          "enum": [
            "1"
          ]
        },
        "output": {
          "type": "string",
          "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.",
          "enum": [
            "json"
          ]
        },
        "records": {
          "type": "string",
          "description": "With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row."
        }
      }
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "cached": {
      "type": "boolean"
    },
    "count": {
      "type": "integer"
    },
    "credits_used": {
      "type": "integer"
    },
    "fetched_at": {
      "type": "string"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "avatar": {
            "type": "string"
          },
          "country": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ]
          },
          "country_code": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "profile_url": {
            "type": "string"
          },
          "rank": {
            "type": "integer"
          },
          "rating": {
            "type": "number"
          },
          "region": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        }
      }
    },
    "next_page": {
      "type": "integer"
    },
    "page": {
      "type": "integer"
    },
    "per_page": {
      "type": "integer"
    },
    "total_users": {
      "type": "integer"
    }
  }
}
```

## Request example
Scenario: Official example · Live API.SH response · Minimal request
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/leetcode/v1/global-ranking?output=json&page=1&raw=0' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "cached": false,
  "count": 25,
  "credits_used": 1,
  "fetched_at": "2026-11-19T12:29:39.919Z",
  "items": [
    {
      "avatar": "https://assets.leetcode.com/users/fjzzq2002/avatar_1735951462.png",
      "country": null,
      "country_code": null,
      "name": "Miruu",
      "profile_url": "https://leetcode.com/u/fjzzq2002/",
      "rank": 1,
      "rating": 3702.8,
      "region": "US",
      "username": "fjzzq2002"
    },
    {
      "avatar": "https://assets.leetcode.com/users/neal_wu/avatar_1737814509.png",
      "country": "United States",
      "country_code": "US",
      "name": "Neal Wu",
      "profile_url": "https://leetcode.com/u/neal_wu/",
      "rank": 2,
      "rating": 3686.2,
      "region": "US",
      "username": "neal_wu"
    },
    {
      "avatar": "https://assets.leetcode.com/users/1900015431/avatar_1633874346.png",
      "country": null,
      "country_code": null,
      "name": "Yawn_Sean",
      "profile_url": "https://leetcode.com/u/Yawn_Sean/",
      "rank": 3,
      "rating": 3644.8,
      "region": "US",
      "username": "Yawn_Sean"
    },
    {
      "avatar": "https://assets.leetcode.cn/aliyun-lc-upload/users/yawn_sean/avatar_1654149069.png",
      "country": "中国",
      "country_code": null,
      "name": "小羊肖恩",
      "profile_url": "https://leetcode.cn/u/ahmed007boss/",
      "rank": 4,
      "rating": 3611.5,
      "region": "CN",
      "username": "ahmed007boss"
    },
    {
      "avatar": "https://assets.leetcode.cn/aliyun-lc-upload/users/heltion/avatar_1587213058.png",
      "country": "中国",
      "country_code": null,
      "name": "何逊",
      "profile_url": "https://leetcode.cn/u/liming-v/",
      "rank": 5,
      "rating": 3599.5,
      "region": "CN",
      "username": "liming-v"
    },
    {
      "avatar": "https://assets.leetcode.com/users/default_avatar.jpg",
      "country": "Australia",
      "country_code": "AU",
      "name": "Joshua Chen",
      "profile_url": "https://leetcode.com/u/numb3r5/",
      "rank": 6,
      "rating": 3589.3,
      "region": "US",
      "username": "numb3r5"
    },
    {
      "avatar": "https://assets.leetcode.com/users/rohingarg123/avatar_1584377597.png",
      "country": null,
      "country_code": null,
      "name": "Rohin Garg",
      "profile_url": "https://leetcode.com/u/PurpleCrayon/",
      "rank": 7,
      "rating": 3506.4,
      "region": "US",
      "username": "PurpleCrayon"
    },
    {
      "avatar": "https://assets.leetcode.cn/aliyun-lc-upload/users/sserxhs/avatar_1622949152.png",
      "country": "中国",
      "country_code": null,
      "name": "SSerxhs",
      "profile_url": "https://leetcode.cn/u/hankray/",
      "rank": 8,
      "rating": 3499.5,
      "region": "CN",
      "username": "hankray"
    },
    {
      "avatar": "https://assets.leetcode.cn/aliyun-lc-upload/users/young_sean/avatar_1677902710.png",
      "country": null,
      "country_code": null,
      "name": "小咩肖恩",
      "profile_url": "https://leetcode.cn/u/HazemAllaham/",
      "rank": 9,
      "rating": 3490.5,
      "region": "CN",
      "username": "HazemAllaham"
    },
    {
      "avatar": "https://assets.leetcode.com/users/lev_mark/avatar_1788260844.png",
      "country": "Russia",
      "country_code": "RU",
      "name": "Rengoku",
      "profile_url": "https://leetcode.com/u/lev_mark/",
      "rank": 10,
      "rating": 3471.7,
      "region": "US",
      "username": "lev_mark"
    },
    {
      "avatar": "https://assets.leetcode.com/users/fmota973/avatar_1586010134.png",
      "country": "Brazil",
      "country_code": "BR",
      "name": "fmota",
      "profile_url": "https://leetcode.com/u/fmota/",
      "rank": 11,
      "rating": 3453.2,
      "region": "US",
      "username": "fmota"
    },
    {
      "avatar": "https://assets.leetcode.com/users/default_avatar.jpg",
      "country": null,
      "country_code": null,
      "name": "pandaforever",
      "profile_url": "https://leetcode.com/u/pandaforever/",
      "rank": 12,
      "rating": 3443.2,
      "region": "US",
      "username": "pandaforever"
    },
    {
      "avatar": "https://assets.leetcode.com/users/default_avatar.jpg",
      "country": "United States",
      "country_code": "US",
      "name": "xiaowuc1",
      "profile_url": "https://leetcode.com/u/xiaowuc1/",
      "rank": 13,
      "rating": 3426,
      "region": "US",
      "username": "xiaowuc1"
    },
    {
      "avatar": "https://assets.leetcode.cn/aliyun-lc-upload/users/johnkram/avatar_1593402741.png",
      "country": "中国",
      "country_code": null,
      "name": "汪乐平",
      "profile_url": "https://leetcode.cn/u/zhoupeiyun/",
      "rank": 14,
      "rating": 3424.1,
      "region": "CN",
      "username": "zhoupeiyun"
    },
    {
      "avatar": "https://assets.leetcode.com/users/default_avatar.jpg",
      "country": "中国",
      "country_code": null,
      "name": "int65536",
      "profile_url": "https://leetcode.cn/u/Nahin_Imtiaz/",
      "rank": 15,
      "rating": 3406.4,
      "region": "CN",
      "username": "Nahin_Imtiaz"
    },
    {
      "avatar": "https://assets.leetcode.com/users/rainingpeace/avatar_1617292193.png",
      "country": "United States",
      "country_code": "US",
      "name": "Sam Lee",
      "profile_url": "https://leetcode.com/u/qeetcode/",
      "rank": 16,
      "rating": 3401.8,
      "region": "US",
      "username": "qeetcode"
    },
    {
      "avatar": "https://assets.leetcode.cn/aliyun-lc-upload/users/moransky/avatar_1706518829.png",
      "country": "中国",
      "country_code": null,
      "name": "白天",
      "profile_url": "https://leetcode.cn/u/Shandse40/",
      "rank": 17,
      "rating": 3388.9,
      "region": "CN",
      "username": "Shandse40"
    },
    {
      "avatar": "https://assets.leetcode.cn/aliyun-lc-upload/users/endlesscheng/avatar_1690721039.png",
      "country": null,
      "country_code": null,
      "name": "灵茶山艾府",
      "profile_url": "https://leetcode.cn/u/Carefreejs/",
      "rank": 18,
      "rating": 3379.8,
      "region": "CN",
      "username": "Carefreejs"
    },
    {
      "avatar": "https://assets.leetcode.com/users/default_avatar.jpg",
      "country": "Singapore",
      "country_code": "SG",
      "name": "jonathanirvings",
      "profile_url": "https://leetcode.com/u/jonathanirvings/",
      "rank": 19,
      "rating": 3365.7,
      "region": "US",
      "username": "jonathanirvings"
    },
    {
      "avatar": "https://assets.leetcode.com/users/avatars/avatar_1655637961.png",
      "country": "Hong Kong",
      "country_code": "HK",
      "name": "wwwwodddd",
      "profile_url": "https://leetcode.com/u/wwwwodddd/",
      "rank": 20,
      "rating": 3365.1,
      "region": "US",
      "username": "wwwwodddd"
    },
    {
      "avatar": "https://assets.leetcode.com/users/default_avatar.jpg",
      "country": null,
      "country_code": null,
      "name": "wifiii",
      "profile_url": "https://leetcode.cn/u/TheWander/",
      "rank": 21,
      "rating": 3357.5,
      "region": "CN",
      "username": "TheWander"
    },
    {
      "avatar": "https://assets.leetcode.com/users/_kevinyang/avatar_1721046496.png",
      "country": "Canada",
      "country_code": "CA",
      "name": "Kai Wen Yang",
      "profile_url": "https://leetcode.com/u/_kevinyang/",
      "rank": 22,
      "rating": 3353.9,
      "region": "US",
      "username": "_kevinyang"
    },
    {
      "avatar": "https://assets.leetcode.com/users/user4169qw/avatar_1586634158.png",
      "country": "Japan",
      "country_code": "JP",
      "name": "emthrm",
      "profile_url": "https://leetcode.com/u/emthrm/",
      "rank": 23,
      "rating": 3344,
      "region": "US",
      "username": "emthrm"
    },
    {
      "avatar": "https://assets.leetcode.com/users/default_avatar.jpg",
      "country": null,
      "country_code": null,
      "name": "arignote",
      "profile_url": "https://leetcode.cn/u/MisterSoandSo/",
      "rank": 24,
      "rating": 3343.4,
      "region": "CN",
      "username": "MisterSoandSo"
    },
    {
      "avatar": "https://assets.leetcode.com/users/default_avatar.jpg",
      "country": null,
      "country_code": null,
      "name": "Dong Liu",
      "profile_url": "https://leetcode.com/u/dong_liu/",
      "rank": 25,
      "rating": 3324.1,
      "region": "US",
      "username": "dong_liu"
    }
  ],
  "next_page": 2,
  "page": 1,
  "per_page": 25,
  "total_users": 903741
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Available implementations
- apish: https://openany.si/market/apis/leetcode/leetcode-global-contest-ranking-api/?offering=69d3368b-7624-45b4-8d0a-aaf17ff43174

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
