Analyze Bluesky activity
On this page
Related contents
What happened in a community activity window: organic conversations, reaction bursts, or automated bot traffic?
In this guide, you run a Go collector that subscribes to the public Bluesky Jetstream firehose and appends arriving JSON events into ScopeDB through the Go SDK. While the live stream accumulates in the background, you first verify your analytical queries against a deterministic 16-event sample (capture_id = 'first') where every count is known (six new posts, including two replies, and five like or repost creations), then run the same ScopeQL pipelines against the live firehose (capture_id = 'live-first') to chart event volume, profile high-frequency actors directly from nested JSON fields, and compare capture windows without double-counting replayed batches.
Allow about 15 minutes after workspace setup.
1. Get the collector and connect
You need a ready ScopeDB Cloud workspace, Go 1.26 or later, Git, and a terminal (macOS, Linux, or WSL). Use a test workspace: this guide creates guide_bluesky.events_raw and the guide_bluesky.events view in the default scopedb database.
Clone the Demo Scene repository and enter the bluesky-events directory, which contains the collector, the 16-event sample (sample.ndjson), saved queries, and tests:
git clone https://github.com/scopedb/demo-scene.git scopedb-demos
cd scopedb-demos/bluesky-events
go mod downloadKeep this terminal open. In Console, open Home in your workspace and copy ScopeDB API.

Choose Create API key, give it a name such as event-tutorial, and choose an expiration. Select Create Key and copy the one-time secret. You can follow the connection walkthrough for additional setup details.

