# LeetCode Problems and Profiles API

> LeetCode coding problems, the daily challenge and public user solve stats

- Vendor: `leetcodeproblemsandprofilesapi` · version 1.0 · category Education · tags leetcode api, coding problems api, daily challenge api, leetcode stats api, interview prep api, algorithm problems api
- Datasource: custom HTTP routes
- Marketplace page: https://apiclay.com/api/leetcodeproblemsandprofilesapi
- This document: https://apiclay.com/docs/leetcodeproblemsandprofilesapi.md
- OpenAPI 3.1: https://apiclay.com/api/leetcodeproblemsandprofilesapi/openapi.json
- MCP: connect https://api.apiclay.com/v1/mcp (see https://apiclay.com/llms.txt), then `apiclay_describe_api` with vendor `leetcodeproblemsandprofilesapi`
- Updated: 2026-11-18

## About

## LeetCode Problems and Profiles API

Read LeetCode's public problem set: problem counts by difficulty, today's daily coding challenge, the problem list filtered by difficulty with acceptance rates and topic tags, the full statement of one problem with likes, hints and similar questions, and a public user's ranking and solved counts.

Data comes from **leetcode.com** (https://leetcode.com). Every route calls the source's own public JSON endpoint (found with the live-URL scan of https://leetcode.com) and returns it unchanged.

Typical flow: `/problems` to browse, `/problem` with a `titleSlug` such as `two-sum`, `/user` with a username.

### Routes

Every route is a POST with a JSON body `{"variables": {...}}`; the GraphQL query is fixed.

#### POST `/problems-count` - Problem counts
No parameters; send `{"variables": {}}`.

Returns: `data.allQuestionsCount[]` (`difficulty` All/Easy/Medium/Hard, `count`).

#### POST `/daily` - Daily challenge
No parameters; send `{"variables": {}}`.

Returns: `data.activeDailyCodingChallengeQuestion` (`date`, `link`, `question` with `questionFrontendId`, `title`, `titleSlug`, `difficulty`, `acRate`, `topicTags`).

#### POST `/problems` - Problem list
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| variables.categorySlug | body | string | no | `""` for all, or `algorithms`, `database`, `shell`. |
| variables.limit | body | number | no | Problems per page. |
| variables.skip | body | number | no | Offset. |
| variables.filters | body | object | no | e.g. `{"difficulty": "HARD"}` or `{"tags": ["dynamic-programming"]}`. |

Returns: `data.problemsetQuestionList` (`total`, `questions[]` with `questionFrontendId`, `title`, `titleSlug`, `difficulty`, `acRate`, `isPaidOnly`, `topicTags`).

#### POST `/problem` - Problem
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| variables.titleSlug | body | string | yes | Slug from `/problems`, e.g. `two-sum`. |

Returns: `data.question` (`title`, `difficulty`, `likes`, `dislikes`, `content` HTML, `topicTags`, `stats` JSON string, `hints`, `similarQuestions`).

#### POST `/user` - User profile
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| variables.username | body | string | yes | LeetCode username. |

Returns: `data.matchedUser` (`profile` with `ranking`, `reputation`, `countryName`, `submitStatsGlobal.acSubmissionNum[]` solved per difficulty), or `null` for unknown users.

### Caveats

- Premium-only problems return `content: null`. Problem statements are LeetCode's content; check its terms before republishing them.
- Upstream responses can change over time. Verify fields before relying on them.
- Not affiliated with or endorsed by leetcode.com.

## Pricing

- Pay as you go: 0.0012 credits/request
- Trial: 1 free requests per buyer
- Billing order: trial requests -> subscribed plan requests -> pay as you go. 1 credit's USD value is shown on the marketplace page.

## HTTP routes

Only the public, buyer-facing parts of each route are listed; vendor-side credentials stay on the gateway.

### POST /problems-count — ProblemsCount
- Gateway: `POST https://api.apiclay.com/v1/api/leetcodeproblemsandprofilesapi/problems-count`
- Body sample (JSON):

```json
{"variables": {}}
```

- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### POST /daily — Daily
- Gateway: `POST https://api.apiclay.com/v1/api/leetcodeproblemsandprofilesapi/daily`
- Body sample (JSON):

```json
{"variables": {}}
```

- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### POST /problems — Problems
- Gateway: `POST https://api.apiclay.com/v1/api/leetcodeproblemsandprofilesapi/problems`
- Body sample (JSON):

```json
{"variables": {"categorySlug": "", "limit": 20, "skip": 0, "filters": {"difficulty": "HARD"}}}
```

- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### POST /problem — Problem
- Gateway: `POST https://api.apiclay.com/v1/api/leetcodeproblemsandprofilesapi/problem`
- Body sample (JSON):

```json
{"variables": {"titleSlug": "two-sum"}}
```

- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### POST /user — User
- Gateway: `POST https://api.apiclay.com/v1/api/leetcodeproblemsandprofilesapi/user`
- Body sample (JSON):

```json
{"variables": {"username": "lee215"}}
```

- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

## Call example

```bash
curl -X POST "https://api.apiclay.com/v1/api/leetcodeproblemsandprofilesapi/problems-count" \
  -H "token: <YOUR_APICLAY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"variables": {}}'
```

Index of every published API: https://apiclay.com/llms.txt
