Indexing the follow count
README.md

Icarus #

A follower-count service for the AT Protocol network.

Icarus indexes the whole Bluesky social graph and answers one question: how many accounts follow this profile, and how many does it follow. It reads app.bsky.graph.follow records from a Jetstream v2 instance, keeps the DID, the handle and the follow edges, and throws away everything else as the records stream past.

Quick start #

echo "JETSTREAM_API_KEY=..." > .env
docker compose up --build

Or run it directly:

go build -o icarus ./cmd/icarus
JETSTREAM_API_KEY=... ./icarus

Icarus starts serving at once and backfills in the background. Watch the progress:

curl -s localhost:8080/metrics | grep icarus_ingest_cursor

A full network backfill takes a while. To try the service on a small scale first, index a handful of accounts:

ICARUS_DIDS=did:plc:ragtjsm2j2vknwkz3zp4oxrd \
ICARUS_BACKFILL_ONLY=true \
JETSTREAM_API_KEY=... ./icarus

The API #

GET /xrpc/de.atverkackt.icarus.getProfile?actor=<did|handle>
$ curl -s "localhost:8080/xrpc/de.atverkackt.icarus.getProfile?actor=pfrazee.com"
{"did":"did:plc:ragtjsm2j2vknwkz3zp4oxrd","handle":"pfrazee.com","followersCount":309643,"followsCount":680}

The response copies the shape of app.bsky.actor.defs#profileViewDetailed, so a client that already reads a Bluesky profile needs no new parsing. Only the four fields above are populated.

The lexicon is in lexicons/de/atverkackt/icarus/getProfile.json.

A query that names a handle resolves it and checks the DID document before it answers, so a handle never selects an account that does not own it. The did field is authoritative; the handle field of an answer to a DID query is the unverified claim of that account, and it reads handle.invalid when Icarus has not seen one.

Other routes: GET /health and GET /metrics.

Callers normally arrive through the atproto-proxy header of a Personal Data Server, which signs a service-auth token. See operations to turn that check on.

What the counts mean #

Icarus counts follow records. The Bluesky AppView counts distinct accounts.

A repository can hold two follow records that name the same subject. The record key of a follow record is a TID, so nothing in the repository prevents a duplicate. A client retry, a race between two sessions, or an import tool can each add one. The AppView keys its index on the pair of author and subject and ignores the duplicate. Icarus keys its index on the pair of author and record key and counts it.

Icarus must key on the record key. A delete event carries no record body, so the stored edge is the only place that holds the subject whose follower count changes.

A measurement of three accounts in August 2026:

account Icarus records in repository distinct subjects AppView
bsky.app 11 11 11 11
jay.bsky.team 4007 4007 3974 3974
pfrazee.com 680 680 679 677

Icarus matched the record count of every repository exactly. The AppView number for pfrazee.com is 2 below the distinct subject count, because the AppView also drops follows that point at accounts which no longer serve a profile.

Expect Icarus to read between 0 and 1 percent above the number that Bluesky shows.

Picon, indexing with Hubble #

cmd/picon answers the same queries from the same store. It differs in where the history comes from.

Icarus replays a Jetstream archive. The archive is metered, it charges for every collection to read one, and a full backfill is projected at ten days.

Picon reads hubble, a public mirror of the whole network. It asks for each repository once, in the STAR-lite format with zstd on the wire, and skips every record that is not a follow without decoding it. No key, no quota.

go build -o picon ./cmd/picon
PICON_DIDS=did:plc:z72i7hdynmk6r22z27h6tvur PICON_BACKFILL_ONLY=true ./picon

Picon runs two readers at once. The sweep folds a snapshot of every repository. The live tail folds the changes that arrive after a snapshot. Each snapshot carries a revision, and the tail applies an event only when the event is newer than the revision of that repository. A repository that the sweep has not read drops its events, because its snapshot arrives later and carries them.

A second sweep of a repository also removes the follow records that the repository dropped. Both sides of that comparison are sorted, so the fold walks them together and holds one edge at a time.

Documentation #

  • Development — layout, design, tests, how to verify a change against real network data.
  • Operations — configuration, deployment, authentication, telemetry, memory and disk planning, troubleshooting.
  • Findings — what the network measured, what the archive costs, and the mistakes worth not repeating.

License #

See the repository for license terms.