# Bluesky Scraper | Posts, Threads & Followers (`hridayrungta/bluesky-scraper`) Actor

Bluesky posts, reply threads, and follower/following lists via Bluesky official public API - no login, no browser. Incremental mode returns only new posts since your last run. $0.60 per 1,000 posts scraped, plus a small one-time start fee.

- **URL**: https://apify.com/hridayrungta/bluesky-scraper.md
- **Developed by:** [Hriday Rungta](https://apify.com/hridayrungta) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 actor starteds

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

## Bluesky Scraper | Posts, Threads & Followers

Extracts posts, full reply threads, and follower/following lists from Bluesky using Bluesky's own official public API — the same one that renders bsky.app for logged-out visitors. No login, no API key, no browser, no proxy.

### What you get

- **Posts**: author (handle, DID, display name), full text, language, created/indexed timestamps, reply/repost/like/quote/bookmark counts, embed summary (images, video, external link, or quoted post), a ready-to-click bsky.app URL.
- **Threads**: a post plus every reply beneath it, flattened with a `threadDepth` so you can rebuild the tree, down to the depth you choose.
- **Followers / Following**: DID, handle, display name, bio, avatar, account creation date, for either direction.
- **Incremental mode**: track one or many accounts over time. Each run after the first returns only posts published since the last run — no re-scraping, no re-paying for old data.

### How this works (honestly)

Bluesky's AT Protocol ships a genuinely official, documented, versioned public API at `public.api.bsky.app/xrpc/...` — Bluesky's own AppView, the exact backend bsky.app itself calls for anyone browsing without an account. This is not a reverse-engineered trick like some competing scrapers rely on:

1. `app.bsky.feed.getAuthorFeed` for an account's own posts, newest-first, paginated with a cursor.
2. `app.bsky.feed.getPostThread` for a post plus its nested replies.
3. `app.bsky.graph.getFollowers` / `getFollows` for connections.

No headless browser, no residential proxy, no Cloudflare fight — because there isn't one. That also means it's fast and cheap, and the savings are passed on to you.

**Why there's no keyword search**: `app.bsky.feed.searchPosts` is blocked with an HTTP 403 (a WAF-style block) for anonymous callers — confirmed both from a local test and from a live run on Apify's own infrastructure. Rather than ship a fragile mode that silently fails for everyone, this Actor doesn't offer search. Feed it specific accounts or post URLs instead.

### Incremental mode

Set `incremental: true` (mode `"posts"` only). On the first run per account, it seeds from `firstRunSince` (default 30 days). Every run after that resumes exactly where the last one left off, tracked per account in a key-value store. A run that's cut short by your `maxItems` budget still advances the mark safely — you'll never get duplicate rows on the next run, and you'll never silently skip a post either.

### Input at a glance

| Field | Description |
|---|---|
| `mode` | `"posts"` (default), `"thread"`, `"followers"`, or `"following"`. |
| `actors` | Handles, DIDs, or profile URLs — one per line. Used by `posts`/`followers`/`following`. |
| `postUrls` | Full bsky.app post URLs or raw `at://` URIs — one per line. Used by `thread`. |
| `incremental` | `posts` mode only. Only return posts newer than your last run, per account. |
| `maxReplyDepth` | `thread` mode only. How deep into nested replies to go. |
| `maxItems` | Budget cap on billed rows for this run. |
| `firstRunSince` | How far back the first incremental run looks (e.g. `"30 days"`). |

### Billing (pay-per-event)

| Event | Price |
|---|---|
| Actor started | $0.0025 — charged once per run, regardless of results |
| Post scraped | $0.0006 ($0.60 / 1,000) |
| Reply scraped | $0.0003 ($0.30 / 1,000) |
| Profile scraped (follower/following row) | $0.0003 ($0.30 / 1,000) |

No hidden per-GB proxy costs, no flat $0.004+ start fee inflating small runs like some competitors — the whole point of using Bluesky's own official API is that it's cheap to run, so it's cheap to use.

# Actor input Schema

## `mode` (type: `string`):

"posts": an actor's own feed. "thread": a post plus its full reply tree. "followers"/"following": an actor's connections.

## `actors` (type: `array`):

Used by "posts", "followers" and "following" modes. One per line: a handle ("jay.bsky.team"), a DID ("did:plc:..."), or a full profile URL.

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

Used by "thread" mode only. One per line: a full bsky.app post URL (https://bsky.app/profile/<handle>/post/<id>) or a raw at:// post URI.

## `incremental` (type: `boolean`):

"posts" mode only. When on, each run after the first returns only posts newer than the last run, per actor.

## `maxReplyDepth` (type: `integer`):

"thread" mode only. How deep into nested replies to go. 0 returns the root post only.

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

Cost cap - you're billed once per row saved.

## `firstRunSince` (type: `string`):

An actor's first incremental run only takes posts since this date/span - never its whole feed. Default "30 days"; "all" for a deliberate backfill.

## `maxRetries` (type: `integer`):

Retries with backoff for network errors and 5xx responses.

## `stateStoreName` (type: `string`):

Name of the key-value store (in YOUR account) that holds the high-water mark per actor. Leave blank for the default.

## `stateNamespace` (type: `string`):

Advanced: an explicit namespace for the mark key. Leave blank to namespace by your Apify user id automatically.

## Actor input object example

```json
{
  "mode": "posts",
  "actors": [
    "bsky.app"
  ],
  "postUrls": [],
  "incremental": false,
  "maxReplyDepth": 10,
  "maxItems": 100,
  "firstRunSince": "30 days",
  "maxRetries": 3,
  "stateStoreName": "",
  "stateNamespace": ""
}
```

# 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 = {
    "actors": [
        "bsky.app"
    ],
    "postUrls": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("hridayrungta/bluesky-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 = {
    "actors": ["bsky.app"],
    "postUrls": [],
}

# Run the Actor and wait for it to finish
run = client.actor("hridayrungta/bluesky-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 '{
  "actors": [
    "bsky.app"
  ],
  "postUrls": []
}' |
apify call hridayrungta/bluesky-scraper --silent --output-dataset

```

## MCP server setup

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