Threads search API
Threads posts matching a keyword, top or newest first.
GET /v1/threads/search/postsBeta1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/threads/search/posts?q=coffee",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "posts": [ { "pk": "4037951213140509347", "id": "4037951213140509347_80504215627", "code": "DgJrzv_mQKj", "url": "https://www.threads.com/@kws815/post/DgJrzv_mQKj", "taken_at": 1795581317, "text": "서울 나들이", "media_type": 8, "user": { "pk": "80504215627", "username": "kws815", "full_name": "kws815", "profile_pic_url": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-19/630346036_17844641289687628_7283415294318316539_n.jpg?stp=dst-jp…", "is_verified": false }, "like_count": 5, "reply_count": 2, "repost_count": 0, "quote_count": 0, "reshare_count": null, "is_reply": false, "reply_to_post_id": null, "reply_to_username": null, "images": [ { "url": "https://scontent-lax7-1.cdninstagram.com/v/t51.82787-15/927278558_18148855384597680_2462220623362706534_n.jpg?stp=dst-jp…", "width": 1440, "height": 1920 }, { "url": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-15/926322836_18148855372597680_4769351465639002074_n.jpg?stp=dst-jp…", "width": 1440, "height": 1920 }, "… 4 more" ], "language": "ko_KR" }, { "pk": "4037870233293434126", "id": "4037870233293434126_63234207892", "code": "DgJZZVolC0O", "url": "https://www.threads.com/@mrs.holmesmania/post/DgJZZVolC0O", "taken_at": 1795571663, "text": "This is the stupidest things ever, but I once, years ago, had a dream where i had a fancy sandwich with an accompanying…", "media_type": 19, "user": { "pk": "63234207892", "username": "mrs.holmesmania", "full_name": "Pavannah Saige", "profile_pic_url": "https://scontent-lax7-1.cdninstagram.com/v/t51.82787-19/895705617_17996508729111893_7803518944952537699_n.jpg?stp=dst-jp…", "is_verified": false }, "like_count": 775, "reply_count": 102, "repost_count": 0, "quote_count": 0, "reshare_count": 8, "is_reply": false, "reply_to_post_id": null, "reply_to_username": null, "language": "en" }, "… 4 more" ], "next_cursor": null}Parameters
| Name | Type | Description |
|---|---|---|
qquery · required | string | Search text. Example: coffee. |
sortquery | "top" | "recent" | top (default, Threads’ ranking) or recent (newest first). One of top, recent. |
Response fields
200 with a ThreadsPostList, in the shape of Threads’ own post and user objects.
| Field | Type | Description |
|---|---|---|
posts | ThreadsPost[] | |
next_cursor | string | null | Pass as cursor for the next page; null on the last page. |
Status codes
| Status | Meaning |
|---|---|
200 | Matching posts. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The account or post does not exist, or was removed. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Threads is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Threads is a trademark of Instagram, LLC (Meta Platforms, Inc.). We are not affiliated with or endorsed by Threads, Instagram or Meta.