Export the endpoint and API key in your terminal:
export SCOPEDB_ENDPOINT="https://<endpoint>"
export SCOPEDB_API_KEY="<api-key>"Keep credentials in your local environment, outside source control. The live collector reads from the public Bluesky Jetstream service without requiring a Bluesky account or token, and the fixed sample remains available offline.
2. Create the schema and start the collector
The collector writes promoted envelope columns (capture_id, event_id, event_time, ingested_at, collection, operation) alongside the complete upstream payload in a single raw object column. Create the guide_bluesky schema, the append-only events_raw table, and the deduplicated events view using scope catalog (or in Console Data):
scope catalog apply --schema scopedb.guide_bluesky -f - --yes <<'JSON'
{
"name": "guide_bluesky",
"tables": [
{
"name": "events_raw",
"columns": [
{ "name": "capture_id", "data_type": "string" },
{ "name": "event_id", "data_type": "string" },
{ "name": "event_time", "data_type": "timestamp" },
{ "name": "ingested_at", "data_type": "timestamp" },
{ "name": "collection", "data_type": "string" },
{ "name": "operation", "data_type": "string" },
{ "name": "raw", "data_type": "object" }
]
}
],
"views": [
{
"name": "events",
"statement": "FROM guide_bluesky.events_raw DISTINCT ON capture_id, event_id BY ingested_at DESC"
}
]
}
JSONevents_raw retains every imported delivery, while events selects the latest delivery of each (capture_id, event_id) pair by ingested_at DESC. Query guide_bluesky.events for all downstream analysis so that replaying a file or recovering an interrupted batch never inflates your counts.
Start the collector and leave this terminal running while you work in Console:
go run .On startup, the program ensures the 16-event constructed sample is loaded under capture_id = 'first', then connects to Jetstream and continuously appends live events under capture_id = 'live-first' (flushing every 500 events or at least once per second). Press Ctrl+C whenever you want to stop; the collector flushes its active buffer before exiting.
Verify the deterministic sample window in Console Query:
FROM guide_bluesky.events
WHERE capture_id = 'first'
AGGREGATE count() AS unique_events,
min(event_time) AS first_seen, max(event_time) AS last_seen| unique_events | first_seen | last_seen |
|---|---|---|
| 16 | 2026-10-01T09:00:00Z | 2026-10-01T09:00:15Z |
3. Calibrate the queries on the fixed sample
Before querying a moving firehose, verify how each query separates record creations, nested reply metadata, and reaction targets on the 16-event sample.
First, count new record creations by collection:
FROM guide_bluesky.events
WHERE capture_id = 'first' AND operation = 'create'
GROUP BY collection
AGGREGATE count() AS creates
ORDER BY creates DESC, collection| collection | creates |
|---|---|
| app.bsky.feed.post | 6 |
| app.bsky.feed.like | 3 |
| app.bsky.feed.repost | 2 |
| app.bsky.graph.follow | 2 |
Filtering to operation = 'create' excludes the sample's remaining three mutations (one post update and two deletes) so edits and deletions are not miscounted as new posts.
Next, inspect the six post creations by traversing directly into the semi-structured raw object column—checking raw['record']['reply'] to distinguish replies from top-level posts, and TRY(raw['record']['embed']['$type']::string) to extract the attached media type without failing when embed is absent:
FROM guide_bluesky.events
WHERE capture_id = 'first'
AND collection = 'app.bsky.feed.post' AND operation = 'create'
SELECT raw['record']['reply'] IS NOT NULL AS is_reply,
TRY(raw['record']['embed']['$type']::string) AS embed_type
GROUP BY is_reply, embed_type
AGGREGATE count() AS posts
ORDER BY posts DESC, is_reply, embed_type| is_reply | embed_type | posts |
|---|---|---|
| FALSE | NULL | 2 |
| FALSE | app.bsky.embed.external | 1 |
| FALSE | app.bsky.embed.images | 1 |
| TRUE | app.bsky.embed.images | 1 |
| TRUE | app.bsky.embed.video | 1 |
Two of the six new posts are replies (is_reply = TRUE), and four of the six carry an image, external link, or video embed.
4. Join reactions to captured posts and inspect raw payloads
Dividing three likes by six posts does not produce a true engagement rate: reactions in an event stream often target posts created hours or days before your capture window opened. To check how many reactions reference posts created within the same capture, reconstruct each post's AT URI (at://<did>/<collection>/<rkey>) from raw and LEFT JOIN reaction targets against observed post creations:
FROM guide_bluesky.events
WHERE capture_id = 'first' AND operation = 'create'
AND collection IN ('app.bsky.feed.like', 'app.bsky.feed.repost')
SELECT collection, TRY(raw['record']['subject']['uri']::string) AS target_uri
LEFT JOIN (
FROM guide_bluesky.events
WHERE capture_id = 'first'
AND collection = 'app.bsky.feed.post' AND operation = 'create'
SELECT 'at://' || raw['did']::string || '/' || collection
|| '/' || raw['rkey']::string AS post_uri
DISTINCT ON post_uri
) AS posts ON target_uri = posts.post_uri
GROUP BY collection
AGGREGATE count() AS interactions,
sum(if(posts.post_uri IS NOT NULL, 1, 0)) AS targets_observed,
sum(if(posts.post_uri IS NULL, 1, 0)) AS targets_not_observed
ORDER BY collection| collection | interactions | targets_observed | targets_not_observed |
|---|---|---|---|
| app.bsky.feed.like | 3 | 2 | 1 |
| app.bsky.feed.repost | 2 | 1 | 1 |
Three of the five reactions match posts created inside the first window; the other two target older or external posts.
To inspect the underlying JSON document for any post mutation in Console, select the raw column:
FROM guide_bluesky.events
WHERE capture_id = 'first' AND collection = 'app.bsky.feed.post'
SELECT event_time, operation, raw
ORDER BY event_timeClick the raw cell in row 4 (2026-10-01T09:00:03Z) to open Row details. The side panel formats the complete semi-structured object so you can inspect nested paths such as raw['record']['text'] ("A constructed reply.") and raw['record']['reply'] before promoting or filtering on them in ScopeQL.

5. Investigate live Bluesky traffic
While you calibrated the queries on first, the collector has been continuously streaming public Bluesky activity into capture_id = 'live-first'. Because ScopeDB evaluates path expressions directly on the raw object column alongside promoted tags, you can pivot from high-level volume charts to ad-hoc actor profiling without altering the table schema.
Chart the live event mix
Start by breaking down all captured live deliveries by shortened collection and operation:
FROM guide_bluesky.events
WHERE capture_id = 'live-first'
SELECT replace(collection, 'app.bsky.', '') || ' · ' || operation AS event_type
GROUP BY event_type
AGGREGATE count() AS events
ORDER BY events DESC, event_typeSwitch the results toolbar from Table to Chart (Bar) to visualize the distribution across event types. In a typical multi-minute capture (344,603 events in the example below), feed.like · create dominates volume (223,061), followed by feed.post · create (51,831), feed.repost · create (35,300), and graph.follow · create (20,768), while delete operations form a long tail of unlikes, unfollows, and post removals.

