Bluesky post search API
Full-text search over Bluesky posts, latest or top, filtered by date, language, author, mentions, linked domain or URL, and hashtags.
GET /v1/bluesky/search/posts1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/bluesky/search/posts?q=espresso&limit=5",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "posts": [ { "uri": "at://did:plc:owq4fzezy2nk7xehqbulzoks/app.bsky.feed.post/3n33rkjaou225", "cid": "bafyreifynu2siem5qxpwsbkppypvkww3p7kwquds4jzmwausmx5dbokoqe", "author": { "did": "did:plc:owq4fzezy2nk7xehqbulzoks", "handle": "formthehead.bsky.social", "displayName": "formthehead", "pronouns": "he/him", "avatar": "https://cdn.bsky.app/img/avatar/plain/did:plc:owq4fzezy2nk7xehqbulzoks/bafkreigt…", "associated": { "…": "2 fields" }, "labels": [], "createdAt": "2023-10-26T15:57:10.821Z" }, "record": { "text": "If you ever go to a big chain cafe in China half the menu is just [normal drink]…", "createdAt": "2026-11-24T23:14:56.776Z", "$type": "app.bsky.feed.post", "embed": { "…": "2 fields" }, "langs": [ "…" ] }, "embed": { "record": { "…": "12 fields" }, "$type": "app.bsky.embed.record#view" }, "replyCount": 1, "repostCount": 0, "likeCount": 2, "quoteCount": 0, "bookmarkCount": 0, "…": "2 more fields" }, "… 4 more" ], "cursor": "eyJzIjpbMTc5NTU2MTY5MjAwMCwiZGlkOnBsYzp2cmNzcjVoZHYzYnNpNDdqcWJ0am1zeGkiLCIzbjMz…", "hitsTotal": 10000}Parameters
| Name | Type | Description |
|---|---|---|
qquery · required | string | Search terms; Lucene-style "quoted phrases" work. Example: espresso. |
sortquery | "latest" | "top" | latest (default) or top. One of latest, top. |
sincequery | string | Only posts at or after this time. Example: 2026-09-01. |
untilquery | string | Only posts before this time. Example: 2026-09-01. |
langquery | string | Language code, e.g. en, ja. |
authorquery | string | Only posts by this handle or DID. |
mentionsquery | string | Only posts mentioning this handle or DID. |
domainquery | string | Only posts linking to this domain. |
urlquery | string | Only posts linking to this URL. |
tagquery | string | Hashtags without #, comma-separated (all must match). |
limitquery | integer | Items per page, 1 to 100. Default 25. |
afterquery | string | Cursor: the previous page’s cursor. |
Response fields
200 with a BlueskySearchPosts, in the AT Protocol’s own app.bsky lexicon JSON.
| Field | Type | Description |
|---|---|---|
posts | BlueskyPostView[] | |
cursor | string | Pass it as after for the next page; absent on the last page. |
hitsTotal | integer |
Status codes
| Status | Meaning |
|---|---|
200 | A page of matching posts. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The account, post, feed, list or starter pack does not exist, was deleted or taken down. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Bluesky is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
How do I get the next page?
Pass the response’s cursor back as after. Bluesky’s cursors are stateless, so they keep working.
Can I go further back in time?
Set until to the oldest createdAt you have and search again.
Bluesky is a trademark of Bluesky Social PBC. We are not affiliated with or endorsed by Bluesky.