Blueskyの投稿をスクリーンショットする方法(手動・API)
更新日
Blueskyの投稿を1件だけスクリーンショットするなら、投稿ページで端末のスクリーンショット機能を使うか、アプリの画面を含まない投稿の埋め込みカードを開いて撮影します。ニュースレター、レポート、アーカイブ、ボットなどで自動的に撮影したい場合は、投稿のURLをスクリーンショットAPIに送り、CSSセレクターで投稿部分だけを切り抜きます。以下のTypeScriptの例は、実際の投稿で動作を確認しています。
方法1:手動でスクリーンショットを撮る
- bsky.appまたはアプリで投稿を開きます。
- システムのショートカットを使います。MacはShift + Cmd + 4(投稿の周りをドラッグ)、WindowsはWin + Shift + S、スマートフォンでは通常のスクリーンショット操作です。
1件だけなら十分ですが、投稿の周りに表示されているアプリの画面も写り込み、画像サイズも画面によって変わります。
方法2:投稿の埋め込みカードを撮影する
Blueskyの投稿には、Webサイトに埋め込むときと同じ、すっきりした埋め込み表示があります。投稿の**⋯**メニューから「Embed post」(投稿を埋め込む)を選ぶと埋め込みコードを取得できます。URLを自分で組み立てることもできます。
https://embed.bsky.app/embed/<account DID>/app.bsky.feed.post/<post ID>
投稿IDは投稿URLの最後の部分です。DIDはアカウントの固有IDで、どのハンドルでもhttps://public.api.bsky.app/xrpc/com.atproto.identity.resolveHandle?handle=<ハンドル>で調べられます。埋め込みカードには投稿者、本文、メディア、日付、Blueskyのロゴだけが表示され、ボタンやサイドバーがないため、記事やスライドに向いています。
方法3:スクリーンショットAPIで自動化する
スクリーンショットAPIは、サーバー上の実際のブラウザでページを表示して画像を返すため、ヘッドレスブラウザを自分で運用する必要がありません。以下の例ではScreenshotOneを使います。無料プランで毎月100枚まで撮影できます。開示:ScreenshotOneはBluesky.Gardenの運営者が作っており、このサイトのツールのスクリーンショットにも使っています。
どの例も追加パッケージなしで、標準のfetch(Node.js 18以降)だけを使います。実行方法:
- ScreenshotOneのダッシュボードでアクセスキーを取得します。
- 例を
screenshot.tsとして、{ "type": "module" }を含むpackage.jsonがあるフォルダーに保存します。 SCREENSHOTONE_ACCESS_KEY=your-key npx tsx screenshot.tsを実行します。
bsky.appの表示のまま投稿を撮影する
投稿のURLとCSSセレクターを渡し、ページ全体ではなく投稿部分だけを切り抜きます。
import { writeFile } from "node:fs/promises";
const ACCESS_KEY = process.env.SCREENSHOTONE_ACCESS_KEY!;
async function screenshotBlueskyPost(postUrl: string): Promise<Buffer> {
const params = new URLSearchParams({
access_key: ACCESS_KEY,
url: postUrl,
// Crop to the post itself instead of the whole bsky.app page.
selector: '[data-testid^="postThreadItem-by-"]',
format: "png",
device_scale_factor: "2", // retina-sharp image
block_cookie_banners: "true",
block_ads: "true",
});
const response = await fetch(`https://api.screenshotone.com/take?${params}`);
if (!response.ok) {
throw new Error(`ScreenshotOne error ${response.status}: ${await response.text()}`);
}
return Buffer.from(await response.arrayBuffer());
}
const image = await screenshotBlueskyPost(
"https://bsky.app/profile/dmytrokrasun.com/post/3n3m6tm52gk2b"
);
await writeFile("post.png", image);
console.log(`Saved post.png (${image.length} bytes)`);
結果:

セレクターはbsky.appの投稿ページのメインの投稿を対象にしています。Blueskyがページ構造を変えると切り抜きが効かなくなる可能性があるため、その場合は、埋め込み用に作られていて変更の少ない下の埋め込みカードの方法に切り替えてください。
ダークモードにするには、パラメーターにdark_mode: "true"を追加します。

