# Gab Groups Scraper (`web.harvester/gab-groups-scraper`) Actor

Scrape information about groups, as well as their posts and comments from Gab's website. Download your data in any format (JSON, CSV, XML, RSS, HTML Table). Seamless integration with apps, reports, and databases.

- **URL**: https://apify.com/web.harvester/gab-groups-scraper.md
- **Developed by:** [Web Harvester](https://apify.com/web.harvester) (community)
- **Categories:** Social media, News
- **Stats:** 3 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.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?

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

## Gab Groups Scraper

Scrape posts from public [Gab](https://gab.com) groups: pinned posts, posts with media, comments and replies, or the group details. No Gab login is needed. Download the data as JSON, CSV, Excel or HTML.

### How to use it

1. Add group IDs (`150` for https://gab.com/groups/150) or group URLs. Add `/media` to a URL, or turn on **Only group posts with media**, to keep only posts with images or videos.
2. Set **Max posts per group** and the **Group posts sort**.
3. Optionally set **Max comments per post**, **Add author profile to posts** and **Add group details to posts**.
4. Click **Start**.

Set **Max posts per group** to `0` to save the group details (title, description, members, privacy, verified badge, cover images, rules) instead of posts.

```json
{
    "groupsIds": ["150"],
    "desiredPostsCount": 100,
    "groupPostsSortBy": "TOP_MONTHLY",
    "addGroupInfo": true
}
```

### Output

Each post has the same columns: `id`, `url`, `created_at`, `content` (plain text), `language`, `replies_count`, `reblogs_count`, `favourites_count`, `quotes_count`, `reactions_counts`, `pinned`, `media_attachments` (images and videos with URLs), `card` (link preview), `poll`, `mentions`, `tags`, `reblog` (the original post of a repost), `quote` (the quoted post) and more. Optional fields are `account` (author profile), `group` (group details) and `comments` (comments and replies with the same columns as posts).

### Limits of Gab

Gab shows less to logged-out visitors than to members, and the scraper only collects what Gab shows publicly:

- With the *Newest* sorts Gab only returns about the last 7 days of posts. Use a *Top* sort, for example *Top all time*, to get older posts. The log tells you when a source ran out for this reason.
- At most 500 comments per post.
- Private accounts and groups can't be scraped, but their profiles can be saved with **Max posts** set to `0`.

### Is it legal to scrape Gab?

This Actor only collects publicly available data and doesn't log in. Personal data is protected by laws such as GDPR, so only scrape personal data when you have a legitimate reason, and consult a lawyer if you're unsure. Read more in [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

### More Gab data

[Gab Scraper](https://apify.com/web.harvester/gab-scraper) does everything in one Actor: accounts, posts, groups, feeds, searches and the marketplace.

# Actor input Schema

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

Gab group URLs, e.g. https://gab.com/groups/150. Add /media to keep only posts with images or videos.

## `groupsIds` (type: `array`):

Gab group IDs to scrape, e.g. <code>1898</code> for https://gab.com/groups/1898.

## `desiredPostsCount` (type: `integer`):

How many posts to save for each group. Set to <code>0</code> to save the group details instead of its posts.

## `groupPostsSortBy` (type: `string`):

Order of the posts in groups. Gab only shows the last few days of <i>Hot</i>, <i>Rising</i>, <i>Newest</i> and <i>Recent activity</i> to logged-out visitors, use a <i>Top</i> sort to get older posts.

## `groupsMediaOnly` (type: `boolean`):

Save only group posts that have images or videos.

## `desiredCommentsCount` (type: `integer`):

How many comments (including replies) to add to each post in its <code>comments</code> field. <code>0</code> skips comments. Gab returns at most 500 comments per post.

## `commentsSortBy` (type: `string`):

Order of the comments.

## `addUserInfo` (type: `boolean`):

Add the author's profile to every post and comment in the <code>account</code> field.

## `addGroupInfo` (type: `boolean`):

Add the group's details to every group post in the <code>group</code> field.

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

Proxy servers used to reach Gab.

## Actor input object example

```json
{
  "groupsIds": [
    "150"
  ],
  "desiredPostsCount": 20,
  "groupPostsSortBy": "TOP_ALL_TIME",
  "groupsMediaOnly": false,
  "desiredCommentsCount": 0,
  "commentsSortBy": "MOST_LIKED",
  "addUserInfo": false,
  "addGroupInfo": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Gab posts and groups in the default dataset. Each kind of item has the same columns in every run.

# 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 = {
    "groupsIds": [
        "150"
    ],
    "desiredPostsCount": 20,
    "groupPostsSortBy": "TOP_ALL_TIME",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("web.harvester/gab-groups-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 = {
    "groupsIds": ["150"],
    "desiredPostsCount": 20,
    "groupPostsSortBy": "TOP_ALL_TIME",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("web.harvester/gab-groups-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 '{
  "groupsIds": [
    "150"
  ],
  "desiredPostsCount": 20,
  "groupPostsSortBy": "TOP_ALL_TIME",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call web.harvester/gab-groups-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,web.harvester/gab-groups-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/gNpiUp0giYIWSuRnw/builds/cVVZJfP8iQvyw6dGF/openapi.json
