# Bluesky Posts Scraper — Feed, Search & Engagement (`axery/bluesky-posts-scraper`) Actor

Scrape Bluesky posts by account or full-text search via the official AT Protocol public API: text, engagement counts, links, images. No login, no app password.

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

## Pricing

from $0.80 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Bluesky Posts Scraper (Account Feed + Search)

Scrapes Bluesky posts via the **official AT Protocol public API** — no login, no app password, no API key. The AT Protocol is built around public, portable data, so these read endpoints need no authentication by design.

### Two modes

- **Account feed** — every post by one account, newest first, optionally including its replies
- **Full-text search** — posts matching a query across the whole network, sortable by latest or top, filterable by language

### What makes this different

**Outbound links are actually recovered.** Bluesky does not put links inline in post text — it stores them as byte-range annotations (rich-text *facets*) alongside it. A scraper that only reads `record.text` silently loses every URL in every post. This Actor walks the facets and returns them in a `links` field.

**Both identifiers, not just one.** AT Protocol identifies a post by an `at://` URI, which is stable and precise but not openable in a browser. This Actor keeps that URI *and* derives a clickable `bsky.app` URL from it, so rows are both machine-stable and human-usable.

**Host routing that isn't obvious.** `public.api.bsky.app` serves account feeds and profiles fine, but returns **HTTP 403** for `searchPosts` — while `api.bsky.app` serves search with 200. Picking either host alone would silently lose half the functionality, so the client routes per-method.

**Two timestamps, kept separate.** `created_at` is when the author says they posted; `indexed_at` is when the network saw it. These differ on federated or backfilled posts, so collapsing them into one would quietly misrepresent post timing.

### Input

| Field | Type | Notes |
|---|---|---|
| `mode` | enum | `author` or `search`. |
| `targets` | array | Handles/DIDs in author mode, queries in search mode. |
| `includeReplies` | boolean | Author mode only. |
| `sort`, `lang` | enum / string | Search mode only. |
| `maxItems` | integer | Per target. `0` = everything reachable. |
| `incremental` | boolean | Only posts not seen in previous runs. |
| `proxyConfiguration` | object | Not normally needed. |

### Local development

```bash
pip install -r requirements.txt
python test_local.py --mode author bsky.app --max 20 --out sample_output.json
python test_local.py --mode search "python" --max 20 --lang en
```

`sample_output.json` is real output from a live account-feed run.

# Actor input Schema

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

`Account feed` returns posts by one account. `Full-text search` returns posts matching a query across the whole network.

## `targets` (type: `array`):

In `author` mode: Bluesky handles (`user.bsky.social`, with or without @) or DIDs. In `search` mode: search queries. Each runs independently into the same dataset.

## `includeReplies` (type: `boolean`):

Include replies the account made to other people, not just its own top-level posts. Ignored in search mode.

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

How search results are ordered. Ignored in author mode.

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

Restrict search results to one language, e.g. `en`, `id`, `ja`. Leave blank for all languages.

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

Maximum posts per handle or query. Set to `0` for everything reachable - the Actor pages by cursor until the feed is exhausted or a safety guard trips.

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

Remember post URIs between runs and return only posts not seen before. You are charged only for the new rows.

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

Not normally needed - the AT Protocol AppView is a public read API with no anti-bot layer.

## Actor input object example

```json
{
  "mode": "author",
  "targets": [
    "bsky.app"
  ],
  "includeReplies": false,
  "sort": "latest",
  "lang": "en",
  "maxItems": 100,
  "incremental": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `posts` (type: `string`):

One row per post: text, author, engagement counts, links, images, timestamps.

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

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

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

```

## MCP server setup

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