# Codeforces Scraper (`parseforge/codeforces-scraper`) Actor

Scrapes Codeforces user profiles, problem sets, contest lists, and rated users. Returns each record as a flat row for easy export.

- **URL**: https://apify.com/parseforge/codeforces-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 6 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $31.05 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### Codeforces Scraper

**Scrape Codeforces user profiles, problem sets, contests, and rated lists with one actor.** Get handles, ratings, tags, and contest metadata in a flat row. No API key or login. Export to CSV, JSON, Excel, or XML.

Codeforces' official API is rate-limited and requires manual pagination. This actor reads the public pages directly, filtered by handle, problem tag, or contest type, and returns each match in one fixed schema. It covers user profiles, problem sets, contest lists, and the rated users leaderboard.

| Who uses it | What they scrape Codeforces for |
|---|---|
| Competitive programmers | Track their own rating history and compare with peers |
| Coaches and trainers | Monitor student progress and identify weak topics |
| Recruiters | Find top-rated competitive programmers for hiring |
| Researchers | Analyze problem difficulty and contest trends |

### What it does

This actor collects Codeforces user profiles, problem sets, contest lists, and rated users, and returns each record as a flat row.

- 👤 **User profiles:** scrape any Codeforces handle for rating, rank, and contribution
- 📚 **Problem set:** filter problems by tags like dp, graphs, or math
- 🏆 **Contest list:** get all contests, optionally including gym contests
- 📈 **Rated users:** fetch the top players, optionally only active ones

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with Codeforces data

**📊 Track your rating progress.**

A competitive programmer runs the actor on their handle weekly and plots rating changes over time.

**🎯 Build a problem practice list.**

A coach scrapes problems tagged 'dp' and 'graphs' to assign targeted homework.

**🏅 Scout top talent.**

A recruiter pulls the rated users list to find candidates with high Codeforces ratings.

**🔍 Analyze contest trends.**

A researcher collects contest metadata to study problem difficulty and participation patterns.

### Why choose this scraper

|  | What you get |
|---|---|
| **No API key** | Uses public pages, no registration or OAuth |
| **Four modes** | Users, problems, contests, and rated list in one actor |
| **Flat output** | Every record is a row ready for CSV or database |
| **Flexible filters** | Tags, gym inclusion, and active-only options |

### How it compares

This actor focuses on the four core data types with flexible filters, while the competitor also includes submissions.

| Feature | ParseForge | Codeforces Scraper - Users, Submissions, Contests |
|---|---|---|
| User profiles | Yes | Yes |
| Problem set with tag filtering | Yes | Yes |
| Contest list with gym option | Yes | Yes |
| Rated users list | Yes | Not listed |
| Submissions | Not listed | Yes |
| Active-only filter for rated users | Yes | Not listed |

### Configure the run

Drive the actor from handles, problem tags, contest type, and active-only flags, alone or together, and filters run as each record is read so only matches reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "mode": "users",
  "handles": [
    "tourist"
  ],
  "maxItems": 10
}
```

A larger pull:

```json
{
  "mode": "users",
  "handles": [
    "tourist"
  ],
  "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.0414 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $4.14 |
| 1,000 results | $41.40 |
| 10,000 results | $414.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [Codeforces Scraper](https://apify.com/parseforge/codeforces-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to Codeforces through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/codeforces-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check your input. For users mode, ensure the handle is spelled correctly. For problemset mode, verify the tags exist. Also check maxItems is not set too low.

**Why is my run limited to 10 items?**

Free users are limited to 10 items as a preview. Upgrade to a paid plan to increase maxItems up to 1,000,000.

**Why are some user profiles missing fields?**

Some fields may be empty if the user has not set them, such as organization or country. The actor returns what is available on the public profile.

**Why does the rated list not include all users?**

The rated list only includes users who have participated in rated contests. If activeOnly is true, it further filters to recently active users.

**Why do I get an error when scraping many handles?**

Codeforces may rate-limit requests. Try reducing the number of handles per run or increasing the delay between requests if available.

### FAQ

| Question | Answer |
|---|---|
| Do I need a Codeforces API key? | No. The actor reads public pages directly, so no registration or key is required. |
| Can I scrape multiple user handles at once? | Yes. In users mode, provide a list of handles and the actor fetches each one. |
| How do I filter problems by topic? | Use the tags input in problemset mode. For example, enter 'dp' or 'graphs' to get only those problems. |
| What is the difference between contests and gym contests? | Regular contests are rated and open to all. Gym contests are training contests, often from other sources. You can include or exclude gym contests with the gym checkbox. |
| How do I get only active rated users? | In ratedList mode, set activeOnly to true. This filters to users who participated recently. |
| Is there a limit on how many records I can scrape? | Free users are limited to 10 items as a preview. Paid users can set maxItems up to 1,000,000. |
| What output formats are supported? | You can export the dataset as CSV, JSON, Excel, or XML from the Apify platform. |
| Can I schedule this actor to run automatically? | Yes. Use Apify's scheduler to run it daily, weekly, or at any interval you choose. |
| Does this actor handle pagination automatically? | Yes. It fetches all pages up to your maxItems limit without manual intervention. |
| Can I scrape submissions as well? | This actor focuses on profiles, problems, contests, and rated users. For submissions, consider a dedicated submissions scraper. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Codeforces, LLC. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `mode` (type: `string`):

What to scrape

## `handles` (type: `array`):

List of Codeforces handles to scrape

## `tags` (type: `array`):

Filter problems by tags (e.g. dp, graphs, math)

## `gym` (type: `boolean`):

Whether to include gym (training) contests

## `activeOnly` (type: `boolean`):

Only include users who participated recently

## `maxItems` (type: `integer`):

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## Actor input object example

```json
{
  "mode": "users",
  "handles": [
    "tourist"
  ],
  "tags": [],
  "gym": false,
  "activeOnly": false,
  "maxItems": 10
}
```

# Actor output Schema

## `overview` (type: `string`):

Overview of scraped data

## `fullData` (type: `string`):

Complete dataset

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "users",
    "handles": [
        "tourist"
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/codeforces-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "users",
    "handles": ["tourist"],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/codeforces-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "users",
  "handles": [
    "tourist"
  ],
  "maxItems": 10
}' |
apify call parseforge/codeforces-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/codeforces-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/plI5X8nbZ8NyYauhq/builds/wYLMfCWt7mMIDDBsL/openapi.json
