# Cses — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Explore the CSES Problem Set by browsing problems across different categories, viewing detailed problem information, and discovering available courses and contests. Access comprehensive problem lists organized by topic to find coding challenges tailored to your learning goals.

**Category:** Education | **Website:** [cses.fi/](https://cses.fi/) | **Docs:** [parse.bot/marketplace/29605562-0103-4fd5-a6b7-c6d7f459f8e5/cses-fi-api](https://parse.bot/marketplace/29605562-0103-4fd5-a6b7-c6d7f459f8e5/cses-fi-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-cses-fi-api-29605562/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_contests_list

Returns all available contests on CSES, including contest name, description, and URL. Single-page response with no parameters.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cses-fi-api-29605562/get_contests_list \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_courses_list

Returns all available courses on CSES, including name, description, and URL. Single-page response with no parameters.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cses-fi-api-29605562/get_courses_list \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_problem_detail

Returns the full problem statement for a given task ID, including title, time/memory limits, description text, input/output format, constraints, and worked examples. Raises NotFoundError when the task_id does not correspond to any CSES problem.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `task_id` | string | Yes | Numeric task ID of the problem (e.g. '1068'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cses-fi-api-29605562/get_problem_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"task_id":"<string>"}'
```

### get_problem_set_list

Returns all problems in the CSES Problem Set grouped by category. Each category contains its name and a list of problem summaries with task IDs, acceptance stats, technique hints, and URLs. Single-page response; no pagination parameters.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cses-fi-api-29605562/get_problem_set_list \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_problems_by_category

Returns all problems within a specific category by name, including task IDs, acceptance stats, techniques, and URLs. The category parameter is matched as a case-insensitive substring against the available category names. Raises NotFoundError when no category matches.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category` | string | Yes | Category name to filter by. Matched as a case-insensitive substring. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cses-fi-api-29605562/get_problems_by_category \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category":"<string>"}'
```
