# Bluesky Scraper (`ef12/bluesky-scraper`) Actor

Scrape Bluesky posts and profiles. Get post text, likes, reposts, replies, and timestamps via AT Protocol APIs.

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

## Pricing

$3.00 / 1,000 per 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/docs.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.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/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

## Bluesky Scraper

Scrape **public Bluesky posts, user profiles, and search results**. Extract post text, like/repost/reply counts, author handles, and timestamps into clean structured data — ready for **API access, scheduling, and integration** with Zapier, Make, Google Sheets, and more on the [Apify platform](https://apify.com).

### What does Bluesky Scraper do?

This Actor lets you pull posts from any Bluesky profile or search for posts by keyword. It works by rendering Bluesky's browser-based UI through **Playwright** (handling Cloudflare challenges automatically) and fetching the underlying AT Protocol data. You get back a clean dataset with one row per post.

- Scrape **any public profile** — get their timeline
- **Search posts** by keyword (requires login credentials)
- Export as JSON, CSV, Excel, or HTML

### Why use Bluesky Scraper?

- **Monitor mentions and trends** — track what people are posting about your brand, product, or topic
- **Research and analysis** — collect posts from specific accounts for content analysis
- **Backup your data** — archive posts from your own or public profiles
- **Automate workflows** — pipe Bluesky data into your analytics pipeline via Apify API

### How to use Bluesky Scraper

1. **Create a free Apify account** at [console.apify.com](https://console.apify.com)
2. **Open the Bluesky Scraper** and click "Try" or "Run"
3. **Fill in the input** — provide a profile handle (e.g. `bsky.app`) or a search query
4. **Run the Actor** — results appear in seconds
5. **Export your data** — download as JSON, CSV, HTML, or Excel

#### Running locally

```bash
apify run --input-file=test-input.json
````

### Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `profile_handle` | string | No\* | Bluesky handle to scrape posts from, e.g. `bsky.app` |
| `search_query` | string | No\* | Search for posts containing this query |
| `max_results` | integer | No | Max posts to return (1–100, default 25) |
| `bsky_handle` | string | No | Handle for authenticated requests (required for search) |
| `app_password` | string | No | App password for authenticated requests (required for search) |

\* At least one of `profile_handle` or `search_query` is required.

#### Search authentication

Searching Bluesky requires an authenticated account. To enable search:

1. Go to **Settings → Privacy & Security → App Passwords** in Bluesky
2. Create a new app password
3. Provide your handle as `bsky_handle` (e.g. `user.bsky.social`) and the app password as `app_password`

Profile scraping does **not** require authentication.

### Output

Each dataset item represents a single post:

```json
{
  "author": "bsky.app",
  "post_url": "https://bsky.app/profile/bsky.app/post/3abc123xyz",
  "text": "Hello Bluesky! This is a sample post.",
  "repost_count": 42,
  "like_count": 150,
  "reply_count": 12,
  "created_at": "2025-01-15T10:30:00.000Z"
}
```

You can download the dataset in various formats such as **JSON, HTML, CSV, or Excel** from the Apify Console.

### Data table

| Field | Type | Description |
| --- | --- | --- |
| `author` | string | Bluesky handle of the post author |
| `post_url` | string | Direct link to the post on bsky.app |
| `text` | string | Content of the post |
| `repost_count` | integer | Number of reposts |
| `like_count` | integer | Number of likes |
| `reply_count` | integer | Number of replies |
| `created_at` | string | ISO 8601 timestamp of when the post was created |

n**Cost example:** 25 posts = 15 paid × $0.02 = **$0.30 per run**. First 10 results are free.

### Pricing / Cost estimation

The **first 10 results per run are free**. After that, each additional result costs **$0.02** (billed via Apify platform usage). A typical run with 25 results on a public profile costs under **$0.30**.

Profile scraping completes in a few seconds — well within the **Apify free tier** for most use cases.

### Tips and advanced options

- **Max results** — lower this to 10 for a free-only run (no usage charges)
- **Rate limits** — Bluesky's API is generous; you can scrape profiles back-to-back without issues
- **Large profiles** — set `max_results` to 100 to get the most recent 100 posts from a profile
- **Search** — realistic terms work best; common words return more results

### FAQ

**Q: Do I need a Bluesky account to use this?**\
A: Only for search. Profile scraping works without any account.

**Q: Can I scrape posts from a profile I'm not following?**\
A: Yes — all public Bluesky profiles are accessible.

**Q: Is this legal?**\
A: This Actor scrapes only **public** Bluesky data. Always respect Bluesky's Terms of Service and rate limits. You are responsible for how you use the data.

**Q: What if I get empty results?**\
A: For profiles, ensure the handle exists and is spelled correctly (e.g. `bsky.app` not `bskyapp`). For search, ensure you've provided valid `bsky_handle` and `app_password`.

### Support

Report issues or request features on the [Issues tab](https://console.apify.com/actors). Need a custom solution? Contact the Apify team.

### Disclaimer

> This Actor is designed for ethical web scraping. It only extracts publicly available data and does not access private user information. However, you should be aware that your results may contain personal data. Personal data is protected by GDPR in the European Union and by other regulations worldwide. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your legal counsel.

### Technical notes

This Actor uses **Playwright** (headless Chromium) to establish a browser context that passes Cloudflare challenges, then calls Bluesky's **AT Protocol APIs** from within the browser to fetch structured post data. No HTML scraping is involved.

# Actor input Schema

## `search_query` (type: `string`):

Search for posts containing this query. Requires bsky\_handle + app\_password.

## `profile_handle` (type: `string`):

Bluesky handle to scrape posts from, e.g. bsky.app

## `max_results` (type: `integer`):

Maximum number of posts to scrape (1–100)

## `bsky_handle` (type: `string`):

Handle used for login, e.g. user.bsky.social (required for search)

## `app_password` (type: `string`):

Bluesky app password for authenticated requests (required for search)

## Actor input object example

```json
{
  "max_results": 25
}
```

# 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 = {};

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

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Bluesky Scraper",
        "description": "Scrape Bluesky posts and profiles. Get post text, likes, reposts, replies, and timestamps via AT Protocol APIs.",
        "version": "0.0",
        "x-build-id": "6kYbazVPwOevgkqI8"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ef12~bluesky-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ef12-bluesky-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/ef12~bluesky-scraper/runs": {
            "post": {
                "operationId": "runs-sync-ef12-bluesky-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/ef12~bluesky-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-ef12-bluesky-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": {
                    "search_query": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "Search for posts containing this query. Requires bsky_handle + app_password."
                    },
                    "profile_handle": {
                        "title": "Profile Handle",
                        "type": "string",
                        "description": "Bluesky handle to scrape posts from, e.g. bsky.app"
                    },
                    "max_results": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum number of posts to scrape (1–100)",
                        "default": 25
                    },
                    "bsky_handle": {
                        "title": "Bluesky Handle (for auth)",
                        "type": "string",
                        "description": "Handle used for login, e.g. user.bsky.social (required for search)"
                    },
                    "app_password": {
                        "title": "App Password",
                        "type": "string",
                        "description": "Bluesky app password for authenticated requests (required for search)"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
