MarkdownCopies this page as Markdown, ready to paste into an AI assistant.
Threads API
5 Threads endpoints behind one key, priced in credits per call and routed to the cheapest healthy source.
On this page
Social · 5 endpoints · from 2 credits per call
Endpoints
- POSTThreads Post
/v1/run/threads.postOne Threads post by URL: text, author, timestamp and like, reply, repost and quote counts.2 creditsper call - POSTThreads Post Search
/v1/run/threads.searchSearch public Threads posts by keyword or hashtag, optionally within a date range; up to 10 posts per call with engagement counts.2 creditsper call - POSTThreads Profile
/v1/run/threads.profilePublic Threads profile by username: bio, follower count, verification, privacy flag, picture and bio links.2 creditsper call - POSTThreads User Posts
/v1/run/threads.user_postsThe latest public posts of a Threads user (about 20-30 are visible) with text, timestamps, engagement counts and URLs.2 creditsper call - POSTThreads User Search
/v1/run/threads.search_usersSearch Threads accounts by name or username and get handle, display name, verification and profile picture.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, threads.post:
curl -sS -X POST "https://api.primaryapi.com/v1/run/threads.post" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://www.threads.com/@zuck/post/DK-BydcJHkF"}'const res = await fetch('https://api.primaryapi.com/v1/run/threads.post', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PRIMARYAPI_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://www.threads.com/@zuck/post/DK-BydcJHkF',
}),
});
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/threads.post",
headers={"Authorization": f"Bearer {os.environ['PRIMARYAPI_API_KEY']}"},
json={
"url": "https://www.threads.com/@zuck/post/DK-BydcJHkF",
},
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.