# Bluesky Post & Profile Scraper (AT Protocol API) (`arturpl6/bluesky-scraper`) Actor

Fast, unauthenticated scraper for Bluesky posts, keyword search, and user profile feeds via the AT Protocol API. Zero proxies, runs on 128 MB RAM.

- **URL**: https://apify.com/arturpl6/bluesky-scraper.md
- **Developed by:** [Artur Kierasiński](https://apify.com/arturpl6) (community)
- **Categories:** Social media, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 scraped posts

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 Post & Profile Scraper (AT Protocol API)

Extract public posts, keyword search results, and user profile timelines from Bluesky using the official AT Protocol API.

Designed for AI engineers, researchers, and data teams building social sentiment feeds or RAG datasets. Unlike traditional social media scrapers, this Actor queries the open AT Protocol directly—requiring no login accounts, no session cookies, and no residential proxy markups.

***

#### Features

- **Keyword & Hashtag Search:** Query public posts across the entire Bluesky network by keyword, phrase, or topic.
- **User Profile Timelines:** Extract full post histories and replies directly from user handles (e.g. `bsky.app` or `username.bsky.social`).
- **Normalized Social Metrics:** Captures like counts, repost counts, reply counts, quote counts, and media flags alongside author metadata (handle, display name, DID).
- **RAG-Ready Output:** Clean text and ISO timestamps ready for direct ingestion into vector stores, LLM evaluation pipelines, or CSV exports.
- **Lightweight & Fast:** Runs on sub-128 MB RAM containers using asynchronous HTTP requests without browser emulation overhead.

***

#### Input Parameters

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `mode` | `String` | `"search"` | Scrape mode: `search` (keyword search) or `profile` (user timeline). |
| `query` | `String` | `"artificial intelligence"` | Keywords or hashtags to search across posts (used in `search` mode). |
| `handle` | `String` | `null` | Target user handle (e.g. `bsky.app` or full profile URL, used in `profile` mode). |
| `maxItems` | `Integer` | `100` | Maximum number of posts to return. |

##### Example Input (Keyword Search)

```json
{
  "mode": "search",
  "query": "artificial intelligence",
  "maxItems": 100
}
```

##### Example Input (Profile Feed)

```json
{
  "mode": "profile",
  "handle": "bsky.app",
  "maxItems": 50
}
```

***

#### Sample Output

```json
{
  "uri": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3la2j3s3hnc2m",
  "cid": "bafyreih3h5i2...",
  "url": "https://bsky.app/profile/bsky.app/post/3la2j3s3hnc2m",
  "text": "Introducing custom feeds on Bluesky...",
  "created_at": "2024-05-20T18:42:00.000Z",
  "author_handle": "bsky.app",
  "author_name": "Bluesky",
  "author_did": "did:plc:z72i7hdynmk6r22z27h6tvur",
  "reply_count": 42,
  "repost_count": 128,
  "like_count": 512,
  "quote_count": 19,
  "lang": "en",
  "has_media": false
}
```

***

#### Use Cases

- Collecting real-time discussion data for LLM fine-tuning, RAG pipelines, or AI agent context.
- Monitoring brand mentions, product feedback, or developer sentiment.
- Analyzing social engagement metrics across creator or company profiles.

***

#### Performance

This Actor performs direct asynchronous requests to the AT Protocol AppView endpoint (`api.bsky.app/xrpc`). Requests complete in milliseconds without headless browsers or proxy networks.

# Actor input Schema

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

Choose between keyword search or user profile extraction

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

Keywords or hashtags (used in Search mode)

## `handle` (type: `string`):

User handle e.g. bsky.app or user.bsky.social (used in Profile mode)

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

Maximum number of posts to return

## Actor input object example

```json
{
  "mode": "search",
  "query": "artificial intelligence",
  "maxItems": 100
}
```

# Actor output Schema

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

Scraped Bluesky posts stored in the default dataset

# 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": "artificial intelligence"
};

// Run the Actor and wait for it to finish
const run = await client.actor("arturpl6/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": "artificial intelligence" }

# Run the Actor and wait for it to finish
run = client.actor("arturpl6/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": "artificial intelligence"
}' |
apify call arturpl6/bluesky-scraper --silent --output-dataset

```

## MCP server setup

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