# LeetCode daily challenge API

Get LeetCode Daily Challenge data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as output, raw, and retrieve structured data including challenge date, challenge source link, and featured problem metadata to populate daily practice cards, and link problem references, ready for production pipelines and AI agent automation.

Documentation: https://openany.si/leetcode/leetcode-daily-challenge-api/5161bedf-4b6e-4d8a-8bb1-17556cd02389/
API ID: 5161bedf-4b6e-4d8a-8bb1-17556cd02389
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/leetcode/v1/daily
Page update time: 2026-12-03T02:44:09.661Z
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:06.081Z. 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 Daily Challenge API

This no-input endpoint returns date, link and problem. It does not expose a historical-date selector.

## What You Can Build

- **Populate daily practice cards**: Keep date with the featured problem.
- **Link problem references**: Use the returned source link.

## Returned Data

| Field | Meaning |
| --- | --- |
| `date` | Challenge date |
| `link` | Challenge source link |
| `problem` | Featured problem metadata |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "LeetCode daily challenge 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": {
        "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"
    },
    "credits_used": {
      "type": "integer"
    },
    "date": {
      "type": "string"
    },
    "fetched_at": {
      "type": "string"
    },
    "link": {
      "type": "string"
    },
    "problem": {
      "type": "object",
      "properties": {
        "acceptance_rate": {
          "type": "number"
        },
        "accepted": {
          "type": "integer"
        },
        "category": {
          "type": "string"
        },
        "difficulty": {
          "type": "string"
        },
        "dislikes": {
          "type": "integer"
        },
        "function_name": {
          "type": "string"
        },
        "has_solution": {
          "type": "boolean"
        },
        "has_video_solution": {
          "type": "boolean"
        },
        "hints_count": {
          "type": "integer"
        },
        "id": {
          "type": "string"
        },
        "internal_id": {
          "type": "string"
        },
        "languages": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "likes": {
          "type": "integer"
        },
        "params": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            }
          }
        },
        "premium": {
          "type": "boolean"
        },
        "return_type": {
          "type": "string"
        },
        "similar": {
          "type": "array",
          "items": {}
        },
        "slug": {
          "type": "string"
        },
        "submissions": {
          "type": "integer"
        },
        "title": {
          "type": "string"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              }
            }
          }
        },
        "url": {
          "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/daily?output=json&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,
  "credits_used": 1,
  "date": "2026-11-19",
  "fetched_at": "2026-11-19T12:29:38.520Z",
  "link": "https://leetcode.com/problems/minimum-score-by-changing-two-elements/",
  "problem": {
    "acceptance_rate": 61.8,
    "accepted": 59375,
    "category": "Algorithms",
    "difficulty": "Medium",
    "dislikes": 371,
    "function_name": "minimizeSum",
    "has_solution": true,
    "has_video_solution": false,
    "hints_count": 2,
    "id": "2567",
    "internal_id": "2706",
    "languages": [
      "cpp",
      "java",
      "python3",
      "python",
      "javascript",
      "typescript",
      "csharp",
      "c",
      "golang",
      "kotlin",
      "swift",
      "rust",
      "ruby",
      "php",
      "dart",
      "scala",
      "elixir",
      "erlang",
      "racket"
    ],
    "likes": 410,
    "params": [
      {
        "name": "nums",
        "type": "integer[]"
      }
    ],
    "premium": false,
    "return_type": "integer",
    "similar": [],
    "slug": "minimum-score-by-changing-two-elements",
    "submissions": 96080,
    "title": "Minimum Score by Changing Two Elements",
    "topics": [
      {
        "name": "Array",
        "slug": "array"
      },
      {
        "name": "Greedy",
        "slug": "greedy"
      },
      {
        "name": "Sorting",
        "slug": "sorting"
      }
    ],
    "url": "https://leetcode.com/problems/minimum-score-by-changing-two-elements/"
  }
}
```

## 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
### Are any inputs required?
No.

### Can I query an arbitrary historical date?
No date parameter is exposed.

### Should I identify the challenge by my local date?
Use the returned date so the source challenge scope remains clear.

### Does this solve the challenge?
No. It returns the challenge reference and metadata.

### Does it submit an answer?
No.

### 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-daily-challenge-api/5161bedf-4b6e-4d8a-8bb1-17556cd02389/

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