Get a profile's posts
curl --request POST \
--url https://api.stophy.dev/v1/bluesky/posts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user": "bsky.app",
"limit": 50
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({user: 'bsky.app', limit: 50})
};
fetch('https://api.stophy.dev/v1/bluesky/posts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/bluesky/posts"
payload = {
"user": "bsky.app",
"limit": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"posts": [
{
"url": "<string>",
"likes": 0,
"reposts": 0,
"replies": 0,
"quotes": 0,
"id": "<string>",
"cid": "<string>",
"text": "<string>",
"language": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"author": {
"id": "<string>",
"username": "<string>",
"name": "<string>",
"url": "<string>",
"avatar": "<string>",
"isVerified": true
},
"replyTo": {
"id": "<string>",
"url": "<string>",
"username": "<string>"
},
"repostedBy": {
"id": "<string>",
"username": "<string>",
"name": "<string>",
"url": "<string>",
"avatar": "<string>",
"isVerified": true
},
"hashtags": [
"<string>"
],
"mentions": [
"<string>"
],
"links": [
"<string>"
],
"images": [
{
"url": "<string>",
"thumbnail": "<string>",
"alt": "<string>"
}
],
"video": {
"url": "<string>",
"thumbnail": "<string>",
"alt": "<string>"
},
"link": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"image": "<string>"
},
"quoted": {
"url": "<string>",
"id": "<string>",
"text": "<string>",
"author": {
"id": "<string>",
"username": "<string>",
"name": "<string>",
"url": "<string>",
"avatar": "<string>",
"isVerified": true
}
}
}
],
"cursor": "<string>"
},
"creditsUsed": 123,
"requestId": "<string>"
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}Bluesky
Bluesky posts API
Call the Bluesky posts API to get cid, text, language, created at, author and likes, as JSON or markdown. 1 credit per 25 items, at least 1 credit.
POST
/
v1
/
bluesky
/
posts
Get a profile's posts
curl --request POST \
--url https://api.stophy.dev/v1/bluesky/posts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user": "bsky.app",
"limit": 50
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({user: 'bsky.app', limit: 50})
};
fetch('https://api.stophy.dev/v1/bluesky/posts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/bluesky/posts"
payload = {
"user": "bsky.app",
"limit": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"posts": [
{
"url": "<string>",
"likes": 0,
"reposts": 0,
"replies": 0,
"quotes": 0,
"id": "<string>",
"cid": "<string>",
"text": "<string>",
"language": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"author": {
"id": "<string>",
"username": "<string>",
"name": "<string>",
"url": "<string>",
"avatar": "<string>",
"isVerified": true
},
"replyTo": {
"id": "<string>",
"url": "<string>",
"username": "<string>"
},
"repostedBy": {
"id": "<string>",
"username": "<string>",
"name": "<string>",
"url": "<string>",
"avatar": "<string>",
"isVerified": true
},
"hashtags": [
"<string>"
],
"mentions": [
"<string>"
],
"links": [
"<string>"
],
"images": [
{
"url": "<string>",
"thumbnail": "<string>",
"alt": "<string>"
}
],
"video": {
"url": "<string>",
"thumbnail": "<string>",
"alt": "<string>"
},
"link": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"image": "<string>"
},
"quoted": {
"url": "<string>",
"id": "<string>",
"text": "<string>",
"author": {
"id": "<string>",
"username": "<string>",
"name": "<string>",
"url": "<string>",
"avatar": "<string>",
"isVerified": true
}
}
}
],
"cursor": "<string>"
},
"creditsUsed": 123,
"requestId": "<string>"
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}- Endpoint:
bluesky.posts - Returns:
datahasposts. - Cost: 1 credit per 25 items, at least 1 credit. Failed calls cost nothing.
- Paging: Yes. Send the
cursorfrom the response to get the next page. See Paging.
Example
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.bluesky.posts({ user: "bsky.app", limit: 50 });
console.log(result.data.posts);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.bluesky.posts(user="bsky.app", limit=50)
print(result["data"]["posts"])
curl -X POST https://api.stophy.dev/v1/bluesky/posts \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"user":"bsky.app","limit":50}'
stophy bluesky posts bsky.app --limit 50
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json