Profile high-frequency actors and bots via ad-hoc JSON paths
Even though did (the decentralized account identifier) was never extracted into a dedicated table column, you can group directly by raw['did']::string and use ScopeQL's pipelined SELECT ... GROUP BY ... AGGREGATE flow to inspect the behavior of the most active accounts in live-first:
FROM guide_bluesky.events
WHERE capture_id = 'live-first' AND raw['did'] IS NOT NULL
SELECT replace(collection, 'app.bsky.', '') || '.' || operation AS kind, raw['did']::string AS did
GROUP BY did
AGGREGATE count() AS events,
sum(if(kind = 'graph.follow.create', 1, 0)) AS follows,
sum(if(kind = 'feed.like.create', 1, 0)) AS likes,
sum(if(kind = 'feed.post.create', 1, 0)) AS posts,
sum(if(kind = 'graph.follow.delete', 1, 0)) AS unfollows
ORDER BY events DESC LIMIT 5
Breaking each actor's total volume into follows, likes, posts, and unfollows immediately exposes automated behavior in the live stream—such as accounts that emit exclusively graph.follow.create (1,619 follows and zero posts or likes) or exclusively graph.follow.delete (600 unfollows).
Compare two live capture windows
To compare activity across separate observation windows, press Ctrl+C in the collector terminal and start a second live capture with -capture-id live-second:
go run . -capture-id live-secondEarlier captures remain intact. Run the following query to compare the observation boundaries, new post volume, and reply share between live-first and live-second:
FROM guide_bluesky.events
WHERE capture_id IN ('live-first', 'live-second')
AND collection = 'app.bsky.feed.post' AND operation = 'create'
GROUP BY capture_id
AGGREGATE min(event_time) AS first_seen, max(event_time) AS last_seen,
count() AS posts,
sum(if(raw['record']['reply'] IS NOT NULL, 1, 0)) AS replies
SELECT *, round(100.0 * replies / posts, 1) AS reply_percent
ORDER BY capture_id
Always evaluate posts and reply_percent alongside first_seen and last_seen so differences in capture duration are not mistaken for changes in posting rate.
6. Verify idempotent replay and delivery semantics
In production ingestion pipelines, network interruptions or client retries can deliver the same batch more than once. To see how the guide_bluesky.events view protects your queries from duplicate deliveries, replay sample.ndjson into capture_id = 'first':
go run . load -file sample.ndjson -capture-id firstThen compare the row count in the base table (events_raw) against the deduplicated view (events):
FROM guide_bluesky.events_raw
WHERE capture_id = 'first'
AGGREGATE count() AS stored_rowsFROM guide_bluesky.events
WHERE capture_id = 'first'
AGGREGATE count() AS unique_events| Target | Count before replay | Count after replay | Behavior |
|---|---|---|---|
guide_bluesky.events_raw | 16 | 32 | Appends every delivery so raw ingestion history and audit trails remain intact. |
guide_bluesky.events | 16 | 16 | Deduplicates on (capture_id, event_id) by ingested_at DESC at query time. |
Keep these four ingestion contracts in mind when adapting this pattern to your own streams:
- Idempotent batch recovery: If an SDK append fails or returns an unknown outcome, the collector stops and writes the unconfirmed batch to a local recovery file instead of blindly retrying. Once you resolve the underlying issue, replay the file under the original capture ID (
go run . load -file <recovery-file> -capture-id live-first). - Capture-scoped deduplication:
event_idcombines the Jetstream source instance and sequence number, andeventsdeduplicates within eachcapture_id. Keep the samecapture_idwhen replaying a recovery file, and avoid summing overlapping capture IDs without deduplicating acrossevent_id. - Observation vs. author timestamps:
event_timerecords the relay's observation timestamp (witnessedAt, falling back totime) rather than the client-suppliedrecord.createdAt, which can be clock-skewed or backdated.ingested_atrecords when the loader processed the event. - Append-only mutation log: Creating, updating, and deleting a post are distinct events with distinct sequence numbers. A
deleteevent carries no record body and does not erase earliercreatepayloads fromevents_raw.
Continue with Query events to explore more ScopeQL patterns, Model event data to decide when to promote hot JSON paths into typed columns, or Set data retention to manage historical storage.
Troubleshooting
| Symptom | Next step |
|---|---|
| Connection unavailable | Check outbound WebSocket access. The producer retries the same source; stop it and use a new capture ID before switching sources. |
401 or 403 during write | Verify SCOPEDB_ENDPOINT, SCOPEDB_API_KEY, key expiration, and the target workspace. |
| Setup query fails | Run the setup statements in the workspace matching your API key, then click Refresh catalog if the tree is stale. |
| Counts do not change | Confirm the collector is still printing Committed ... events, check your capture_id filter, and click Run again. |
| SDK append fails | Keep the printed recovery file path, fix the connectivity or auth issue, and replay with go run . load -file <path> -capture-id <id>. |
| Sample replay has 32 rows | Query guide_bluesky.events instead of guide_bluesky.events_raw so duplicate deliveries are collapsed. |