Get a profile's posts
curl --request POST \
--url https://api.stophy.dev/v1/threads/posts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user": "zuck",
"limit": 20
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({user: 'zuck', limit: 20})
};
fetch('https://api.stophy.dev/v1/threads/posts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/threads/posts"
payload = {
"user": "zuck",
"limit": 20
}
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>",
"type": "text",
"isReply": true,
"isPinned": true,
"id": "<string>",
"code": "<string>",
"text": "<string>",
"author": {
"id": "<string>",
"username": "<string>",
"name": "<string>",
"url": "<string>",
"avatar": "<string>",
"isVerified": true
},
"createdAt": "2023-11-07T05:31:56Z",
"likes": 0,
"replies": 0,
"reposts": 0,
"quotes": 0,
"shares": 0,
"images": [
{
"url": "<string>",
"caption": "<string>",
"alt": "<string>"
}
],
"videos": [
{
"url": "<string>"
}
],
"link": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"image": "<string>"
},
"replyTo": {
"id": "<string>",
"url": "<string>",
"username": "<string>"
},
"quoted": {
"url": "<string>",
"type": "text",
"isReply": true,
"isPinned": true,
"id": "<string>",
"code": "<string>",
"text": "<string>",
"author": {
"id": "<string>",
"username": "<string>",
"name": "<string>",
"url": "<string>",
"avatar": "<string>",
"isVerified": true
},
"createdAt": "2023-11-07T05:31:56Z",
"likes": 0,
"replies": 0,
"reposts": 0,
"quotes": 0,
"shares": 0,
"images": [
{
"url": "<string>",
"caption": "<string>",
"alt": "<string>"
}
],
"videos": [
{
"url": "<string>"
}
],
"link": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"image": "<string>"
},
"replyTo": {
"id": "<string>",
"url": "<string>",
"username": "<string>"
}
},
"repostOf": {
"url": "<string>",
"type": "text",
"isReply": true,
"isPinned": true,
"id": "<string>",
"code": "<string>",
"text": "<string>",
"author": {
"id": "<string>",
"username": "<string>",
"name": "<string>",
"url": "<string>",
"avatar": "<string>",
"isVerified": true
},
"createdAt": "2023-11-07T05:31:56Z",
"likes": 0,
"replies": 0,
"reposts": 0,
"quotes": 0,
"shares": 0,
"images": [
{
"url": "<string>",
"caption": "<string>",
"alt": "<string>"
}
],
"videos": [
{
"url": "<string>"
}
],
"link": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"image": "<string>"
},
"replyTo": {
"id": "<string>",
"url": "<string>",
"username": "<string>"
}
}
}
],
"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
}
}Threads
Threads posts API
Call the Threads posts API to get code, text, author, created at, likes and replies, as JSON or markdown. 1 credit per 20 items, at least 1 credit.
POST
/
v1
/
threads
/
posts
Get a profile's posts
curl --request POST \
--url https://api.stophy.dev/v1/threads/posts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user": "zuck",
"limit": 20
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({user: 'zuck', limit: 20})
};
fetch('https://api.stophy.dev/v1/threads/posts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/threads/posts"
payload = {
"user": "zuck",
"limit": 20
}
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>",
"type": "text",
"isReply": true,
"isPinned": true,
"id": "<string>",
"code": "<string>",
"text": "<string>",
"author": {
"id": "<string>",
"username": "<string>",
"name": "<string>",
"url": "<string>",
"avatar": "<string>",
"isVerified": true
},
"createdAt": "2023-11-07T05:31:56Z",
"likes": 0,
"replies": 0,
"reposts": 0,
"quotes": 0,
"shares": 0,
"images": [
{
"url": "<string>",
"caption": "<string>",
"alt": "<string>"
}
],
"videos": [
{
"url": "<string>"
}
],
"link": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"image": "<string>"
},
"replyTo": {
"id": "<string>",
"url": "<string>",
"username": "<string>"
},
"quoted": {
"url": "<string>",
"type": "text",
"isReply": true,
"isPinned": true,
"id": "<string>",
"code": "<string>",
"text": "<string>",
"author": {
"id": "<string>",
"username": "<string>",
"name": "<string>",
"url": "<string>",
"avatar": "<string>",
"isVerified": true
},
"createdAt": "2023-11-07T05:31:56Z",
"likes": 0,
"replies": 0,
"reposts": 0,
"quotes": 0,
"shares": 0,
"images": [
{
"url": "<string>",
"caption": "<string>",
"alt": "<string>"
}
],
"videos": [
{
"url": "<string>"
}
],
"link": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"image": "<string>"
},
"replyTo": {
"id": "<string>",
"url": "<string>",
"username": "<string>"
}
},
"repostOf": {
"url": "<string>",
"type": "text",
"isReply": true,
"isPinned": true,
"id": "<string>",
"code": "<string>",
"text": "<string>",
"author": {
"id": "<string>",
"username": "<string>",
"name": "<string>",
"url": "<string>",
"avatar": "<string>",
"isVerified": true
},
"createdAt": "2023-11-07T05:31:56Z",
"likes": 0,
"replies": 0,
"reposts": 0,
"quotes": 0,
"shares": 0,
"images": [
{
"url": "<string>",
"caption": "<string>",
"alt": "<string>"
}
],
"videos": [
{
"url": "<string>"
}
],
"link": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"image": "<string>"
},
"replyTo": {
"id": "<string>",
"url": "<string>",
"username": "<string>"
}
}
}
],
"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:
threads.posts - Returns:
datahasposts. - Cost: 1 credit per 20 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.threads.posts({ user: "zuck", limit: 20 });
console.log(result.data.posts);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.threads.posts(user="zuck", limit=20)
print(result["data"]["posts"])
curl -X POST https://api.stophy.dev/v1/threads/posts \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"user":"zuck","limit":20}'
stophy threads posts zuck --limit 20
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json