MarkdownCopies this page as Markdown, ready to paste into an AI assistant.
Truth Social API
3 Truth Social endpoints behind one key, priced in credits per call and routed to the cheapest healthy source.
On this page
Social · 3 endpoints · from 2 credits per call
Endpoints
- POSTTruth Social Post
/v1/run/truthsocial.postOne public Truth Social post by URL: text, author, like, comment and ReTruth counts, media and timestamp.2 creditsper call - POSTTruth Social Profile
/v1/run/truthsocial.profilePublic Truth Social account profile by handle: display name, bio, follower, following and post counts, verification.2 creditsper call - POSTTruth Social User Posts
/v1/run/truthsocial.user_postsRecent posts of a public Truth Social account, newest first, with engagement counts and media, paged by cursor.2 creditsper 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, truthsocial.post:
curl -sS -X POST "https://api.primaryapi.com/v1/run/truthsocial.post" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://truthsocial.com/@realDonaldTrump/114315219437063160"}'const res = await fetch('https://api.primaryapi.com/v1/run/truthsocial.post', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PRIMARYAPI_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://truthsocial.com/@realDonaldTrump/114315219437063160',
}),
});
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/truthsocial.post",
headers={"Authorization": f"Bearer {os.environ['PRIMARYAPI_API_KEY']}"},
json={
"url": "https://truthsocial.com/@realDonaldTrump/114315219437063160",
},
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.