bluesky
Bluesky — keyword search, author feeds, and profiles
Read Bluesky via its public AppView API. No API key or account is required. Use this connector to search posts by keyword (bskySearch), read an account's recent posts (bskyAuthorFeed), or look up a profile (bskyProfile).
Every post comes back with a url field holding its human-facing bsky.app link, so results can go straight into an email or report. Post timestamps are epoch milliseconds, so they compare directly against now() from std::date.
Usage
import { bskySearch, bskyAuthorFeed } from "std::data/social/bluesky"
import { now } from "std::date"
node main() {
// Posts mentioning a topic in the last day.
const recent = bskySearch("agency lang", since: now() - 1d) catch []
for (p in recent) {
print("${p.author}: ${p.text}")
print(" ${p.url}")
}
}Shaping the tools for an agent
Like any Agency function, these verbs can be narrowed with partial application before handing them to an LLM:
const searchRecent = bskySearch.partial(sort: "latest", limit: 10)
const news = llm("what are people saying about agency-lang?", tools: [searchRecent])Types
BskySort
Result ordering for bskySearch.
/** Result ordering for `bskySearch`. */
export type BskySort = "latest" | "top"(source)
Post
A Bluesky post with a browser link and epoch-millisecond createdAt. A malformed source timestamp becomes zero.
/** A Bluesky post with a browser link and epoch-millisecond `createdAt`.
A malformed source timestamp becomes zero. */
export type Post = {
uri: string;
url: string;
author: string;
authorName: string;
text: string;
createdAt: number;
replyCount: number;
repostCount: number;
likeCount: number;
quoteCount: number
}(source)
Profile
A Bluesky account profile.
/** A Bluesky account profile. */
export type Profile = {
did: string;
handle: string;
displayName: string;
description: string;
followersCount: number;
followsCount: number;
postsCount: number
}(source)
Effects
std::bluesky
effect std::bluesky {
op: string;
query: string;
since: number;
limit: number
}(source)
Functions
bskySearch
bskySearch(
query: string,
sort: BskySort = "latest",
since: number = 0,
limit: number = 25,
): Result<Post[]> raises <std::bluesky, std::http::fetchJSON>Search public Bluesky posts by keyword.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
| query | string | ||
| sort | BskySort | "latest" | |
| since | number | 0 | Include posts at or after this epoch-millisecond timestamp, or zero for no time filter. |
| limit | number | 25 | The maximum results, clamped to the range zero through 100. |
Returns: Result<Post[]>
Throws: std::bluesky, std::http::fetchJSON
Needs: network
(source)
bskyAuthorFeed
bskyAuthorFeed(
handle: string,
limit: number = 30,
): Result<Post[]> raises <std::bluesky, std::http::fetchJSON>Read a Bluesky account's recent posts, newest first.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
| handle | string | An account handle such as "user.bsky.social", or a DID. | |
| limit | number | 30 | The maximum posts, clamped to the range zero through 100. |
Returns: Result<Post[]>
Throws: std::bluesky, std::http::fetchJSON
Needs: network
(source)
bskyProfile
bskyProfile(
handle: string,
): Result<Profile> raises <std::bluesky, std::http::fetchJSON>Read a Bluesky account's public profile and follower counts.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
| handle | string | An account handle such as "user.bsky.social", or a DID. |
Returns: Result<Profile>
Throws: std::bluesky, std::http::fetchJSON
Needs: network
(source)