Get a post's text, author and stats
curl --request POST \
--url https://api.stophy.dev/v1/x/post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"post": "https://x.com/jack/status/20"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({post: 'https://x.com/jack/status/20'})
};
fetch('https://api.stophy.dev/v1/x/post', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/x/post"
payload = { "post": "https://x.com/jack/status/20" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"postUrl": "<string>",
"media": [
{
"type": "photo",
"url": "<string>",
"thumbnailUrl": "<string>",
"durationSeconds": 123
}
],
"links": [
"<string>"
],
"hashtags": [
"<string>"
],
"mentions": [
"<string>"
],
"isEdited": true,
"isSensitive": true,
"postId": "<string>",
"text": "<string>",
"publishedAt": "2023-11-07T05:31:56Z",
"language": "<string>",
"likes": 0,
"replies": 0,
"authorId": "<string>",
"authorUsername": "<string>",
"authorName": "<string>",
"authorUrl": "<string>",
"authorAvatarUrl": "<string>",
"authorIsVerified": true,
"replyToUrl": "<string>",
"parentText": "<string>",
"quotedUrl": "<string>",
"quotedText": "<string>"
},
"creditsUsed": 123,
"requestId": "<string>"
}{
"success": false,
"error": {
"code": "agentCodeCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123,
"requiredCredits": 123,
"availableCredits": 123,
"billingUrl": "https://stophy.dev/billing"
}
}{
"success": false,
"error": {
"code": "agentCodeCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123,
"requiredCredits": 123,
"availableCredits": 123,
"billingUrl": "https://stophy.dev/billing"
}
}X
X post API
Get a post’s text, author and stats. Call the X post API and get JSON back in one request. 1 credit per call. Failed calls cost nothing.
POST
/
v1
/
x
/
post
Get a post's text, author and stats
curl --request POST \
--url https://api.stophy.dev/v1/x/post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"post": "https://x.com/jack/status/20"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({post: 'https://x.com/jack/status/20'})
};
fetch('https://api.stophy.dev/v1/x/post', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/x/post"
payload = { "post": "https://x.com/jack/status/20" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"postUrl": "<string>",
"media": [
{
"type": "photo",
"url": "<string>",
"thumbnailUrl": "<string>",
"durationSeconds": 123
}
],
"links": [
"<string>"
],
"hashtags": [
"<string>"
],
"mentions": [
"<string>"
],
"isEdited": true,
"isSensitive": true,
"postId": "<string>",
"text": "<string>",
"publishedAt": "2023-11-07T05:31:56Z",
"language": "<string>",
"likes": 0,
"replies": 0,
"authorId": "<string>",
"authorUsername": "<string>",
"authorName": "<string>",
"authorUrl": "<string>",
"authorAvatarUrl": "<string>",
"authorIsVerified": true,
"replyToUrl": "<string>",
"parentText": "<string>",
"quotedUrl": "<string>",
"quotedText": "<string>"
},
"creditsUsed": 123,
"requestId": "<string>"
}{
"success": false,
"error": {
"code": "agentCodeCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123,
"requiredCredits": 123,
"availableCredits": 123,
"billingUrl": "https://stophy.dev/billing"
}
}{
"success": false,
"error": {
"code": "agentCodeCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123,
"requiredCredits": 123,
"availableCredits": 123,
"billingUrl": "https://stophy.dev/billing"
}
}- Endpoint:
x.post - Returns:
datahaspostId,postUrl,text,publishedAt,language,likes,replies,authorId,authorUsername,authorName,authorUrl,authorAvatarUrl,authorIsVerified,media,links,hashtags,mentions,replyToUrl,parentText,quotedUrl,quotedText,isEdited,isSensitive. - Cost: 1 credit per call. Failed calls cost nothing.
- Paging: No.
Example
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.x.post({ post: "https://x.com/jack/status/20" });
console.log(result.data);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.x.post(post="https://x.com/jack/status/20")
print(result["data"])
curl -X POST https://api.stophy.dev/v1/x/post \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"post":"https://x.com/jack/status/20"}'
stophy x post https://x.com/jack/status/20
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json