# LeetCode user recent accepted submissions API

Get LeetCode Recent Accepted Submissions data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as limit, output, raw, and retrieve structured data including submission identifier, problem slug, problem title, reported submission language, and submission timestamp to update practice timelines, and link solved references.

Documentation: https://openany.si/leetcode/leetcode-user-recent-accepted-submissions-api/7285932f-4c53-4832-9532-3c1b9e287352/
API ID: 7285932f-4c53-4832-9532-3c1b9e287352
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/leetcode/v1/user/submissions
Page update time: 2026-12-03T02:44:09.795Z
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.
Contract update time: 2026-12-03T02:44:07.053Z. 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": []
  }
}
```

## Usage and limits
## LeetCode Recent Accepted Submissions API

limit defaults to 20 and is capped at 20. The endpoint exposes no page or cursor input for historical traversal.

## What You Can Build

- **Update practice timelines**: Retain submission and problem IDs separately.
- **Link solved references**: Use the returned problem slug.

## Returned Data

| Field | Meaning |
| --- | --- |
| `items[].id` | Submission identifier |
| `items[].slug` | Problem slug |
| `items[].title` | Problem title |
| `items[].language` | Reported submission language |
| `items[].submitted_at` | Submission timestamp |
| `items[].url` | Source reference URL |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "LeetCode user recent accepted submissions 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."
        },
        "limit": {
          "type": "integer",
          "description": "Results per page (default 20, max 20)."
        },
        "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": {
    "cached": {
      "type": "boolean"
    },
    "count": {
      "type": "integer"
    },
    "credits_used": {
      "type": "integer"
    },
    "fetched_at": {
      "type": "string"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "submitted_at": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        }
      }
    },
    "username": {
      "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/submissions?limit=1&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
{
  "cached": false,
  "count": 1,
  "credits_used": 1,
  "fetched_at": "2026-11-19T12:29:46.345Z",
  "items": [
    {
      "id": "2198067669",
      "language": "java",
      "slug": "longest-resilient-subarray-i",
      "submitted_at": "2026-11-17T14:51:52.000Z",
      "title": "Longest Resilient Subarray I",
      "url": "https://leetcode.com/problems/longest-resilient-subarray-i/"
    }
  ],
  "username": "lee215"
}
```

## 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.

## Common questions
### What is the maximum result count?
20; the default is also 20.

### Can I paginate older submissions?
No page or cursor input is exposed.

### Does this include failed submissions?
This operation is specifically for recent accepted submission references.

### Can I retrieve the submitted source code here?
No. The response contains reference metadata.

### Is submission id the problem number?
No. Keep the submission identifier distinct from the problem identity.

### Can I request CSV or NDJSON?
This OpenAny implementation serves JSON only. Omit output or use output=json.

## Available implementations
- apish: https://openany.si/leetcode/leetcode-user-recent-accepted-submissions-api/7285932f-4c53-4832-9532-3c1b9e287352/

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