# VK Posts Scraper & Comments | VK Parser, Парсер ВК (`firsthand/vk-posts-scraper`) Actor

VK posts scraper and parser (Парсер ВК): export public VKontakte wall posts from communities, public pages and profiles to CSV, Excel or JSON, with comment threads. Text, likes, reposts, views, attachments, repost source. Date filters stop paging early. No login, $0.60 per 1,000 posts.

- **URL**: https://apify.com/firsthand/vk-posts-scraper.md
- **Developed by:** [Firsthand](https://apify.com/firsthand) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.45 / 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.
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?

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 Posts Scraper & Comments | VK Parser, Парсер ВК

Export public VK (VKontakte) wall posts from communities, public pages and profiles to CSV, Excel or JSON, with comment threads if you want them. Give it links, short names or ids; get one clean row per post with text, likes, reposts, views, attachments and the reposted original. No VK login, no token, no browser.

### VK posts scraper: what you get

- **Posts from any public wall.** Communities (`https://vk.com/tproger`, `club1`, `-22822305`), public pages and public profiles (`https://vk.com/id1`, `durov`). Links on `vk.ru` work too. Paging goes back through the whole wall, newest first, as far as you ask.
- **Single posts by link.** `https://vk.com/wall-22822305_1740193` gives that post (and its comments, if on). A link to a comment (VK uses the same `wall` form) gets a free `COMMENT_LINK` row with the link of its post.
- **Every post field VK shows to visitors:** text cleaned of HTML (line breaks and emoji kept), date, edit date, likes and reactions per type, reposts, views, comment count, author, wall name, signer, hashtags, links, photos (largest size), videos, documents, articles, polls and audio, ad, VK Donut and pinned marks.
- **Reposts with their original.** A repost row carries the original post in `repost`: owner, author, text, date, link and attachments, with `available: true`. When the original was deleted or is closed to visitors, VK shows only its id: the row keeps `isRepost: true` and `repost` has that id, link and `available: false`. Turn reposts off to skip them.
- **Posts by other people on a profile wall** carry their real author in `authorId` and `authorName`, not the wall owner.
- **Co-authored posts** keep their place on the wall and are marked `isCoauthored`.
- **Fresh numbers on every run.** The same posts come back each time you run the Actor, so a schedule can follow likes and views over time.
- **Free error rows.** A wall that is closed, hidden or does not exist gives one free row with VK's own message, so an empty result is never silent.

### How to scrape VK posts

1. Paste walls into **VK walls or post links**, one per line: a link, a short name, an id or a post link.
2. Set **Max posts per wall** (newest posts of each wall) and, if you like, **Max items for the whole run**. Max items counts posts and comments together, and comments of the first walls are read before the next walls: with a small Max items and comments on, later walls may get no posts (they get a free `RUN_LIMIT` row). To cover every wall, limit per wall and per post instead.
3. Optional filters: **Posts published after / before** (a date like `2026-10-01` or a period like `7 days`), **Text contains**, **Text does not contain**, **Include reposts**, **Only the owner's posts**.
4. Run, then download the dataset as CSV, Excel, JSON or XML, or read it through the API.

With dates set, the Actor stops paging at the first page that is all older than **Posts published after**, and on a large wall it jumps straight to **Posts published before** instead of paging through newer posts. You do not pay for the posts it skips.

Text and repost filters cannot stop paging by themselves: a rare word may sit nowhere on a wall of 300,000 posts. With them on, the Actor looks through the newest **Max posts to scan** posts of each wall (2000 if empty) and stops; a wall where nothing matched gets a free `SCAN_LIMIT` row. Posts removed by filters are free either way.

### VK comments scraper

Turn on **Include comments** to get the comments of every post as separate rows: author, author page, text, date, likes, media flag, the thread it belongs to and the comment it answers (`replyToCommentId`, `replyToUserId`, `replyToName`). **Max comments per post** limits each post (20 if empty); turn off **Include replies to comments** for top-level comments only. A deleted comment is skipped, not delivered as an empty row.

The run summary compares comments delivered with the number VK shows on each post (`commentsExpected`, `commentsDelivered`). VK keeps deleted and hidden comments in its count, so a typical post gives 95-100% of that number. In very long threads VK shows logged-out visitors the first replies only and asks to log in for the rest; the summary counts those replies in `repliesHiddenByVk` (per post in `commentsIncomplete`). On a hot post with 336 comments this left 240 readable, with at least 44 replies behind the login button; the rest of the gap is deleted or hidden comments that VK still counts. Any post that got fewer comments than its count (or your per-post limit) is listed in `commentsIncomplete`.

### Export VK wall posts to CSV, Excel or JSON

The dataset has two views: **Posts and comments** (text, likes, reposts, views, comments, date, author, wall, link) and **Errors** (free rows with the reason). Every field is in the JSON and in the full table export. The `type` column tells posts, comments and error rows apart.

### Example output

A post:

```json
{
  "type": "post",
  "id": "-1_399830",
  "url": "https://vk.com/wall-1_399830",
  "ownerId": -1,
  "postId": 399830,
  "text": "Метод dev.vk.com/method/execute стал доступен для вызова с сервисным ключом доступа. Можно использовать его для более эффективного взаимодействия с API в ваших приложениях.",
  "publishedAt": "2022-12-29T17:45:00Z",
  "timestamp": 1672335900,
  "editedAt": "2022-12-29T18:28:18Z",
  "likes": 164,
  "reactions": {"0": 163, "1": 1},
  "reposts": 45,
  "views": 416583,
  "commentsCount": 55,
  "authorId": -1,
  "authorName": "ВКонтакте API",
  "ownerName": "ВКонтакте API",
  "ownerScreenName": "club1",
  "signerId": null,
  "hashtags": [],
  "links": ["https://dev.vk.com/method/execute"],
  "attachments": [{"type": "photo", "url": "https://sun9-16.userapi.com/s/v1/ig2/....jpg"}],
  "attachmentTypes": ["photo"],
  "isAd": false,
  "isDonut": false,
  "isPinned": false,
  "isCoauthored": false,
  "wallPostId": null,
  "isRepost": false,
  "repost": null,
  "source": "wall",
  "input": "-1",
  "wallMode": "all",
  "scrapedAt": "2026-11-21T10:56:03Z"
}
```

A comment (a reply inside a thread; names shortened here):

```json
{
  "type": "comment",
  "id": "-1_400538",
  "commentId": 400538,
  "postId": "-1_400529",
  "postUrl": "https://vk.com/wall-1_400529",
  "url": "https://vk.com/wall-1_400529?reply=400538",
  "threadId": "-1_400530",
  "replyToCommentId": "-1_400532",
  "replyToUserId": 39593529,
  "replyToName": "Анне",
  "authorId": 238280903,
  "authorName": "Дима С.",
  "authorUrl": "https://vk.com/...",
  "isPostAuthor": false,
  "text": "Анна, но беседа называется «VK для разработчиков»… 🧐",
  "hasMedia": false,
  "publishedAt": "2025-06-03T09:56:48Z",
  "timestamp": 1748944608,
  "likes": 6,
  "input": "-1",
  "scrapedAt": "2026-11-21T10:56:08Z"
}
```

An error row (free):

```json
{
  "type": "error",
  "source": "wall",
  "input": "https://vk.com/wall-999999999999",
  "errorCode": "WALL_NOT_AVAILABLE",
  "error": "VK does not show this wall to logged-out visitors: Вы не можете просматривать стену этого сообщества.",
  "scrapedAt": "2026-11-21T10:56:56Z",
  "postsDelivered": 0
}
```

### Pricing

| Apify plan | Per 1,000 posts | Per 1,000 comments |
|---|---|---|
| Free, Bronze | $0.60 | $0.35 |
| Silver | $0.55 | $0.30 |
| Gold, Platinum, Diamond | $0.45 | $0.25 |

No start fee. Error rows, duplicates and posts removed by your filters are free; compute is included. Set a spending limit on the run and the Actor stops before going over it.

### VK API for developers

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("firsthand/vk-posts-scraper").call(run_input={
    "targets": ["https://vk.com/tproger", "durov", "-1"],
    "maxPostsPerTarget": 100,
    "publishedAfter": "30 days",
    "includeComments": True,
    "maxCommentsPerPost": 50,
})
for row in client.dataset(run.default_dataset_id).iterate_items():
    if row["type"] == "post":
        print(row["publishedAt"], row["likes"], row["views"], row["url"])
```

Input names from other VK Actors are read too: `startUrls`, `urls`, `walls`, `communities`, `groups`, `pages`, `profiles`, `screenNames`, `ownerIds`, `postUrls`, `maxItemsPerTarget`, `maxPostsPerUrl`, `maxPostsPerCommunity`, `postsPerCommunity`, `maxPosts`, `maxTotalPosts`, `maxResults`, `scrapeComments`, `maxComments`, `includeReplies`, `postedAfter`, `postedBefore`, `dateFrom`, `dateTo`, `postedWithinDays`, `includePinned`, `keyword`, `keywords`, `keywordsAny`, `excludeKeywords`, `maxPostsToScan`, `mode: "comments"`. Where several limits are given, the smaller one wins. `maxPosts` means a per-wall limit in some Actors and a whole-run limit in others, so here it is applied both ways. `mode: "comments"` returns only comments: the posts are read for their comments but not delivered or charged. Monitoring fields (`monitoringMode`, `monitorMode`, `onlyNew`, `onlyNewPosts`) stop the run before any work: this Actor has no memory of earlier runs and would return and charge every post again; use **Posts published after** instead. Other fields this Actor does not have (VK search, tokens) are named in the log and not applied. With no limit at all, a run takes 20 posts per wall.

### Good to know

- **Public walls only.** The Actor reads what VK shows a visitor who is not logged in. Closed communities, hidden profiles and private posts give a free error row.
- **Profiles that hide other people's posts.** Some profiles show logged-out visitors only the owner's own posts. The Actor then returns those and says so in the log (`wallMode: ownerOnly`).
- **Public pages show only their own posts** on the wall (`wallMode: own`).
- **Pinned post.** Public pages show their pinned post first, even when it is months old. It comes marked `isPinned: true` and counts toward **Max posts per wall**; turn off **Include the pinned post** to skip it. Date filters apply to it like to any post.
- **Communities with their own VK subdomain** (like `name.vk.com`) send logged-out visitors around in an endless redirect. Their posts and comments cannot be read without logging in; they get a free `REDIRECT_LOOP` row at once.
- **No VK search.** The Actor reads the walls and posts you list; it does not search VK for posts or communities.
- **Numbers change.** Likes, reposts and views are read at the moment of the run.
- **Proxy is not needed.** VK walls open without one. Set a proxy only if VK refuses your runs.
- **Use of the data.** Posts and comments are public, but they are written by people and include names: personal data under GDPR and similar laws. You are responsible for how you store and use them and for the VK terms of use. Nothing here is legal advice.
- **Not affiliated with VK.** VK and VKontakte are trademarks of their owner.
- **Problems.** Open an issue on the Issues tab with the input of the run and what you expected.

# Actor input Schema

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

Public VK communities, public pages and profiles, one per line: a link (https://vk.com/vk), a short name (tproger), an id (-22822305 for a community, 1 for a profile) or a post link (https://vk.com/wall-22822305_1740193). vk.ru links work too.

## `maxPostsPerTarget` (type: `integer`):

Newest posts to take from each wall. Empty, together with Max items, means 20 per wall.

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

Limit on all paid rows of the run, posts and comments together. Comments of the first walls come before the next walls, so with comments on, limit per wall and per post to cover every wall. Empty means no run limit.

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

Only posts newer than this: a date (2026-10-01, 01.10.2026) or a period (7 days, 2 weeks, 1 month). Paging stops at the first page that is all older, so you do not pay for the rest of the wall.

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

Only posts older than this, same formats. On a large wall the Actor jumps to that date instead of paging through newer posts.

## `containsText` (type: `array`):

Keep only posts whose text (or reposted text) contains any of these words. Case does not matter. Filtered posts are not charged.

## `excludeText` (type: `array`):

Skip posts whose text contains any of these words.

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

Reposts come with the original post in the repost field (author, text, date, link). Turn off to skip them. On by default.

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

Public pages show their pinned post first, even when it is old; it is marked isPinned. Turn off to skip it. On by default.

## `maxPostsToScan` (type: `integer`):

Text and repost filters do not stop paging by themselves, so with them on the Actor looks through this many newest posts of each wall and stops. Empty means 2000 when a text or repost filter is on and no limit otherwise. Date filters stop paging on their own.

## `ownerPostsOnly` (type: `boolean`):

Only posts by the wall owner, without posts by other people on a profile or group wall. A link with ?own=1 does the same.

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

Also scrape the comments of each post, with replies in threads (author, text, date, likes, reply-to). Each comment is a separate paid row.

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

Empty means 20 per post when comments are on.

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

Replies inside comment threads. On by default; turn off for top-level comments only.

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

Not needed: VK walls open without a proxy. Set one only if VK refuses your runs.

## Actor input object example

```json
{
  "targets": [
    "https://vk.com/vk"
  ],
  "maxPostsPerTarget": 20,
  "maxCommentsPerPost": 20
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (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 = {
    "targets": [
        "https://vk.com/vk"
    ],
    "maxPostsPerTarget": 20,
    "maxCommentsPerPost": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("firsthand/vk-posts-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/vk"],
    "maxPostsPerTarget": 20,
    "maxCommentsPerPost": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("firsthand/vk-posts-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/vk"
  ],
  "maxPostsPerTarget": 20,
  "maxCommentsPerPost": 20
}' |
apify call firsthand/vk-posts-scraper --silent --output-dataset

```

## MCP server setup

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