# Gab OSINT Scraper (`thescrapelab/gab-osint-scraper`) Actor

Scrape public Gab profiles, posts, and direct post URLs with a Python Apify Actor built for OSINT, monitoring, research, and bulk dataset workflows.

- **URL**: https://apify.com/thescrapelab/gab-osint-scraper.md
- **Developed by:** [Inus Grobler](https://apify.com/thescrapelab) (community)
- **Categories:** Social media, SEO tools, Developer tools
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.49 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## Gab Scraper Actor for Apify

Scrape public Gab profiles together with posts from those profiles, direct Gab post URLs, and saved Gab post URL datasets into an Apify dataset.

![Gab Scraper logo](assets/gab-scraper-logo.svg)

### What This Actor Is Best For

- Scraping a known Gab post URL
- Scraping a known Gab username or profile
- Building a larger dataset in two steps: profile discovery first, hydration second

### Before You Run

- Residential proxy is the most reliable mode, but it is also the most expensive.
- Direct post URLs are the most reliable input.
- Keyword, search, tag, hash, and explore discovery inputs were removed because they were too unreliable and costly.

### What To Expect

- Direct post URL runs:
  Usually the most reliable. Best choice when you already know the exact post you want.

- Username runs:
  Return the profile record and posts discovered from that profile.

- `discoveryOnly: true` runs:
  Return lightweight `post_url` items from supported profile discovery. Best for a cheaper first-pass collection.

- Two-step runs:
  Best option when you want more volume at a lower cost.

### Inputs

- `usernames`
  Add Gab usernames like `support` or `@support`. Username runs return the profile plus posts discovered from that profile.

- `postUrls`
  Add direct Gab post URLs when you already know the exact posts you want.

- `startUrls`
  Add only direct Gab post URLs or direct Gab profile URLs.

- `sourceDatasetId`
  Use this when you want to hydrate `post_url` records from an earlier discovery run.

- `discoveryOnly`
  Turn this on if you only want discovered post URLs from username/profile discovery instead of full post records.

- `proxyMode`
  Use `direct` for the cheapest runs, `apify` for a middle ground, or `residential` for the highest reliability.

- `maxItems`
  Sets how many results you want back.

### Output

The Actor can return:

- `profile`
  Public profile details

- `post`
  Full post records

- `post_url`
  Lightweight discovered post URLs

### Recommended Test Inputs

#### Profile Test

```json
{
  "usernames": ["support"],
  "postUrls": [],
  "startUrls": [],
  "sourceDatasetId": "",
  "discoveryOnly": false,
  "maxItems": 10
}
````

#### Direct Post Test

```json
{
  "usernames": [],
  "postUrls": [
    "https://gab.com/TerrenceKWilliams/posts/105647844879148303"
  ],
  "startUrls": [],
  "sourceDatasetId": "",
  "discoveryOnly": false,
  "maxItems": 1
}
```

#### Dataset Hydration Test

```json
{
  "usernames": [],
  "postUrls": [],
  "startUrls": [],
  "sourceDatasetId": "YOUR_DATASET_ID",
  "discoveryOnly": false,
  "maxItems": 25
}
```

### Best Low-Cost Workflow

Step 1: profile discovery

```json
{
  "proxyMode": "apify",
  "usernames": ["support"],
  "postUrls": [],
  "startUrls": [],
  "sourceDatasetId": "",
  "discoveryOnly": true,
  "maxItems": 50
}
```

Step 2: hydrate the discovery dataset

```json
{
  "proxyMode": "apify",
  "usernames": [],
  "postUrls": [],
  "startUrls": [],
  "sourceDatasetId": "YOUR_DATASET_ID",
  "discoveryOnly": false,
  "maxItems": 50
}
```

### Cheapest Reliable Inputs

- Direct `postUrls`
  Cheapest way to get full posts because the actor can skip discovery entirely.

- `usernames`
  Good when you need profile data and a manageable amount of profile-linked post discovery.

- `sourceDatasetId`
  Good when you already have a list of post URLs from a previous run.

### Common Reasons For Low Or Zero Results

- The username or post URL does not resolve publicly on Gab
- The profile exposes fewer posts than your `maxItems` target
- Gab blocks or rate-limits the current connection mode
- The source dataset does not contain usable `post_url` items

### Limitations

- Public data only
- Keyword, search, tag, hash, and explore inputs are no longer supported
- Direct post URLs are the most reliable path
- Username-based discovery can still vary if Gab blocks or changes page structure
- The actor will fail fast if residential Apify Proxy is unavailable

# Actor input Schema

## `usernames` (type: `array`):

Gab usernames to scrape as profile targets, such as support or @support. Username runs return the profile record and posts discovered from that profile unless discoveryOnly is enabled.

## `postUrls` (type: `array`):

Optional direct Gab post URLs to hydrate immediately. This is usually the cheapest full-post input because it skips broad discovery.

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

Optional Gab profile URLs or direct Gab post URLs to scrape directly. Search, tag, hash, explore, and other broad discovery pages are no longer supported here.

## `sourceDatasetId` (type: `string`):

Optional Apify dataset ID from an earlier discovery run. The actor will load post URLs from that dataset and hydrate them automatically.

## `discoveryOnly` (type: `boolean`):

When enabled, username/profile runs return lightweight post\_url records for discovered profile posts instead of full post records. Use this for a cheaper first-pass run before hydrating a saved dataset.

## `proxyMode` (type: `string`):

Residential is the most reliable and the most expensive. Standard Apify proxy is cheaper but can block more often. Direct is cheapest and least reliable.

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

How many post pages or API targets to hydrate in parallel. Lower values are gentler and can be cheaper.

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

Main run limit. This caps the number of posts or post URLs returned. Profile records do not count against this limit.

## Actor input object example

```json
{
  "usernames": [
    "support"
  ],
  "postUrls": [],
  "startUrls": [],
  "sourceDatasetId": "",
  "discoveryOnly": false,
  "proxyMode": "residential",
  "maxConcurrency": 2,
  "maxItems": 1
}
```

# 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 = {
    "startUrls": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("thescrapelab/gab-osint-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": [] }

# Run the Actor and wait for it to finish
run = client.actor("thescrapelab/gab-osint-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": []
}' |
apify call thescrapelab/gab-osint-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=thescrapelab/gab-osint-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Gab OSINT Scraper",
        "description": "Scrape public Gab profiles, posts, and direct post URLs with a Python Apify Actor built for OSINT, monitoring, research, and bulk dataset workflows.",
        "version": "0.1",
        "x-build-id": "sZThv6AiFPJSsSkxp"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/thescrapelab~gab-osint-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-thescrapelab-gab-osint-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/thescrapelab~gab-osint-scraper/runs": {
            "post": {
                "operationId": "runs-sync-thescrapelab-gab-osint-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/thescrapelab~gab-osint-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-thescrapelab-gab-osint-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "usernames": {
                        "title": "Usernames",
                        "type": "array",
                        "description": "Gab usernames to scrape as profile targets, such as support or @support. Username runs return the profile record and posts discovered from that profile unless discoveryOnly is enabled.",
                        "default": [
                            "support"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "postUrls": {
                        "title": "Direct post URLs",
                        "type": "array",
                        "description": "Optional direct Gab post URLs to hydrate immediately. This is usually the cheapest full-post input because it skips broad discovery.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "startUrls": {
                        "title": "Gab URLs",
                        "type": "array",
                        "description": "Optional Gab profile URLs or direct Gab post URLs to scrape directly. Search, tag, hash, explore, and other broad discovery pages are no longer supported here.",
                        "default": [],
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "sourceDatasetId": {
                        "title": "Source dataset",
                        "type": "string",
                        "description": "Optional Apify dataset ID from an earlier discovery run. The actor will load post URLs from that dataset and hydrate them automatically.",
                        "default": ""
                    },
                    "discoveryOnly": {
                        "title": "Discovery only",
                        "type": "boolean",
                        "description": "When enabled, username/profile runs return lightweight post_url records for discovered profile posts instead of full post records. Use this for a cheaper first-pass run before hydrating a saved dataset.",
                        "default": false
                    },
                    "proxyMode": {
                        "title": "Proxy mode",
                        "enum": [
                            "residential",
                            "apify",
                            "direct"
                        ],
                        "type": "string",
                        "description": "Residential is the most reliable and the most expensive. Standard Apify proxy is cheaper but can block more often. Direct is cheapest and least reliable.",
                        "default": "residential"
                    },
                    "maxConcurrency": {
                        "title": "Hydration concurrency",
                        "minimum": 1,
                        "maximum": 16,
                        "type": "integer",
                        "description": "How many post pages or API targets to hydrate in parallel. Lower values are gentler and can be cheaper.",
                        "default": 2
                    },
                    "maxItems": {
                        "title": "Result limit",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Main run limit. This caps the number of posts or post URLs returned. Profile records do not count against this limit.",
                        "default": 1
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
