MarkdownCopies this page as Markdown, ready to paste into an AI assistant.
Bluesky API
3 Bluesky endpoints behind one key, priced in credits per call and routed to the cheapest healthy source.
On this page
Social · 3 endpoints · from 1 credit per call
Endpoints
- POSTBluesky Post
/v1/run/bluesky.postOne public Bluesky post by URL: text, author, like, reply, repost and quote counts, media and creation time.1 creditper call - POSTBluesky Profile
/v1/run/bluesky.profilePublic Bluesky profile for one handle or DID: display name, bio, avatar, follower, following and post counts.1 creditper call - POSTBluesky User Posts
/v1/run/bluesky.user_postsRecent posts from one Bluesky account, newest first, with engagement counts, media and cursor pagination.1 creditper call
Calling them
Every endpoint on this page is one POST to https://api.primaryapi.com/v1/run/{sku} with your API key and a JSON body. Responses share one envelope, so code written for one endpoint handles the others. For example, bluesky.post:
curl -sS -X POST "https://api.primaryapi.com/v1/run/bluesky.post" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://bsky.app/profile/bsky.app/post/3mz4cvlf7z22v"}'const res = await fetch('https://api.primaryapi.com/v1/run/bluesky.post', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PRIMARYAPI_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://bsky.app/profile/bsky.app/post/3mz4cvlf7z22v',
}),
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.code}: ${body.error}`);
// found:false is a successful answer ("does not exist"), not an error
console.log(body.output.found ? body.output.data : body.output.reason, body.credits);import os
import requests
res = requests.post(
"https://api.primaryapi.com/v1/run/bluesky.post",
headers={"Authorization": f"Bearer {os.environ['PRIMARYAPI_API_KEY']}"},
json={
"url": "https://bsky.app/profile/bsky.app/post/3mz4cvlf7z22v",
},
timeout=60,
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['code']}: {body['error']}")
# found=False is a successful answer ("does not exist"), not an error
print(body["output"]["data"] if body["output"]["found"] else body["output"]["reason"], body["credits"])New to PrimaryAPI? Start with the Quickstart, then read Making requests.