Blog / API guides

Bluesky API: Public Posts and Feeds as JSON

To get public Bluesky posts and feeds as JSON, call Perceptlayer's Bluesky endpoints: GET /v1/bluesky/search-posts returns posts for a keyword with likeCount, repostCount, replyCount, quoteCount, langs and createdAt per post, and GET /v1/bluesky/user-posts returns one account's feed, such as a brand's official account. Every one of the 15 endpoints costs 1 credit per successful call, and all of them are restricted, so you accept the restricted-endpoint terms first. This guide shows the requests, real responses, a topic tracker in Python and the cost.

What does the Bluesky API on Perceptlayer cover?

The Bluesky API on Perceptlayer has 15 GET endpoints that return JSON: post search, account feeds, threads, posts by URI, engagement lists, profiles and handle lookups. Each costs 1 credit per successful call. All 15 are restricted, because social data can identify people. This guide uses them for aggregate work: topic volume, language mix and engagement on public brand accounts.

Group Endpoints Credits
Posts and feeds search-posts, user-posts, thread, posts 1 each
Engagement on a post likes, reposts, quotes 1 each
Accounts profile, profiles, search-users, typeahead-users, resolve-handle 1 each
Graph followers, following, relationships 1 each

All paths start with /v1/bluesky/. The data is collected from publicly available sources and returned as found at the time of the call. These endpoints aren't Bluesky's own developer API, and this guide makes no claims about that API, its access rules or its terms; compare the two yourself. The Bluesky API page lists every endpoint with a playground.

What do the restricted-endpoint terms mean for you?

A restricted endpoint works once you accept the restricted-endpoint terms in your dashboard. Until then, a call returns restricted_endpoint (403) and costs nothing, like every failed call. The terms don't permit collecting personal data without a lawful basis, or using the data to contact people. Read them in full before you build anything, along with Bluesky's own terms.

That shapes what's worth building. Counting how many posts mention a topic, which languages they're in and how much engagement they draw is aggregate work. So is watching a company's or project's official account. Profiling, tracking or contacting individuals is not. The graph and engagement endpoints, which list who follows or liked something, return data about people, so this guide doesn't use them, and the excerpts below drop authors' handles, names, avatars and post text.

How do you search Bluesky posts?

Send a GET request to https://api.perceptlayer.com/v1/bluesky/search-posts with your keyword and your key in the X-API-Key header. This is the request behind the recorded search in this guide:

curl "https://api.perceptlayer.com/v1/bluesky/search-posts?query=bluesky&limit=10" \
  -H "X-API-Key: $API_KEY"

Keys start with sk_live_. Where you can't set a header, pass the key in the api_key query parameter; the authentication docs cover both. Every successful response carries X-Credits-Used and X-Credits-Remaining.

Which search parameters matter for topic tracking?

The catalogue lists version as the one required parameter, with the values v1 and v2; the recorded request didn't send it, so set it explicitly once you've tested both in the playground. Everything else is optional. The table lists the parameters a topic tracker is most likely to use, with what the API documents; formats for dates and sort values aren't documented.

Parameter Type Required Documented constraint
version string yes v1 or v2
q, query string no Up to 2,048 characters
limit integer no None documented
cursor string no Up to 2,048 characters
sort string no Up to 32 characters
lang string no Up to 64 characters
since, until string no Up to 64 characters
hashtags[], domains[], languages[] list of strings no Up to 2,048 characters
hasMedia, hasVideo, excludeReplies boolean no None documented

The endpoint takes more filters than these, from urls[] to excludeLanguages[] to allTime; the Bluesky API page lists them all. Avoid author, authors[] and mentions[] for anything aimed at individuals: they narrow a search to people, which the terms don't support without a lawful basis.

What does a search response contain?

A search response holds a posts array, a cursor, total hit fields and labels. Each post has a uri, an author object, the record with createdAt, langs, text and any embed, and five engagement counts. This is the recorded "bluesky" response, trimmed, with the author object and post text removed:

