# LeetCode user profile API

Get LeetCode User Profile via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as output, raw, username, and retrieve structured data including leetCode username, published solved-problem totals, available activity years, returned calendar scope, and activity date to build activity calendars, and compare solving categories.

Documentation: https://openany.si/market/apis/leetcode/leetcode-user-profile-api/?offering=b0a0f53b-5202-4681-9e77-5061dde0cf35
API ID: b0a0f53b-5202-4681-9e77-5061dde0cf35
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/leetcode/v1/user
Page update time: 2026-12-03T02:44:09.784Z
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.957Z. 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 user profile 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": {
        "username": {
          "type": "string",
          "description": "LeetCode username or leetcode.com/u/ profile link."
        },
        "year": {
          "type": "integer",
          "description": "Calendar year for submission_calendar, streak and active days (a year listed in active_years). Default: the last 12 months."
        },
        "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."
        }
      },
      "required": [
        "username"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "about": {
      "type": "string"
    },
    "active_badge": {
      "type": "string"
    },
    "active_days": {
      "type": "integer"
    },
    "active_years": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "avatar": {
      "type": "string"
    },
    "badges": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "icon": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "cached": {
      "type": "boolean"
    },
    "calendar_year": {
      "type": "null"
    },
    "company": {
      "type": "null"
    },
    "contest": {
      "type": "object",
      "properties": {
        "attended": {
          "type": "integer"
        },
        "badge": {
          "type": "string"
        },
        "global_ranking": {
          "type": "integer"
        },
        "rating": {
          "type": "integer"
        },
        "top_percentage": {
          "type": "number"
        },
        "total_participants": {
          "type": "integer"
        }
      }
    },
    "country": {
      "type": "string"
    },
    "credits_used": {
      "type": "integer"
    },
    "discussions": {
      "type": "integer"
    },
    "fetched_at": {
      "type": "string"
    },
    "github": {
      "type": "null"
    },
    "languages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "language": {
            "type": "string"
          },
          "problems_solved": {
            "type": "integer"
          }
        }
      }
    },
    "linkedin": {
      "type": "null"
    },
    "post_views": {
      "type": "integer"
    },
    "problems_total": {
      "type": "object",
      "properties": {
        "all": {
          "type": "integer"
        },
        "easy": {
          "type": "integer"
        },
        "hard": {
          "type": "integer"
        },
        "medium": {
          "type": "integer"
        }
      }
    },
    "ranking": {
      "type": "integer"
    },
    "real_name": {
      "type": "string"
    },
    "reputation": {
      "type": "integer"
    },
    "school": {
      "type": "null"
    },
    "skills": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "skills_advanced": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "problems_solved": {
            "type": "integer"
          },
          "tag": {
            "type": "string"
          }
        }
      }
    },
    "skills_fundamental": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "problems_solved": {
            "type": "integer"
          },
          "tag": {
            "type": "string"
          }
        }
      }
    },
    "skills_intermediate": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "problems_solved": {
            "type": "integer"
          },
          "tag": {
            "type": "string"
          }
        }
      }
    },
    "solutions": {
      "type": "integer"
    },
    "solved": {
      "type": "object",
      "properties": {
        "all": {
          "type": "integer"
        },
        "easy": {
          "type": "integer"
        },
        "hard": {
          "type": "integer"
        },
        "medium": {
          "type": "integer"
        }
      }
    },
    "streak": {
      "type": "integer"
    },
    "submission_calendar": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "submissions": {
            "type": "integer"
          }
        }
      }
    },
    "twitter": {
      "type": "null"
    },
    "url": {
      "type": "string"
    },
    "username": {
      "type": "string"
    },
    "websites": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  }
}
```

## Request example
Scenario: Official example · Live API.SH response · Minimal request
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/leetcode/v1/user?output=json&raw=0&username=lee215' \
  -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
{
  "about": "Lee codes for fun :)\n\n   🍠lee215: 2950607729",
  "active_badge": "365 Days Badge",
  "active_days": 50,
  "active_years": [
    2014,
    2016,
    2017,
    2018,
    2019,
    2020,
    2021,
    2022,
    2023,
    2024,
    2025,
    2026
  ],
  "avatar": "https://assets.leetcode.com/users/lee215/avatar_1551541889.png",
  "badges": [
    {
      "date": "2026-05-06",
      "icon": "https://leetcode.com/static/images/badges/guardian.png",
      "name": "Guardian"
    },
    {
      "date": "2024-12-08",
      "icon": "https://assets.leetcode.com/static_assets/marketing/lg500.png",
      "name": "500 Days Badge"
    },
    {
      "date": "2024-12-08",
      "icon": "https://assets.leetcode.com/static_assets/marketing/lg365.png",
      "name": "365 Days Badge"
    }
  ],
  "cached": false,
  "calendar_year": null,
  "company": null,
  "contest": {
    "attended": 27,
    "badge": "Guardian",
    "global_ranking": 7647,
    "rating": 2204,
    "top_percentage": 0.9,
    "total_participants": 892590
  },
  "country": "China",
  "credits_used": 1,
  "discussions": 1,
  "fetched_at": "2026-11-19T12:29:44.063Z",
  "github": null,
  "languages": [
    {
      "language": "C++",
      "problems_solved": 152
    },
    {
      "language": "Java",
      "problems_solved": 254
    },
    {
      "language": "Python",
      "problems_solved": 445
    },
    {
      "language": "MySQL",
      "problems_solved": 2
    },
    {
      "language": "JavaScript",
      "problems_solved": 11
    },
    {
      "language": "Bash",
      "problems_solved": 2
    },
    {
      "language": "Python3",
      "problems_solved": 74
    }
  ],
  "linkedin": null,
  "post_views": 20844736,
  "problems_total": {
    "all": 4115,
    "easy": 976,
    "hard": 991,
    "medium": 2148
  },
  "ranking": 99778,
  "real_name": "lee",
  "reputation": 231610,
  "school": null,
  "skills": [
    "python",
    "java",
    "c++"
  ],
  "skills_advanced": [
    {
      "problems_solved": 3,
      "tag": "data-stream"
    },
    {
      "problems_solved": 9,
      "tag": "game-theory"
    },
    {
      "problems_solved": 5,
      "tag": "rolling-hash"
    },
    {
      "problems_solved": 4,
      "tag": "sweep-line"
    },
    {
      "problems_solved": 29,
      "tag": "backtracking"
    },
    {
      "problems_solved": 9,
      "tag": "bitmask"
    },
    {
      "problems_solved": 3,
      "tag": "quickselect"
    },
    {
      "problems_solved": 136,
      "tag": "dynamic-programming"
    },
    {
      "problems_solved": 20,
      "tag": "divide-and-conquer"
    },
    {
      "problems_solved": 9,
      "tag": "trie"
    },
    {
      "problems_solved": 27,
      "tag": "union-find"
    },
    {
      "problems_solved": 2,
      "tag": "suffix-array"
    },
    {
      "problems_solved": 9,
      "tag": "binary-indexed-tree"
    },
    {
      "problems_solved": 15,
      "tag": "segment-tree"
    },
    {
      "problems_solved": 25,
      "tag": "monotonic-stack"
    },
    {
      "problems_solved": 3,
      "tag": "monotonic-queue"
    },
    {
      "problems_solved": 4,
      "tag": "topological-sort"
    },
    {
      "problems_solved": 8,
      "tag": "shortest-path"
    }
  ],
  "skills_fundamental": [
    {
      "problems_solved": 388,
      "tag": "array"
    },
    {
      "problems_solved": 48,
      "tag": "matrix"
    },
    {
      "problems_solved": 168,
      "tag": "string"
    },
    {
      "problems_solved": 21,
      "tag": "simulation"
    },
    {
      "problems_solved": 23,
      "tag": "enumeration"
    },
    {
      "problems_solved": 90,
      "tag": "sorting"
    },
    {
      "problems_solved": 49,
      "tag": "stack"
    },
    {
      "problems_solved": 7,
      "tag": "queue"
    },
    {
      "problems_solved": 18,
      "tag": "linked-list"
    },
    {
      "problems_solved": 60,
      "tag": "two-pointers"
    }
  ],
  "skills_intermediate": [
    {
      "problems_solved": 58,
      "tag": "tree"
    },
    {
      "problems_solved": 54,
      "tag": "binary-tree"
    },
    {
      "problems_solved": 152,
      "tag": "hash-table"
    },
    {
      "problems_solved": 11,
      "tag": "ordered-set"
    },
    {
      "problems_solved": 34,
      "tag": "graph"
    },
    {
      "problems_solved": 86,
      "tag": "greedy"
    },
    {
      "problems_solved": 65,
      "tag": "binary-search"
    },
    {
      "problems_solved": 83,
      "tag": "depth-first-search"
    },
    {
      "problems_solved": 56,
      "tag": "breadth-first-search"
    },
    {
      "problems_solved": 9,
      "tag": "recursion"
    },
    {
      "problems_solved": 29,
      "tag": "sliding-window"
    },
    {
      "problems_solved": 48,
      "tag": "bit-manipulation"
    },
    {
      "problems_solved": 140,
      "tag": "math"
    },
    {
      "problems_solved": 3,
      "tag": "randomized"
    },
    {
      "problems_solved": 21,
      "tag": "design"
    },
    {
      "problems_solved": 1,
      "tag": "iterator"
    },
    {
      "problems_solved": 8,
      "tag": "brainteaser"
    },
    {
      "problems_solved": 2,
      "tag": "database"
    }
  ],
  "solutions": 1392,
  "solved": {
    "all": 704,
    "easy": 127,
    "hard": 154,
    "medium": 423
  },
  "streak": 3,
  "submission_calendar": [
    {
      "date": "2025-11-22",
      "submissions": 1
    },
    {
      "date": "2025-11-30",
      "submissions": 3
    },
    {
      "date": "2025-12-07",
      "submissions": 1
    },
    {
      "date": "2025-12-14",
      "submissions": 2
    },
    {
      "date": "2026-01-03",
      "submissions": 3
    },
    {
      "date": "2026-01-04",
      "submissions": 2
    },
    {
      "date": "2026-01-25",
      "submissions": 5
    },
    {
      "date": "2026-01-31",
      "submissions": 6
    },
    {
      "date": "2026-02-01",
      "submissions": 3
    },
    {
      "date": "2026-02-14",
      "submissions": 1
    },
    {
      "date": "2026-02-15",
      "submissions": 2
    },
    {
      "date": "2026-03-01",
      "submissions": 4
    },
    {
      "date": "2026-03-14",
      "submissions": 1
    },
    {
      "date": "2026-03-15",
      "submissions": 7
    },
    {
      "date": "2026-03-22",
      "submissions": 4
    },
    {
      "date": "2026-04-19",
      "submissions": 2
    },
    {
      "date": "2026-04-26",
      "submissions": 3
    },
    {
      "date": "2026-05-03",
      "submissions": 3
    },
    {
      "date": "2026-05-04",
      "submissions": 1
    },
    {
      "date": "2026-05-09",
      "submissions": 1
    },
    {
      "date": "2026-05-10",
      "submissions": 3
    },
    {
      "date": "2026-05-15",
      "submissions": 1
    },
    {
      "date": "2026-05-17",
      "submissions": 3
    },
    {
      "date": "2026-06-28",
      "submissions": 2
    },
    {
      "date": "2026-07-04",
      "submissions": 2
    },
    {
      "date": "2026-07-05",
      "submissions": 2
    },
    {
      "date": "2026-07-12",
      "submissions": 3
    },
    {
      "date": "2026-07-18",
      "submissions": 3
    },
    {
      "date": "2026-07-19",
      "submissions": 2
    },
    {
      "date": "2026-07-20",
      "submissions": 2
    },
    {
      "date": "2026-07-26",
      "submissions": 3
    },
    {
      "date": "2026-08-01",
      "submissions": 4
    },
    {
      "date": "2026-08-02",
      "submissions": 4
    },
    {
      "date": "2026-08-15",
      "submissions": 2
    },
    {
      "date": "2026-08-16",
      "submissions": 1
    },
    {
      "date": "2026-08-23",
      "submissions": 1
    },
    {
      "date": "2026-08-29",
      "submissions": 2
    },
    {
      "date": "2026-08-30",
      "submissions": 2
    },
    {
      "date": "2026-09-06",
      "submissions": 3
    },
    {
      "date": "2026-09-12",
      "submissions": 3
    },
    {
      "date": "2026-09-13",
      "submissions": 2
    },
    {
      "date": "2026-09-20",
      "submissions": 6
    },
    {
      "date": "2026-09-26",
      "submissions": 2
    },
    {
      "date": "2026-10-04",
      "submissions": 3
    },
    {
      "date": "2026-10-24",
      "submissions": 5
    },
    {
      "date": "2026-10-25",
      "submissions": 3
    },
    {
      "date": "2026-11-01",
      "submissions": 3
    },
    {
      "date": "2026-11-07",
      "submissions": 4
    },
    {
      "date": "2026-11-15",
      "submissions": 3
    },
    {
      "date": "2026-11-17",
      "submissions": 3
    }
  ],
  "twitter": null,
  "url": "https://leetcode.com/u/lee215/",
  "username": "lee215",
  "websites": [
    "https://www.youtube.com/channel/UCUBt1TDQTl1atYsscVoUzoQ"
  ]
}
```

## 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-user-profile-api/?offering=b0a0f53b-5202-4681-9e77-5061dde0cf35

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