# Bluesky Scraper: Posts, Profiles, Threads & Search (`datafaro/bluesky-scraper`) Actor

Scrape Bluesky posts, profiles, threads and followers, and run Bluesky search, through the official Bluesky API (AT Protocol). Small flat JSON plus a one-line summary, built for AI agents via MCP and for social listening. No login, no proxy, public data only.

- **URL**: https://apify.com/datafaro/bluesky-scraper.md
- **Developed by:** [Datafaro](https://apify.com/datafaro) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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, Profiles, Threads & Search

Get Bluesky data as small, flat JSON through the **official Bluesky API** (AT Protocol): keyword search, a user's recent posts, profile stats, full reply threads, and follower lists. Every run also returns a **one-line summary**, so AI agents can answer in one call.

- **Official API only.** No HTML scraping, no browser, no proxy. That means very few breakages.
- **Built for AI agents.** A narrow input with plain-English field descriptions, flat output, and a compact `OUTPUT` record that `run-sync` calls return quickly.
- **Cheap.** $1.00 per 1,000 results. Missing handles and deleted posts are free.
- **Fast.** A typical 50-item run takes a few seconds.

### What can it do?

| Mode | You give | You get |
|---|---|---|
| `search_posts` (default) | `query`, plus optional `since`, `until`, `lang`, `sort` | Posts matching the search |
| `user_posts` | `handles` (1–20), plus optional `since`, `until` | Recent posts by those accounts (reposts excluded) |
| `profile` | `handles` (1–20) | Followers, follows, post count, bio, join date |
| `thread` | `postUrl` | The post plus its replies, in conversation order |
| `followers` | `handles` (1–20) | Accounts that follow them (up to `maxItems`) |

Handles can be written as `@name`, `name.bsky.social`, a DID, or a `https://bsky.app/profile/...` URL. A bare name like `jay` means `jay.bsky.social`.

### Input examples

**Search** for the latest 100 English posts about Claude Code since November 1:

```json
{ "query": "claude code", "lang": "en", "since": "2026-11-01", "sort": "latest", "maxItems": 100 }
```

`query` supports Bluesky search syntax: `from:handle`, `mentions:handle`, `#hashtag`, `domain:example.com`, `"exact phrase"`.

An empty input (`{}`) runs a sample search for `bluesky` and says so in `warnings`. Any other search without a `query` fails with a message saying what to add.

**A user's posts** in a date window (`until` includes the whole day):

```json
{ "mode": "user_posts", "handles": ["bsky.app"], "since": "2026-10-01", "until": "2026-10-31" }
```

**Profiles:**

```json
{ "mode": "profile", "handles": ["@bsky.app", "jay.bsky.team", "https://bsky.app/profile/pfrazee.com"] }
```

**A thread:**

```json
{ "mode": "thread", "postUrl": "https://bsky.app/profile/bsky.app/post/3n27yge3hys24", "maxItems": 200 }
```

**Followers**, capped at 200:

```json
{ "mode": "followers", "handles": ["bsky.app"], "maxItems": 200 }
```

`maxItems` (default 50, max 1000) caps the results for the whole run. With several handles, the budget is shared fairly, and budget an account doesn't use passes to the next.

### Output

Each result is one dataset item. All results also go into the key-value store record `OUTPUT`.

**Post** (`search_posts`, `user_posts`, `thread`):

```json
{
  "type": "post",
  "url": "https://bsky.app/profile/bsky.app/post/3n27yge3hys24",
  "author": "bsky.app",
  "authorName": "Bluesky",
  "text": "I heard Bluesky gets all its breaking news from Flavor Flav",
  "createdAt": "2026-11-13T22:03:20Z",
  "likes": 7571, "reposts": 669, "replies": 204, "quotes": 48,
  "lang": "en",
  "links": [],
  "hasMedia": false,
  "replyTo": null
}
```

`replyTo` is the URL of the parent post when the item is a reply. `links` lists the URLs in the text and in the link card. `hasMedia` is true when the post has images or video.

**Profile** (`profile`):

```json
{
  "type": "profile",
  "handle": "bsky.app",
  "displayName": "Bluesky",
  "description": "official Bluesky account ...",
  "followers": 35723540, "follows": 43, "posts": 924,
  "createdAt": "2023-04-12T04:53:57Z",
  "url": "https://bsky.app/profile/bsky.app"
}
```

**Follower** (`followers`) has the same fields as a profile, but no counts (Bluesky's follower list doesn't include them), plus `followerOf`. To get counts for some of those accounts, run `profile` mode on them.

**Failed target** (missing handle, deleted post). These items are free:

```json
{ "type": "profile", "input": "no-such-user.bsky.social", "error": "Profile not found or unavailable" }
```

#### The `OUTPUT` record

```json
{
  "summary": "50 posts, 2026-11-10 to 2026-11-18, top post 340 likes (https://bsky.app/profile/...)",
  "request": { "mode": "search_posts", "query": "claude code", "sort": "latest", "maxItems": 50 },
  "counts": { "ok": 50, "errors": 0 },
  "complete": true,
  "warnings": [],
  "items": [ ... ]
}
```

- `complete: false` means the run stopped early, because Bluesky failed partway through or your maximum charge was reached. The reason is in `error` or `summary`, which then starts with `PARTIAL:`.
- `warnings` lists input fields the mode ignored, and notes when a date filter had to be applied after fetching. (Bluesky rejects date filters combined with `from:`, `mentions:` or `#tag`, so the Actor filters those dates itself.)
- On invalid input, the run fails, and `OUTPUT.error` says exactly what to fix.
- The date range in `summary` ignores post dates more than a day in the future. Bluesky takes `createdAt` from the posting app as-is, and a few apps send wrong clocks. Items always keep the raw `createdAt`.

### Pricing

Pay per event:

| Event | Price |
|---|---|
| Actor start | $0.00005 |
| Result (one post, profile or follower) | $0.001, i.e. **$1.00 per 1,000** |

Failed items (missing handles, deleted posts) are not charged. Set a maximum charge per run in Apify if you like; the Actor stops cleanly when it's reached.

Example: 100 search results cost about $0.10.

### Use with Claude, ChatGPT and other AI agents (MCP)

Add this Actor as a tool through the Apify MCP server:

```
https://mcp.apify.com/?tools=datafaro/bluesky-scraper
```

In Claude Desktop or Claude Code, add it as a remote MCP server and sign in with Apify. Then just ask, for example: *"What are people on Bluesky saying about Claude Code this week?"* The agent fills in `mode`, `query` and `since`, and gets back the summary plus flat posts.

For direct API calls, use `run-sync` and read the `OUTPUT` record. It has everything in one response.

### FAQ

**Is this the official Bluesky API?**
Yes. It reads from Bluesky's public AppView (`public.api.bsky.app` and `api.bsky.app`), the same API the Bluesky app uses. It doesn't scrape HTML and doesn't use proxies.

**Do I need a Bluesky account or password?**
No. Never enter your Bluesky password anywhere for this Actor. If Bluesky refuses anonymous search, the Actor uses a dedicated account owned by the publisher.

**What data does it collect?**
Only public data that any logged-out visitor can see on bsky.app: posts, public profile fields and follower lists. It doesn't collect emails, DMs or anything private, and it's read-only: it never posts, likes or follows.

**Are there limits?**
Up to 1,000 results and 20 handles per run. Bluesky search pages deep into results, but not without limit: very broad queries may stop before 1,000. `followers` returns accounts in the order Bluesky lists them, newest first.

**Why is a field `null`?**
Bluesky didn't provide it. For example, `authorName` is empty when the author never set a display name, and `handle` is null when the account's handle failed verification. In that case, `url` uses the account's DID instead.

**What happens if Bluesky is down?**
The Actor retries with backoff and honours Bluesky's rate-limit headers. If Bluesky still fails, the run says so clearly. It never returns an empty "success".

# Actor input Schema

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

What to fetch: search_posts (posts matching a query), user_posts (recent posts of handles), profile (stats for handles), thread (a post plus its replies), followers (followers of handles).

## `query` (type: `string`):

search_posts only. Bluesky search text, e.g. "claude code". Supports Bluesky search syntax such as from:handle, #hashtag and "exact phrase". If the whole input is empty, a sample search for "bluesky" runs.

## `handles` (type: `array`):

user_posts, profile, followers. 1 to 20 accounts as @name, name.bsky.social, a DID or a bsky.app profile URL. A bare name like "jay" means jay.bsky.social.

## `postUrl` (type: `string`):

thread only. A post link like https://bsky.app/profile/<handle>/post/<id>, or an at:// post URI.

## `since` (type: `string`):

search_posts, user_posts. Only posts on or after this UTC date, YYYY-MM-DD. Empty = no lower bound.

## `until` (type: `string`):

search_posts, user_posts. Only posts on or before this UTC date (whole day included), YYYY-MM-DD. Empty = up to now.

## `lang` (type: `string`):

search_posts only. Language code of posts to return, e.g. "en", "es". Empty = all languages.

## `sort` (type: `string`):

search_posts only. latest = newest first; top = most engagement first.

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

Maximum results in the run (posts, profiles or followers), 1 to 1000. Shared across handles. You pay only for results returned.

## `selfTest` (type: `boolean`):

Operator setting: ignore other fields, run a fixed health check across all modes, never charge, and fail the run if anything breaks.

## Actor input object example

```json
{
  "mode": "search_posts",
  "query": "claude code",
  "handles": [
    "bsky.app"
  ],
  "postUrl": "",
  "since": "",
  "until": "",
  "lang": "",
  "sort": "latest",
  "maxItems": 50,
  "selfTest": false
}
```

# Actor output Schema

## `output` (type: `string`):

No description

## `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 = {
    "query": "claude code",
    "handles": [
        "bsky.app"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datafaro/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 = {
    "query": "claude code",
    "handles": ["bsky.app"],
}

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

```

## MCP server setup

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