{
  "posts": [
    {
      …
      "author": "…",
      "record": {
        "$type": "app.bsky.feed.post",
        "createdAt": "2026-11-12T00:47:51.509Z",
        "embed": {
          "$type": "app.bsky.embed.images",
          …
        },
        "langs": [
          "en"
        ],
        "text": "…"
      },
      …
      "bookmarkCount": 44,
      "replyCount": 19,
      "repostCount": 120,
      "likeCount": 1728,
      "quoteCount": 8,
      "indexedAt": "2026-11-12T00:47:41.479Z"
    },
    {
      …
      "bookmarkCount": 318,
      "replyCount": 21,
      "repostCount": 1071,
      "likeCount": 4226,
      "quoteCount": 4,
      "indexedAt": "2026-11-08T11:38:52.075Z"
    }
  ],
  "cursor": "eyJzIjpbMTMuMTIxNzQ1…",
  "hitsTotal": 10000,
  "success": true,
  "endpoint": "search-posts",
  …
  "hits_total": 10000,
  "hits_total_approximate": true,
  …
}
Field What an aggregate job does with it
uri Deduplicates posts across runs; store it, not the author
record.createdAt When the post was written, for volume over time
record.langs Language codes, for the language mix of a topic
record.embed.$type Whether posts carry images or other embeds
likeCount, repostCount, replyCount, quoteCount, bookmarkCount Engagement at the time of the call
hits_total, hits_total_approximate A rough size for the topic

The response's hits_total_note says the figure "saturates near 10000 and is not an exact total", and the recorded value is exactly 10,000. For a broad keyword, that means you can't compare topic sizes with it. Count the posts you collect per time window instead. The response's cursor has the same name as the cursor parameter; test paging in the playground before you loop on it.

How do you read a brand account's feed?

GET /v1/bluesky/user-posts takes an actor and returns that account's feed, with an optional filter such as posts_no_replies. For aggregate work, point it at public brand or project accounts. The recorded call used Bluesky's own official account, bsky.app, with filter=posts_no_replies:

curl "https://api.perceptlayer.com/v1/bluesky/user-posts?actor=bsky.app&limit=10&filter=posts_no_replies" \
  -H "X-API-Key: $API_KEY"
{
  "feed": [
    {
      "post": {
        …
        "record": {
          "$type": "app.bsky.feed.post",
          "createdAt": "2026-11-11T22:19:56.200Z",
          …
          "text": "Rolling out now: a new notifications screen.\n\nFilter by type (replies, follows, post alerts) or see only people you follow. Similar notifications are now groupe…"
        },
        …
        "bookmarkCount": 126,
        "replyCount": 148,
        "repostCount": 315,
        "likeCount": 1745,
        "quoteCount": 110,
        …
      }
    },
    {
      "post": {
        …
        "repostCount": 6956,
        "likeCount": 19967,
        …
      },
      "reason": {
        …
        "$type": "app.bsky.feed.defs#reasonRepost"
      },
      …
    }
  ],
  "cursor": "2026-11-05T00:43:24.62Z",
  "success": true,
  "endpoint": "user-posts",
  …
}

The second item is a repost: it has a reason with $type app.bsky.feed.defs#reasonRepost, and its post belongs to another account. filter=posts_no_replies doesn't remove reposts, so skip items with a reason when you measure the brand's own posts. The profile endpoint returned followersCount: 35632424 and postsCount: 920 for the same account.

How do you track topic volume with Python?

A topic tracker runs one search per topic on a schedule, keeps each post once by uri, and writes one summary row per topic: posts seen, total likes and reposts, and the top languages. It stores no authors, handles or text. The script uses requests, csv and collections and reads only fields from the recorded search response, each treated as optional.

import collections
import csv
import datetime
import os
import time

import requests

API_KEY = os.environ["API_KEY"]
URL = "https://api.perceptlayer.com/v1/bluesky/search-posts"
TOPICS = ["bluesky", "open source", "climate"]


def search(topic, attempts=3):
    params = {"query": topic, "limit": 10}
    for _ in range(attempts):
        r = requests.get(URL, params=params, headers={"X-API-Key": API_KEY}, timeout=60)
        if r.status_code in (429, 503):
            time.sleep(int(r.headers.get("Retry-After", "5")))
            continue
        r.raise_for_status()
        return r.json()
    raise RuntimeError(f"gave up on {topic}")


