# VK Scraper (`mina_safwat/vk-scraper`) Actor

Scrapes posts from public VK (VKontakte) communities, groups and pages with likes, reposts, views, comment counts, photos and attachments, plus community profiles and optional comments. No login or token needed.

- **URL**: https://apify.com/mina_safwat/vk-scraper.md
- **Developed by:** [Mina](https://apify.com/mina_safwat) (community)
- **Categories:** Social media, Marketing, Automation
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does VK Scraper do?

**VK Scraper** collects wall posts from **public VK (VKontakte) communities,
groups and pages**: the full text, **date, likes, reposts, views and comment
count**, photo URLs, video, link, article and file titles, the pinned flag and
the original of every repost. It also saves a **community profile** (name,
**follower count**, description, verified badge, website, photo) and, if you
ask for them, the **comments** under each post. Paste community links or
single post links. **No VK account, login or access token is needed.**

Try it with the prefilled community: open the Actor, click **Start**, and the
first 20 posts from [vk.com/vk](https://vk.com/vk) arrive in a few seconds.
Because it runs on the Apify platform, you also get API access, scheduled
runs, integrations (Google Sheets, Make, Zapier, webhooks), run monitoring,
and automatic retries through Apify Proxy if [VK](https://vk.com) ever refuses
a request.

### Why scrape VK communities?

- **Media monitoring in Russian-speaking markets**: VK is the largest social
  network in Russia and the CIS. Follow news, brand and industry communities
  and get every new post as structured data.
- **Competitor and brand research**: compare how communities post and how many
  likes, reposts, views and comments each post earns.
- **Audience research**: rank communities by follower count and engagement per
  post.
- **Sentiment analysis**: collect the comments under posts about a product,
  event or topic.
- **Archiving and AI datasets**: save a community's history with text, links
  and media URLs for analysis or model training.

### How to scrape VK posts

1. Open a public community on VK and copy its address, such as
   `https://vk.com/habr`. Links like `https://vk.com/club22822305`,
   `https://vk.com/public22822305`, `vk.ru/...`, `m.vk.com/...` and a bare
   screen name such as `habr` all work.
2. Paste it into **VK links**, one link per line. To get one post, paste its
   link instead, such as `https://vk.com/wall-22822305_1730374`.
3. Set **Max posts per community** (newest first).
4. Optionally turn on **Include comments** and set **Max comments per post**.
5. Click **Start**, then download the results when the run finishes.

### Input

Everything is set on the Input tab.

| Field | Type | Default | What it does |
|---|---|---|---|
| `startUrls` | list of links | `["https://vk.com/vk"]` (prefill) | Community or post links. Plain strings or `{"url": "..."}` objects. |
| `maxPostsPerCommunity` | integer | 100 | Posts per community, newest first; a pinned post comes first and counts. 0 saves only the profile. |
| `includeCommunityInfo` | boolean | true | Adds one profile row per community. |
| `includeComments` | boolean | false | Also saves top-level comments of each post. |
| `maxCommentsPerPost` | integer | 20 | Top-level comments per post, oldest first (up to 1,000). |
| `proxyConfiguration` | proxy | none | Leave empty; the Actor falls back to Apify Proxy on its own. |

In JSON, the input looks like this:

```json
{
    "startUrls": [
        "https://vk.com/habr",
        "https://vk.com/club22822305",
        "https://vk.com/wall-22822305_1730374"
    ],
    "maxPostsPerCommunity": 100,
    "includeCommunityInfo": true,
    "includeComments": true,
    "maxCommentsPerPost": 20
}
```

### Output

Each row has a `type`: `post`, `comment` or `community`. The Output tab has a
view for each. You can download the dataset in various formats such as JSON,
HTML, CSV, or Excel. A post (shortened):

```json
{
    "type": "post",
    "url": "https://vk.com/wall-22822305_1730374",
    "postId": "-22822305_1730374",
    "date": "2026-10-16T10:25:00+00:00",
    "editedAt": "2026-10-17T09:36:47+00:00",
    "text": "Папы могут всё: и починить велосипед, и поговорить по душам…",
    "links": [],
    "likes": 492,
    "reposts": 46,
    "views": 144093,
    "comments": 307,
    "isPinned": false,
    "isAd": false,
    "communityId": 22822305,
    "communityName": "ВКонтакте",
    "communityUrl": "https://vk.com/vk",
    "authorId": -22822305,
    "authorName": "ВКонтакте",
    "photos": [],
    "attachments": [
        { "type": "video", "title": "С Днём отца! | VK", "url": "https://vk.com/video-22822305_456243492" }
    ],
    "repostOf": null,
    "scrapedAt": "2026-10-20T14:47:34.363520+00:00"
}
```

A community profile:

```json
{
    "type": "community",
    "url": "https://vk.com/mash",
    "communityId": 112510789,
    "name": "Mash | Мэш",
    "screenName": "mash",
    "communityType": "page",
    "followers": 1949622,
    "isVerified": true,
    "description": "Mash — паблик быстрых, эксклюзивных и важных новостей…",
    "status": "Новости, которые вы заслужили",
    "activity": "Internet media",
    "website": null,
    "photoUrl": "https://sun1-89.vkuserphoto.ru/…"
}
```

### Data fields

#### Posts

| Field | Description |
|---|---|
| `url`, `postId` | Post link and VK id (`<owner>_<post>`; communities have negative owner ids). |
| `date`, `editedAt` | Published and last edited time, ISO 8601 in UTC (`editedAt` is null if never edited). |
| `text` | Full post text as vk.com shows it, with VK's link and mention markup reduced to the visible label (empty for posts that are only media or a repost). |
| `links` | Full URLs of the links written into the text (VK often shows them shortened). |
| `likes`, `reposts`, `views`, `comments` | Counts as numbers; `views` is null on posts VK shows no counter for. |
| `isPinned`, `isAd` | Pinned to the top of the wall; marked as an advert. |
| `communityId`, `communityName`, `communityUrl` | The community whose wall it is on. |
| `authorId`, `authorName` | Who posted it: the community itself (negative id) or a person. |
| `photos` | URLs of the attached photos in their largest size. |
| `attachments` | Every other attachment as `{type, title, url}`: video, clip, link, article, doc, poll, audio. |
| `repostOf` | For reposts: the original post's `url`, `postId`, `date`, `text`, `links`, `authorId`, `authorName`, `photos`. |

#### Comments (opt-in)

| Field | Description |
|---|---|
| `url`, `commentId`, `postId`, `postUrl` | The comment's link and id and the post it belongs to. |
| `date`, `text`, `links`, `likes` | When it was written, its text (markup reduced to labels), the full URLs linked in it, and its like count. |
| `replies` | Number of replies in its thread (the replies themselves are not saved). |
| `authorId`, `authorName`, `photos`, `communityId` | Who wrote it, attached photo URLs, and the community. |

#### Community profiles

| Field | Description |
|---|---|
| `url`, `communityId`, `name`, `screenName` | The community's link, id and names. |
| `communityType` | `page`, `group` or `event`. |
| `followers` | Exact member count. |
| `isVerified` | VK's verified badge. |
| `description`, `status`, `activity`, `website`, `photoUrl` | Profile text, the status line, the topic VK lists, the website and the avatar. |

Every row also has `type` and `scrapedAt`.

### How much does it cost to scrape VK?

The Actor uses plain HTTP requests (no browser), reads 100 posts per request,
and needs no proxy for VK, so runs are fast and cheap: the prefilled run takes
about 5 seconds, and 600 posts with 3,600 comments took under 90 seconds. You
pay per result row (post, comment or community profile); see the **Pricing**
tab for the exact price. Inputs that give nothing are never billed.

### Tips

- Use **Max posts per community** to control cost: 100 posts are one request
  to VK.
- Comments multiply the row count: 100 posts × 20 comments can be up to 2,100
  rows. Leave them off when you only need post statistics.
- Set **Max posts per community** to 0 to get only community profiles, for
  example to compare follower counts across many communities.
- Schedule the Actor daily with a small limit to follow new posts.

### FAQ, disclaimers and support

**Do I need a VK account or access token?** No. The Actor reads what VK shows
to any visitor who is not signed in.

**Which links don't work?** Personal profiles (`vk.com/id1` or a person's
screen name) are out of scope and are skipped. Closed and private communities,
banned or deleted communities, walls that are turned off, and deleted posts
are skipped too. Each skipped link is listed with the reason in the
`FAILED_INPUTS` record in the run's key-value store, and the run still
succeeds. A run fails only if VK could not be reached for any link.

**Are comment replies included?** Only top-level comments are saved, oldest
first; `replies` tells you how many replies each one has.

**Is it legal to scrape VK?** The Actor reads only public posts that VK shows
to anyone without signing in. Even so, check VK's terms and the laws that
apply to you before using the data, especially for commercial use.

**Personal data:** posts and community profiles describe public communities.
Comments, and posts that people publish on a community's open wall, carry the
author's name and VK id, which is personal data. The Actor never reads
personal profiles. Only collect comments if you have a legitimate reason, and
store and process them as data-protection laws such as the GDPR require.

**Found a problem or need a custom field?** Open an issue on the **Issues**
tab. We read every report, and custom solutions are available on request.

# Actor input Schema

## `startUrls` (type: `array`):

Public VK community links, one per line: https://vk.com/habr, https://vk.com/club22822305, https://vk.com/public22822305 (vk.ru and m.vk.com links work too, as does a bare screen name). Paste a post link (https://vk.com/wall-22822305_1730374) to get that one post. Personal profiles, closed communities and other links are skipped and listed in the FAILED_INPUTS record.

## `maxPostsPerCommunity` (type: `integer`):

Stops after this many wall posts for each community, newest first (a pinned post comes first and counts too). Set 0 to save only community profiles.

## `includeCommunityInfo` (type: `boolean`):

Adds one row per community with its name, follower count, description, verified badge, website and photo.

## `includeComments` (type: `boolean`):

Also saves the top-level comments of every post (replies inside a thread are counted, not saved). Each comment is a separate row and is billed like a post.

## `maxCommentsPerPost` (type: `integer`):

Stops after this many top-level comments for each post, oldest first. Up to 1,000.

## `proxyConfiguration` (type: `object`):

Leave this empty: the Actor connects directly and, if VK ever refuses, retries through Apify's datacenter and then residential proxies on its own.

## Actor input object example

```json
{
  "startUrls": [
    "https://vk.com/vk"
  ],
  "maxPostsPerCommunity": 20,
  "includeCommunityInfo": true,
  "includeComments": false,
  "maxCommentsPerPost": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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 = {
    "startUrls": [
        "https://vk.com/vk"
    ],
    "maxPostsPerCommunity": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("mina_safwat/vk-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 = {
    "startUrls": ["https://vk.com/vk"],
    "maxPostsPerCommunity": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("mina_safwat/vk-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 '{
  "startUrls": [
    "https://vk.com/vk"
  ],
  "maxPostsPerCommunity": 20
}' |
apify call mina_safwat/vk-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mina_safwat/vk-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/Jg9bVoOtIFGbUm8C7/builds/q5r6PyIQ2m9jVblHb/openapi.json
