- Make sure you have Node.JS installed.
- Create a folder
- Add
tsconfig.jsonandpackage.jsonto that folder. - Add
index.mtsto asrcfolder beneath it. - Edit the fourth line of
index.mtsto contain your bluesky handle, excluding the@sign. - Open a terminal in the main folder.
- Run
npm install - Run
npm run build - Run
node . - A file called
followers.csvshould now exist. Use it.
Last active
June 17, 2025 04:38
-
-
Save furrz/1211664ff38bf16fda08f73f2cbce7f8 to your computer and use it in GitHub Desktop.
bsky-follower-download (NodeJS + TypeScript)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { AtpAgent } from "@atproto/api"; | |
| import { createWriteStream } from "fs"; | |
| const username = "zyntaks.ca" | |
| export const agent = new AtpAgent({ | |
| service: "https://api.bsky.app", | |
| }); | |
| const csvEscape = (str: string) => | |
| `"${str.replace(/"/g, '""')}"`; | |
| const outStream = createWriteStream("followers.csv") | |
| let cursor: string | undefined = "" | |
| while (cursor != undefined) { | |
| const result = await agent.app.bsky.graph.getFollowers({ actor: username, cursor }); | |
| for (let follower of result.data.followers) { | |
| outStream.write(csvEscape(follower.handle ?? "null")) | |
| outStream.write(",") | |
| outStream.write(csvEscape(follower.displayName ?? "null")) | |
| outStream.write(",") | |
| outStream.write(csvEscape(follower.description ?? "null")) | |
| outStream.write("\r\n") | |
| } | |
| cursor = result.data.cursor; | |
| } | |
| outStream.close(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "bsky-follower-download", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "dist/index.mjs", | |
| "scripts": { | |
| "build": "tsc" | |
| }, | |
| "dependencies": { | |
| "@atproto/api": "^0.15.15" | |
| }, | |
| "devDependencies": { | |
| "@types/node": "^24.0.3", | |
| "typescript": "^5.5.3" | |
| }, | |
| "private": true | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "compilerOptions": { | |
| "target": "es2017", | |
| "module": "Node16", | |
| "esModuleInterop": true, | |
| "forceConsistentCasingInFileNames": true, | |
| "strict": true, | |
| "skipLibCheck": true, | |
| "outDir": "dist" | |
| }, | |
| "include": ["src"] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment