# VK Posts Scraper (`whoareyouanas/vk-posts-scraper`) Actor

Scrape wall posts from public VK (VKontakte) profiles and communities: text, timestamps, attachment URLs, repost chains, engagement counts and comments.

- **URL**: https://apify.com/whoareyouanas/vk-posts-scraper.md
- **Developed by:** [Anas Nadeem](https://apify.com/whoareyouanas) (community)
- **Categories:**
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

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

### What does VK Posts Scraper do?

**VK Posts Scraper extracts wall posts from public [VK (VKontakte)](https://vk.com) profiles and communities** — post text, publication timestamps, attachment URLs with their VK object IDs, repost chains, and engagement counts. Give it a handle like `durov`, a community URL, an owner ID, or a direct post link, and it walks the wall and returns structured JSON.

It runs on the Apify platform, so you get scheduling, a REST API, webhook and integration support, automatic proxy rotation, and run monitoring without maintaining any infrastructure yourself.

The scraper has **two modes**. Without a VK access token it scrapes VK's public HTML, which returns text, dates, and media links. With a token it uses the official VK API and returns everything — engagement counts, author profiles, comment threads, polls, and geotags. See [Extraction modes](#extraction-modes) for exactly which fields each mode fills.

### Why use VK Posts Scraper?

- **Competitor and brand monitoring** — track what communities in your market publish, and how often.
- **Content research** — pull a community's back catalogue to analyse topics, formats, and posting cadence.
- **Media and archival work** — capture posts with their attachment URLs before they change or disappear.
- **Dataset building** — collect Russian-language social text for analysis, with exact timestamps.
- **Feeding other tools** — schedule runs and push results to Google Sheets, S3, a webhook, or your own API.

### How to use VK Posts Scraper

1. Click **Try for free** (or **Start** if you already have it).
2. In the **Input** tab, add one or more targets to **VK targets** — for example `kinopoisk`, `https://vk.com/durov`, or `-220754053`.
3. *(Recommended)* Paste a **VK access token**. This unlocks engagement counts, authors, and comments. See [Getting an access token](#getting-an-access-token).
4. Set **Maximum posts** to control how much you collect.
5. Click **Start** and wait — most runs finish in under a minute.
6. Open the **Output** tab, or download the dataset as JSON, CSV, Excel, or HTML.

### Input

Configure everything from the **Input** tab. Only `vkTargets` is required.

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `vkTargets` | array | **required** | Handles (`durov`), profile/community URLs, signed owner IDs (`-220754053`), or post links (`https://vk.com/wall1_45678`). |
| `accessToken` | string (secret) | — | VK API token with the `wall` scope. Strongly recommended. |
| `maxItems` | integer | 50 | Total posts across all targets. Raise it for a full crawl, and raise the run timeout with it. |
| `postsPerTarget` | integer | — | Optional per-target cap. |
| `publishedAfter` | string | — | `YYYY-MM-DD` or ISO-8601. Pagination stops at older posts. |
| `publishedBefore` | string | — | `YYYY-MM-DD` or ISO-8601. A bare date includes the whole day. |
| `postFilter` | enum | `all` | `all`, `owner`, or `others`. API mode only. |
| `includeComments` | boolean | false | Fetch comment threads with replies. API mode only. |
| `maxComments` | integer | 100 | Comments per post when the above is on. |
| `keepUndatedPosts` | boolean | false | Keep posts whose date could not be read, even when a date filter is set. |
| `htmlTimezone` | string | `Europe/Moscow` | Timezone VK renders times in. HTML mode only. |
| `includeRawPost` | boolean | false | Attach the unmodified VK API object as `rawPost`. |
| `proxyConfiguration` | object | Residential | VK blocks most datacenter IPs. |

```json
{
    "vkTargets": ["https://vk.com/vkvideo", "kinopoisk"],
    "accessToken": "vk1.a.…",
    "maxItems": 200,
    "publishedAfter": "2026-01-01",
    "includeComments": true
}
```

### Output

One dataset item per post. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel, or pull it through the Apify API.

```json
{
    "postId": "-220754053_278663",
    "ownerId": -220754053,
    "text": "Попали под чары Лены Журавлёвой и даже не сопротивляемся…",
    "postedAt": "2026-08-13T12:03:00.000Z",
    "sourceUrl": "https://vk.com/wall-220754053_278663",
    "stats": { "likes": 1240, "comments": 87, "reposts": 33, "views": 98000, "engagement": 1360 },
    "mediaTypes": ["photo"],
    "mediaCount": 6,
    "thumbnailUrls": [],
    "thumbnailCount": 0,
    "attachments": [
        { "type": "photo", "id": "-220754053_457265754", "url": "https://vk.com/photo-220754053_457265754" }
    ],
    "isRepost": false,
    "repostChain": [],
    "target": "https://vk.com/vkvideo",
    "targetType": "url",
    "scrapedAt": "2026-08-15T19:06:24.168Z"
}
```

#### Data fields

| Field | Description |
| --- | --- |
| `postId` | VK identifier as `ownerId_postId`. |
| `ownerId` | Signed ID of the wall (negative for communities). |
| `author`, `authorId` | Who wrote the post. Differs from the wall owner on community posts. |
| `text` | Post body. |
| `postedAt`, `editedAt` | ISO-8601 timestamps in UTC. |
| `sourceUrl` | Canonical vk.com link. |
| `stats` | `likes`, `comments`, `reposts`, `views`, `engagement`. |
| `mediaTypes`, `mediaCount` | Attachment types and how many VK attachment links were found. |
| `attachments` | Photos, videos, audio, docs, links and polls with VK object IDs and URLs. |
| `thumbnailUrls`, `thumbnailCount` | HTML-mode fallback image URLs when VK exposes a thumbnail but no stable attachment link. |
| `isRepost`, `repostChain` | Whether the post reposts other content, and the originals. |
| `comments` | Comment threads with replies, when enabled. |
| `geo`, `isPinned`, `isAd`, `signer` | Post metadata. |
| `target`, `targetType` | Which input produced this row. |
| `scrapedAt` | When it was extracted. |

### Extraction modes

Field availability differs by mode. This table is the honest version — check it before you rely on a field.

| Field | HTML mode (no token) | API mode (with token) |
| --- | --- | --- |
| `text`, `postedAt`, `sourceUrl` | ✅ | ✅ |
| `attachments` with URLs and IDs | ✅ when VK links the media; otherwise `thumbnailUrls` | ✅ (plus sizes, durations, titles) |
| `mediaTypes`, `isRepost`, `isPinned` | ✅ | ✅ |
| `stats` counter fields (likes, views, comments) | ⚠️ can be `null` | ✅ |
| `author`, `wallOwner` | ❌ `null` | ✅ |
| `repostChain` contents | ❌ empty | ✅ |
| `comments` | ❌ | ✅ |
| Polls, geotags, `signer`, `isAd` | ❌ | ✅ |
| Whole wall depth | ⚠️ limited by VK | ✅ |
| Private walls your token can read | ❌ | ✅ |

**HTML mode is a convenience tier.** It is genuinely useful for text and media, but VK does not put engagement numbers in reliably-parseable public markup on every wall, so individual `stats` counters can be `null`. If you need engagement data, use a token.

Nothing is ever invented. A field VK does not provide is `null`, never a guess.

#### Getting an access token

1. Create a standalone application at [dev.vk.com](https://dev.vk.com).
2. Open its settings and copy the **service access key**.
3. Paste it into the **VK access token** field. It is stored encrypted and never appears in logs.

This takes about two minutes and needs no OAuth flow. For walls only a user account can read, generate a user token with the `wall` scope instead.

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

This Actor is billed by Apify platform usage (compute units, proxy traffic, storage). Runs are light: a browser is only launched in HTML mode, and API mode uses plain HTTP.

Rough guide from real runs:

- **30 posts, HTML mode** — around 15 seconds of a 1 GB run
- **500 posts, API mode** — a handful of HTTP requests, no browser

Keep costs down by setting `maxItems` to what you actually need, using a token so the run skips the browser entirely, and narrowing with `publishedAfter`.

### Tips and advanced options

- **Use a token.** It is faster, cheaper, more complete, and more reliable than HTML mode.
- **Raise the timeout when you raise `maxItems`.** The run stops itself shortly before its timeout and keeps what it gathered, so a large `maxItems` on a short timeout returns a partial wall rather than an error. Both live in the run options.
- **Residential proxies matter.** VK blocks most datacenter ranges, and rate-limits anonymous traffic per IP with a "not a robot" page. The Actor detects that page and retries from another exit, but a rotating residential pool is what makes those retries land. If runs fail to connect, set the proxy country to `RU` in **Proxy configuration**.
- **Date filters stop pagination early.** `publishedAfter` halts the crawl once older posts appear, so a narrow window is much cheaper than a wide one.
- **Undated posts are dropped when a date filter is set**, because they cannot be checked against it. Set `keepUndatedPosts: true` to keep them.
- **Scraping several communities?** Put them all in `vkTargets` — one run, deduplicated across targets.
- **Schedule it.** Use the Schedules tab for daily monitoring, and integrations to push results onward.

### FAQ

**Does this work without a VK account or token?**
Yes, in HTML mode — with the field limitations in the table above.

**Why are some `stats` counters null on posts?**
VK does not expose every engagement count in parseable public markup consistently, and it renames the markup that does carry counters without notice. Use an access token for reliable numbers.

**The run failed saying VK served a bot challenge. What now?**
VK rate-limits anonymous traffic per IP and answers with a "not a robot" page. The Actor detects this and retries from a different proxy exit automatically. If every exit is refused, run again later, keep **Proxy configuration** on residential, or supply an `accessToken` — the official API is not rate-limited this way.

**Why did I get fewer posts than I asked for?**
One of two things, and the run log always says which. Either VK stopped serving the wall — it limits how much it hands an anonymous visitor, and a token lifts that — or the run reached its time budget. The Actor stops itself just before the run timeout and keeps what it has collected rather than being killed with nothing to show, so raising **Timeout** in the run options collects more.

**Are timestamps in my timezone?**
No — always UTC. In HTML mode, VK's displayed times are interpreted using `htmlTimezone` (Moscow by default) and converted to UTC.

**Can it scrape private profiles?**
No. Only public walls, or walls the supplied token can legitimately read. This Actor does not bypass VK's access controls.

### Legal and support

This Actor collects **publicly available data only**. You are responsible for how you use it, including compliance with VK's Terms of Service, GDPR, and any other applicable law. Scraping personal data may require a lawful basis — consult a lawyer if you are unsure. Do not use this Actor to collect personal data without a legitimate reason.

Found a bug or need a field that is missing? Open a ticket in the **Issues** tab. If you need a tailored VK dataset or a custom integration, get in touch through the same channel.

# Actor input Schema

## `vkTargets` (type: `array`):

VK walls to scrape. Accepts a public handle (`durov`), a profile or community URL (`https://vk.com/kinopoisk`), a signed owner ID (`-40316705`), or a direct post link (`https://vk.com/wall1_45678`).

## `accessToken` (type: `string`):

VK API access token with the `wall` scope. Strongly recommended: with a token the Actor uses the official VK API and returns every field (attachment URLs, view counts, exact timestamps, repost chains, comments). Without one it falls back to limited public HTML scraping.

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

Hard cap on the number of posts stored across all targets. Raise it for a full crawl, and raise the Actor's run timeout with it - the run stops early rather than overrunning its timeout.

## `postsPerTarget` (type: `integer`):

Optional per-target cap. Leave empty to let each target use the shared budget.

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

Only keep posts published at or after this date. `YYYY-MM-DD` or a full ISO-8601 timestamp. Pagination stops once older posts are reached.

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

Only keep posts published at or before this date. A bare `YYYY-MM-DD` includes the whole day.

## `postFilter` (type: `string`):

Which posts to read from the wall. API mode only.

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

Fetch comment threads (including replies) for every post. Requires an access token and makes the run noticeably slower.

## `maxComments` (type: `integer`):

Upper bound on comments fetched per post when "Include comments" is on.

## `keepUndatedPosts` (type: `boolean`):

Without an access token VK sometimes hides a post's date. By default such posts are dropped when a date filter is set, because they cannot be checked against it. Turn this on to keep them (their `postedAt` will be null and they may fall outside your date range).

## `htmlTimezone` (type: `string`):

Only used without an access token. VK prints post times in the viewer timezone, so the browser is pinned to this zone and the printed times are interpreted in it. Change it only if you want timestamps resolved as another region would see them.

## `includeRawPost` (type: `boolean`):

Attach the unmodified VK API object as `rawPost` on every item. Useful for fields this Actor does not map yet.

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

VK blocks most datacenter IP ranges. Residential proxies are used by default.

## Actor input object example

```json
{
  "vkTargets": [
    "kinopoisk",
    "durov"
  ],
  "maxItems": 50,
  "postFilter": "all",
  "includeComments": false,
  "maxComments": 100,
  "keepUndatedPosts": false,
  "htmlTimezone": "Europe/Moscow",
  "includeRawPost": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (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 = {
    "vkTargets": [
        "kinopoisk",
        "durov"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("whoareyouanas/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 = { "vkTargets": [
        "kinopoisk",
        "durov",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("whoareyouanas/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 '{
  "vkTargets": [
    "kinopoisk",
    "durov"
  ]
}' |
apify call whoareyouanas/vk-posts-scraper --silent --output-dataset

```

## MCP server setup

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