すっきりした埋め込みカードを撮影する
こちらは投稿URLを埋め込みURLに変換し(BlueskyのパブリックAPIでハンドルをDIDに解決)、カードを撮影します。full_pageと小さなビューポートの高さを組み合わせると、画像の高さがカードにぴったり合います。
import { writeFile } from "node:fs/promises";
const ACCESS_KEY = process.env.SCREENSHOTONE_ACCESS_KEY!;
/** Turns https://bsky.app/profile/<handle>/post/<id> into Bluesky's embed URL. */
async function toEmbedUrl(postUrl: string): Promise<string> {
const match = postUrl.match(/bsky\.app\/profile\/([^/]+)\/post\/([^/?#]+)/);
if (!match) throw new Error(`Not a Bluesky post URL: ${postUrl}`);
const [, handleOrDid, postId] = match;
// Embed URLs need the account's DID, so resolve the handle first.
let did = handleOrDid;
if (!did.startsWith("did:")) {
const res = await fetch(
`https://public.api.bsky.app/xrpc/com.atproto.identity.resolveHandle?handle=${handleOrDid}`
);
if (!res.ok) throw new Error(`Could not resolve handle ${handleOrDid}`);
did = ((await res.json()) as { did: string }).did;
}
return `https://embed.bsky.app/embed/${did}/app.bsky.feed.post/${postId}`;
}
async function screenshotPostCard(postUrl: string): Promise<Buffer> {
const params = new URLSearchParams({
access_key: ACCESS_KEY,
url: await toEmbedUrl(postUrl),
format: "png",
viewport_width: "600",
viewport_height: "100", // with full_page, the image shrinks to fit the card
full_page: "true",
device_scale_factor: "2",
});
const response = await fetch(`https://api.screenshotone.com/take?${params}`);
if (!response.ok) {
throw new Error(`ScreenshotOne error ${response.status}: ${await response.text()}`);
}
return Buffer.from(await response.arrayBuffer());
}
const image = await screenshotPostCard(
"https://bsky.app/profile/dmytrokrasun.com/post/3n3m6tm52gk2b"
);
await writeFile("post-card.png", image);
console.log(`Saved post-card.png (${image.length} bytes)`);
結果:

アカウントの最新の投稿をまとめて撮影する
週次レポートなどで投稿をまとめて撮影するには、BlueskyのパブリックAPI(ログイン不要)でアカウントの投稿を取得し、それぞれの埋め込みカードを撮影します。
import { writeFile } from "node:fs/promises";
const ACCESS_KEY = process.env.SCREENSHOTONE_ACCESS_KEY!;
type FeedItem = { post: { uri: string; author: { did: string } } };
/** Latest original posts (no reposts) of an account, from Bluesky's public API. */
async function getLatestPosts(handle: string, limit: number) {
const params = new URLSearchParams({ actor: handle, limit: String(limit), filter: "posts_no_replies" });
const res = await fetch(`https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?${params}`);
if (!res.ok) throw new Error(`Bluesky API error ${res.status}`);
const { feed } = (await res.json()) as { feed: FeedItem[] };
return feed
.filter(({ post }) => post.author.did === post.uri.split("/")[2]) // skip reposts
.map(({ post }) => {
const postId = post.uri.split("/").pop()!;
return {
postId,
embedUrl: `https://embed.bsky.app/embed/${post.author.did}/app.bsky.feed.post/${postId}`,
};
});
}
async function screenshot(url: string): Promise<Buffer> {
const params = new URLSearchParams({
access_key: ACCESS_KEY,
url,
format: "png",
viewport_width: "600",
viewport_height: "100",
full_page: "true",
device_scale_factor: "2",
});
const response = await fetch(`https://api.screenshotone.com/take?${params}`);
if (!response.ok) {
throw new Error(`ScreenshotOne error ${response.status}: ${await response.text()}`);
}
return Buffer.from(await response.arrayBuffer());
}
for (const { postId, embedUrl } of await getLatestPosts("dmytrokrasun.com", 3)) {
await writeFile(`${postId}.png`, await screenshot(embedUrl));
console.log(`Saved ${postId}.png`);
}
実行すると、投稿IDをファイル名にしたPNGが投稿ごとに保存されます。
本番運用のヒント
- アクセスキーはサーバー側に置きます。 APIはバックエンドやスクリプトから呼び出し、ブラウザのコードからは呼ばないでください。公開HTMLに載せても安全な画像URLが必要な場合は、ScreenshotOneの署名付きリンクを使います。
- Web向けには
format: "webp"や"jpg"を使うとファイルが小さくなります。文書で文字をくっきり見せたい場合はPNGのままにします。 cache: "true"でキャッシュを有効にします。 キャッシュされたスクリーンショットは利用枠にカウントされないため、同じ投稿を何度も取得する場合に役立ちます。- 撮影できるのは公開投稿だけです。 ログアウト中のユーザーへの表示を制限しているアカウントの投稿は、スクリーンショットAPIを含め、ログインしていないブラウザでは表示されません。
- AIエージェントに任せることもできます。 ScreenshotOneにはMCPサーバーがあり、ClaudeなどのMCPクライアントのエージェントに投稿のリンクを渡すだけで撮影できます。
ほかのスクリーンショットAPI
ScreenshotOne以外にも選択肢があります。screenshotapis.comでは、38のスクリーンショット・ブラウザAPIを料金、機能、出力形式で比較できます。
スクリーンショットではなく、投稿を閲覧したりメディアをダウンロードしたりしたい場合はBskyViewer.appを、画像ではなくJSONで投稿データを取得したい場合はBlueskyの開発者向けツールをご覧ください。
FAQ
Blueskyの投稿全体をスクリーンショットするには?
投稿を開いて端末のスクリーンショット機能を使うか、投稿の⋯メニュー(Embed post)から埋め込みカードを開くと、すっきりした画像になります。自動化する場合は、投稿部分を切り抜くセレクターを付けて、投稿URLをスクリーンショットAPIに送ります。
アプリのボタンやサイドバーなしで撮影できますか?
はい。https://embed.bsky.app/embed/<DID>/app.bsky.feed.post/<投稿ID>の埋め込みカードを使います。投稿、メディア、日付、Blueskyのロゴだけが表示されます。
Blueskyの投稿を自動でスクリーンショットできますか?
はい。ScreenshotOneなどのスクリーンショットAPIは、ブラウザで投稿を表示して画像を返します。BlueskyのパブリックAPIと組み合わせれば、上の例のように、アカウントの最新の投稿を定期的に撮影できます。
撮影にBlueskyアカウントは必要ですか?
公開投稿なら不要です。bsky.appの投稿ページも埋め込みカードもログインせずに表示でき、BlueskyのパブリックAPIにも認証は必要ありません。
ダークモードで撮影できますか?
はい。ScreenshotOneでdark_mode=trueを追加すると、bsky.appはブラウザのカラースキームに合わせてダークテーマで投稿を表示します。