# VK Scraper — Posts, Comments & Monitoring (`scrapelabmax/vk-scraper`) Actor

VK scraper (парсер ВК): public VKontakte wall posts from communities and profiles with likes, views, reposts, media, comment threads and page profiles (followers, verified, contacts). Keyword and date filters, monitoring that returns only new posts. No login.

- **URL**: https://apify.com/scrapelabmax/vk-scraper.md
- **Developed by:** [Scrapelab Max](https://apify.com/scrapelabmax) (community)
- **Categories:** Social media, News, Lead generation
- **Features:** Limited permissions
- **Stats:** 6 total users, 5 monthly users, 95.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.49 / 1,000 posts

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

## VK Scraper — Posts, Comments & Monitoring

Extract public posts from **VKontakte (VK, ВКонтакте)** communities and profiles: text, exact engagement counts, attachments, reposts and (optionally) comments with their reply threads and the page's profile (followers, verified badge, contacts). Filter by date and keywords, scrape dozens of walls in one run, and use **monitoring mode** on a schedule to receive only posts you haven't received before.

- No VK login, password or cookies required.
- Lightweight HTTP — no browser — so runs are fast and cheap.
- Pay only for delivered results. Filtered-out, duplicate and failed items are never billed.

**Парсер ВК (ВКонтакте):** собирает посты со стен сообществ и профилей, комментарии с ответами, данные о странице (подписчики, верификация, контакты) и ищет посты по ключевым словам. Логин и пароль VK не нужны; режим мониторинга по расписанию отдаёт только новые посты.

### What you can scrape

| Target | Examples |
|---|---|
| Community | `https://vk.com/kinopoisk`, `kinopoisk`, `club108468`, `public108468`, `-108468` |
| Public profile | `https://vk.com/durov`, `@durov`, `id1`, `1` |
| Single post | `https://vk.com/wall-108468_3576097`, `https://vk.com/kinopoisk?w=wall-108468_3576097` |

`vk.com`, `m.vk.com` and `vk.ru` URLs are accepted. Equivalent forms of the same wall are de-duplicated automatically.

You can also **search all of VK by keyword** with `searchQueries` (this needs a VK access token, see below).

### Input example

```json
{
  "targets": ["https://vk.com/kinopoisk", "https://vk.com/durov"],
  "maxItems": 1000,
  "maxItemsPerTarget": 500,
  "publishedAfter": "2026-10-01",
  "keywordsAny": ["AI", "технологии"],
  "excludeKeywords": ["реклама"],
  "includeReposts": true,
  "includePinnedPosts": false,
  "includeComments": false
}
```

#### Filters

- **publishedAfter / publishedBefore**: an ISO date (`2026-10-01`), an ISO datetime, or a relative value (`7 days`, `12 hours`). Pagination stops as soon as posts older than `publishedAfter` are reached.
- **keywordsAny / keywordsAll / excludeKeywords**: case-insensitive, Unicode-aware matching that works with Cyrillic. `ё` and `е` are treated as the same letter. Enable `searchRepostText` to also match the text of reposted posts.
- **includeReposts / includePinnedPosts**: include or exclude reposts and pinned posts.

Filters work *within the targets you supply*. To find posts anywhere on VK, use `searchQueries`.

A **direct post URL** is always returned, whatever the filters are, because you asked for that post specifically.

#### Page profile on every post (optional, free)

Set `"includeOwnerProfile": true` to add an `ownerProfile` object to each post, describing the community or user whose wall the post is on:

```json
"ownerProfile": {
  "id": -20629724,
  "type": "group",
  "name": "Хабр",
  "screenName": "habr",
  "url": "https://vk.com/habr",
  "communityType": "page",
  "isVerified": false,
  "followersCount": 610650,
  "description": "Вместе с вами строим IT-сообщество с 2006 года…",
  "status": "НЛО с вами!",
  "category": "Programming",
  "website": "https://habr.com",
  "city": null,
  "country": null,
  "photoUrl": "https://sun9-70.userapi.com/…",
  "contacts": [{ "description": "Про рекламу", "email": "adv@habr.team", "phone": null, "userId": null }]
}
```

- `followersCount` is the member count of a community or the follower count of a user, so you can compute engagement rates without a second tool.
- `contacts` lists what a community publishes in its own "Contacts" block. It is always empty for users.
- With keyword search, every post carries the profile of the wall it was found on.
- The profile of each wall in `targets` is also written to the run `SUMMARY`, even when no post matched your filters.
- Profiles are not billed. If VK does not return one, `ownerProfile` is `null` and the post is still delivered.

#### Search all of VK by keyword

```json
{ "searchQueries": ["биткоин", "apify"], "maxItems": 500, "publishedAfter": "7 days", "vkAccessToken": "<your VK token>" }
```

- Each query returns public posts from any community or profile, newest first. VK itself caps a query at roughly its newest 1,000 matches.
- **A VK access token is required.** VK does not allow keyword search for logged-out visitors, so this is the one feature that needs `vkAccessToken` (a VK user or service token). Scraping specific walls never needs one.
- Without a token the query is reported with error category `TOKEN_REQUIRED`; any walls in `targets` are still scraped.
- Date filters, keyword filters, `maxItems` and `maxItemsPerTarget` (per query) apply. You can mix `targets` and `searchQueries` in one run; a post found both ways is delivered once.
- In monitoring mode a query returns only posts published after the newest one seen by the previous run. If a run is cut short by a limit or an error, the older remainder of that run's results is skipped rather than delivered late.

#### Monitoring mode (scheduled runs)

```json
{ "targets": ["kinopoisk", "durov"], "monitoringMode": true, "monitorId": "my-brand-watch" }
```

- **First run:** collects the posts allowed by your limits and filters.
- **Later runs:** return only posts that weren't delivered before under this `monitorId`. A run with no new posts succeeds with status `EMPTY_SUCCESS` and costs nothing for results.
- **Adding a community:** add it to `targets` and the other communities keep their progress.
- **Pinned posts:** an old pinned post never hides new posts.
- **Late-published posts:** postponed posts that appear later are still detected.
- **Starting over:** set `resetMonitoringState: true` once to forget the history and backfill again.
- **Changing filters:** if you change filters, reset the state so older posts that now match can be picked up.

State is stored in a named key-value store in your own Apify account (`vk-monitor-<monitorId>`), isolated from other users. Monitor IDs are case-insensitive.

Combine monitoring mode with [Apify Schedules](https://docs.apify.com/platform/schedules) and webhooks or integrations to push new posts into Slack, Sheets, a warehouse, and so on.

#### Comments (optional, billed separately)

Set `includeComments: true` to attach up to `maxCommentsPerPost` public comments to each post, oldest first.

- Set `includeCommentReplies: true` to also collect the replies inside each thread. Each reply follows its parent comment, has `parentCommentId` set to that comment, and counts toward `maxCommentsPerPost`.
- `commentsCollected` is the number of comments attached.
- `commentsComplete` is `true` only when everything requested was collected: every top-level comment, plus every reply when replies are on.
- `commentsCount` is VK's total, which includes replies.
- Each comment has `repliesCount`, the size of its thread, whether or not replies are collected.
- A reply can point to a `parentCommentId` that isn't in the list when the parent comment was deleted but its thread remains.

### Output

One post per dataset row. Download as JSON, CSV, Excel, XML or RSS, or read it through the Apify API.

```json
{
  "schemaVersion": 1,
  "id": "-108468_3576097",
  "postId": 3576097,
  "ownerId": -108468,
  "ownerUrl": "https://vk.com/club108468",
  "postUrl": "https://vk.com/wall-108468_3576097",
  "text": "Синтия Эриво сыграет мать Тупака Шакура… #кино",
  "hashtags": ["кино"],
  "publishedAt": "2026-11-04T18:53:48.000Z",
  "editedAt": null,
  "scrapedAt": "2026-11-05T02:13:31.652Z",
  "author": { "id": -108468, "type": "group", "name": "Кинопоиск", "screenName": "kinopoisk", "url": "https://vk.com/kinopoisk" },
  "signer": null,
  "likesCount": 36,
  "commentsCount": 4,
  "repostsCount": 5,
  "viewsCount": 16829,
  "commentsClosed": false,
  "attachments": [{ "type": "photo", "id": "-108468_457514257", "url": "https://sun9-4.userapi.com/…", "width": 1920, "height": 1280, "description": null }],
  "isPinned": false,
  "isRepost": false,
  "isAd": false,
  "isDonut": false,
  "postType": "post",
  "postSource": { "type": "api", "platform": null },
  "copyright": null,
  "geo": null,
  "repost": null,
  "target": "https://vk.com/kinopoisk",
  "sourceMode": "anonymous-web-api"
}
```

| Field | Notes |
|---|---|
| `id` | Stable identity `ownerId_postId`, safe to use for de-duplication. |
| `publishedAt`, `editedAt`, `scrapedAt` | ISO 8601 in UTC. |
| `likesCount`, `commentsCount`, `repostsCount`, `viewsCount` | Exact counts from VK. Set to `null` when VK doesn't provide a value (for example, views on posts from before 2017), never `0`. |
| `hashtags` | `#hashtags` found in the text, without `#`, de-duplicated (`#тег@community` becomes `тег`). |
| `author`, `signer` | `author` is who posted (a community or a user). `signer` is the user who signed a community post, when VK shows one. |
| `commentsClosed` | `true` when commenting is disabled on the post. |
| `attachments` | Metadata and URLs for photos (largest size), videos (with `platform`, e.g. YouTube), links, docs, audio, polls, articles and albums. Media files are not downloaded. |
| `isDonut` | Paid (VK Donut) content; only the public preview is available. |
| `postSource` | How the post was created (`vk`, `api`, `rss`, `widget`…) and the client platform when known. |
| `copyright` | Source attribution shown on the post (URL and name), if any. |
| `geo` | Latitude, longitude and place name when the post is geotagged. |
| `repost` | The original post (id, URL, text, author, attachments) when `isRepost` is `true`. |
| `sourceMode` | How the data was obtained: `anonymous-web-api` or `official-api-token`. |
| `comments` | Only present when comments were requested. |

#### Run summary and errors

Every run writes a `SUMMARY` record to its key-value store. The record is not billed. It contains:

- the overall `status`: `SUCCEEDED`, `PARTIAL_SUCCESS`, `EMPTY_SUCCESS`, `TARGETS_UNAVAILABLE` or `FAILED`
- totals for the run
- per-target results: the wall's total post count (`wallPostsTotal`), delivered, scanned, duplicates, pages fetched, why collection stopped, and an error category

| Error category | Meaning |
|---|---|
| `INVALID_TARGET` | The page or post doesn't exist or was deleted, or the entry isn't a VK wall or post (for example a video, search or non-VK link). |
| `PRIVATE_TARGET` | The wall is closed, private or hidden. The scraper never tries to get around this. |
| `RATE_LIMITED` | VK throttled the requests and bounded retries didn't help. |
| `ACCESS_DENIED` | VK refused access, for example with a captcha challenge, which the scraper does not bypass. |
| `TIMEOUT`, `NETWORK_ERROR` | Transport failures after retries. |
| `TOKEN_REQUIRED` | A keyword search was requested without a VK access token. |
| `SOURCE_CHANGED` | VK changed the format of its response. Please report it. |
| `INTERNAL_ERROR` | An unexpected error. |

How these map to the run outcome:

- One failing target doesn't stop the others. The run reports `PARTIAL_SUCCESS`.
- An entry that isn't a VK community, profile or wall post (a video, clip, search or non-VK link, a keyword) is skipped and reported as `INVALID_TARGET`. The other targets are still scraped.
- When every target is private, closed, deleted, nonexistent or unsupported (or is a keyword search without a token), the run finishes with status `TARGETS_UNAVAILABLE` and a message explaining why. Nothing is delivered or billed for results, and the Actor run itself is not marked as failed, because the scraper worked.
- The Actor run fails only when nothing could be delivered because of a VK access, network or internal error.
- Invalid settings (for example a malformed date) are rejected before anything is scraped, with an explanation of what's wrong.

### Pricing

Pay-per-event pricing:

| Event | Price |
|---|---|
| `post` (one delivered post) | **$1.49 per 1,000 posts** |
| Actor start (once per run) | $0.00005 |
| Comments and replies (only if enabled) | not charged at the moment |
| Page profiles (`includeOwnerProfile`) | free |

Filtered-out posts, duplicates, already-monitored posts and failed targets are free. The Pricing tab of this page always shows the prices in force.

The run stops cleanly when your **maximum cost per run** is reached. When that happens, comments are trimmed first so posts are still delivered.

| Usage | Charge |
|---|---:|
| 100 posts | $0.149 |
| 1,000 posts | $1.49 |
| 10,000 posts | $14.90 |

### Limitations

- Only publicly accessible content. Private profiles, closed groups and hidden walls are reported as `PRIVATE_TARGET`.
- No community discovery: you supply the walls to scrape, or search posts by keyword.
- Very old posts may lack view counts.
- VK can change its interfaces at any time. The scraper detects response changes and reports them instead of returning bad data.

### Reliability

- Every run starts with a one-request access check against VK's own community. If VK rejects the current access method, the Actor switches to the next available one **before** scraping, so a change on VK's side doesn't turn into a wall of "private target" errors.
- Access methods are tried in order: your `vkAccessToken` (if given) → anonymous access → the operator's fallback token. Each row's `sourceMode` tells you which one produced it.
- Anonymous access tokens are valid for a day and are reused between runs (stored in a small key-value store named `vk-scraper-cache` in your account), which keeps runs fast and avoids VK's token-issuance throttling.
- Rate limits, flood control and `Retry-After` headers are honoured with bounded, randomised backoff.
- Results are written ahead of billing, so a restarted run can never charge you twice for the same post.

### Advanced

- **vkAccessToken** (secret, optional): an official VK API token. When set, it is tried first (`sourceMode: official-api-token`); if VK rejects it, the run continues with anonymous access and a warning in the log.
- **proxyConfiguration**: direct connections are the default and the cheapest. Enable a proxy only if VK rate-limits your runs.
- **maxConcurrency**: walls are processed in parallel, but API calls share one rate limiter that stays within VK limits.

### Responsible use

This Actor collects only content that VK shows to any logged-out visitor. It does not bypass logins, privacy settings or captchas, and it doesn't collect contact details or private messages.

You are responsible for using the data in line with VK's terms and with privacy laws that apply to you, such as GDPR or Russia's 152-FZ. Collect only what you need.

To request removal or correction of data, open an issue on the Actor's page.

# Actor input Schema

## `targets` (type: `array`):

Public VK targets. Accepts community/profile URLs (https://vk.com/kinopoisk), handles (kinopoisk, @durov), numeric ids (club108468, id1, -108468) and direct post URLs (https://vk.com/wall-108468_3576097). Up to 1000 per run. Entries that are not a VK wall or post are skipped and reported. Leave empty if you only use keyword search below.

## `searchQueries` (type: `array`):

Find public posts across the whole of VK that match each query, newest first (VK returns roughly the newest 1,000 matches per query). Requires 'VK access token' below. Date filters, keyword filters, limits and monitoring mode apply to the results. Up to 50 queries per run.

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

Stop after delivering this many posts in total. Leave empty for no limit (your spending limit still applies).

## `maxItemsPerTarget` (type: `integer`):

Stop collecting a single community/profile after this many posts.

## `publishedAfter` (type: `string`):

Only posts published on/after this date. ISO date (2026-10-01), ISO datetime, or relative ("7 days"). Pagination stops as soon as older posts are reached.

## `publishedBefore` (type: `string`):

Only posts published before this date.

## `keywordsAny` (type: `array`):

Keep posts containing at least one keyword. Case-insensitive, Unicode-aware (Cyrillic supported; ё = е). Filters only within the targets above — this is not VK-wide search.

## `keywordsAll` (type: `array`):

Keep posts containing every keyword.

## `excludeKeywords` (type: `array`):

Drop posts containing any of these keywords.

## `searchRepostText` (type: `boolean`):

When enabled, keyword filters also look at the text of the original post that was reposted.

## `includeReposts` (type: `boolean`):

Include posts that share another post.

## `includePinnedPosts` (type: `boolean`):

Include the wall's pinned post (often old).

## `includeOwnerProfile` (type: `boolean`):

Adds an "ownerProfile" object to every post with details of the community or user whose wall it is on: follower/member count, verified badge, description, category, website, city and published contacts. Handy for engagement rates and lead lists. No extra charge.

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

Attach public comments to each post, oldest first. Each delivered comment is billed as a separate 'comment' event.

## `includeCommentReplies` (type: `boolean`):

Also collect the replies inside each comment thread. Replies follow their parent comment, carry 'parentCommentId', count toward 'Max comments per post' and are billed like any other comment.

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

Upper bound on comments collected per post.

## `monitoringMode` (type: `boolean`):

Remember delivered posts under the Monitor ID and on later runs return (and bill) only posts that were not delivered before. Ideal with Apify Schedules.

## `monitorId` (type: `string`):

Name of the monitoring configuration (letters, digits, dashes; case-insensitive). Required in monitoring mode. Each Monitor ID keeps its own state in your account.

## `resetMonitoringState` (type: `boolean`):

Forget everything delivered under this Monitor ID and backfill again. Use deliberately.

## `maxConcurrency` (type: `integer`):

How many targets are processed in parallel. API calls are additionally rate-limited to stay within VK limits.

## `requestTimeoutSecs` (type: `integer`):

Timeout for a single VK request. Timed-out requests are retried with backoff.

## `vkAccessToken` (type: `string`):

Optional official VK API service/user token. Required only for 'Search all of VK' (VK does not allow keyword search for logged-out visitors). When set, it is also tried before anonymous access for walls. When empty, the scraper uses the same anonymous access a logged-out browser gets. Stored encrypted; never logged.

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

Optional. Direct connections work for most runs; enable a proxy only if VK rate-limits your runs.

## Actor input object example

```json
{
  "targets": [
    "https://vk.com/kinopoisk",
    "https://vk.com/durov"
  ],
  "maxItems": 100,
  "maxItemsPerTarget": 50,
  "searchRepostText": false,
  "includeReposts": true,
  "includePinnedPosts": false,
  "includeOwnerProfile": false,
  "includeComments": false,
  "includeCommentReplies": false,
  "maxCommentsPerPost": 20,
  "monitoringMode": false,
  "resetMonitoringState": false,
  "maxConcurrency": 3,
  "requestTimeoutSecs": 30
}
```

# Actor output Schema

## `posts` (type: `string`):

Dataset items: one object per delivered VK post, with engagement metrics, author, attachments, repost origin and optional comments.

## `summary` (type: `string`):

JSON record with the run status (SUCCEEDED, PARTIAL_SUCCESS, EMPTY_SUCCESS, TARGETS_UNAVAILABLE, FAILED), totals, and one entry per target with counts, stop reason and error details.

# 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 = {
    "targets": [
        "https://vk.com/kinopoisk",
        "https://vk.com/durov"
    ],
    "maxItems": 100,
    "maxItemsPerTarget": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapelabmax/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 = {
    "targets": [
        "https://vk.com/kinopoisk",
        "https://vk.com/durov",
    ],
    "maxItems": 100,
    "maxItemsPerTarget": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapelabmax/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 '{
  "targets": [
    "https://vk.com/kinopoisk",
    "https://vk.com/durov"
  ],
  "maxItems": 100,
  "maxItemsPerTarget": 50
}' |
apify call scrapelabmax/vk-scraper --silent --output-dataset

```

## MCP server setup

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