now = datetime.datetime.now(datetime.timezone.utc).isoformat()
with open("bluesky-topics.csv", "a", newline="") as f:
    out = csv.writer(f)
    for topic in TOPICS:
        data = search(topic)
        seen, langs = set(), collections.Counter()
        likes = reposts = with_images = 0
        for post in data.get("posts", []):
            if post.get("uri") in seen:
                continue
            seen.add(post.get("uri"))
            record = post.get("record", {})
            langs.update(record.get("langs") or ["(none)"])
            likes += post.get("likeCount") or 0
            reposts += post.get("repostCount") or 0
            if (record.get("embed") or {}).get("$type") == "app.bsky.embed.images":
                with_images += 1
        out.writerow([
            now, topic, len(seen), likes, reposts, with_images,
            ";".join(f"{k}:{v}" for k, v in langs.most_common(3)),
            data.get("hits_total"), data.get("hits_total_approximate"),
        ])
        time.sleep(1)

The request mirrors the recorded one. Once you've chosen a version, add it to params, along with any lang or since filter you've tested. The one-second pause keeps a free account within its 1 request a second.

What should the job do with errors?

Every error returns an HTTP status and a JSON body with code, message and request_id, and costs nothing. restricted_endpoint (403) means the terms aren't accepted yet. Retry rate_limited (429) and temporarily_unavailable (503) after the Retry-After seconds, and treat invalid_parameters (422) as a bug in your inputs. Requests have no idempotency key, so a timeout can hide a billed call. The errors docs list every code.

What does Bluesky data cost?

Every Bluesky endpoint costs 1 credit per successful call, so the cost of a job is the number of calls it makes. A search spreads that credit across every post it returns: the recorded call asked for limit=10 and the first two posts alone carried 5,954 likes between them. Brand feeds cost the same, 1 credit per page.

Plan Arithmetic Credits a month
10 topics, one search daily 10 × 30 days × 1 credit 300
40 topics, four searches a day 40 × 4 × 30 days × 1 credit 4,800
25 brand feeds daily 25 × 30 days × 1 credit 750
200 topics, hourly 200 × 24 × 30 days × 1 credit 144,000

The first three fit the Starter pack's 10,000 credits, and the last fits the Growth pack's 200,000. The 100 free credits on signup cover 100 calls, enough to run the 10-topic plan for 10 days. Failed calls cost nothing and return X-Credits-Used: 0. See pricing for what credits cost and the credits docs for how calls are debited.

To start, accept the restricted-endpoint terms, then run query=bluesky in the playground on the Bluesky API page. Other social sources are on the social media APIs page, and more guides like this are in API guides.

APIs in this post

Frequently asked questions

Is this Bluesky's official API?

No. These are Perceptlayer endpoints that return public Bluesky data collected from publicly available sources, as found at the time of the call. This guide makes no claims about Bluesky's own API, its access rules or its terms. If you're choosing between them, compare them yourself, and read Bluesky's terms before you use the data.

Are all Bluesky endpoints restricted?

Yes, all 15. They work after you accept the restricted-endpoint terms in your dashboard; until then, calls return restricted_endpoint (403) and cost nothing. The terms don't permit collecting personal data without a lawful basis or using it to contact people, so keep to aggregate work such as topic volume, language mix and brand-account engagement.

The search response reports hits_total, but treat it as an estimate. In the recorded "bluesky" search it was 10,000 with hits_total_approximate: true, and hits_total_note says the figure saturates near 10,000 and isn't an exact total. For a reliable volume, count the unique posts you collect per time window.

Which search parameter is required?

The catalogue lists version, with the values v1 and v2, as required for search-posts; thread requires it too, along with a uri. The recorded search request sent only query and limit. Test both versions in the playground, then set the one you choose explicitly in every call so your results stay consistent.

How fast can I call these endpoints?

Limits are per account, shared by all its keys, and counted per minute. A free account gets 1 request a second, 60 a minute. Paying accounts run at least 5 requests a second, 300 a minute, depending on the pack. Rate-limited calls return 429 with a Retry-After header and cost nothing. The rate limits docs list each pack's rate.

  1. Threads Scraper or API: What You Get

    A DIY Threads scraper versus 8 Threads endpoints at 1 credit a call: keyword search, topic tags, brand posts, upkeep, terms and the cost per tag tracked.

  2. Mastodon API: Public Posts and Hashtags as JSON

    Get public Mastodon hashtag timelines as JSON: language, created_at, reblogs_count and tags per post, with a pagination cursor. 1 credit per call.

  3. Truth Social API: Public Posts as JSON

    Seven Truth Social endpoints as JSON at 1 credit each: public posts with reply, reblog and favourite counts, live shows and video. All are restricted.

Start with 100 free credits

No password to set. We email you a sign-in link, and your key works on every API.

No credit card. 100 free credits on signup.