{
  "openapi": "3.1.0",
  "info": {
    "title": "Threads API",
    "version": "1.0.0",
    "description": "A Threads API for public Threads data: posts with exact like, reply, repost, quote and share counts, the replies to a post, account profiles with exact follower counts, an account’s posts, replies, media posts and reposts, post and account search, the posts under a topic and what is trending — as structured JSON, with cursor paging where Threads pages, a media download link and a free URL parser."
  },
  "servers": [
    {
      "url": "https://api.fetchlayer.dev/threads"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Every error, on every route. Branch on code and retryable rather than on the text; on a 5xx the text is generic. MCP tool errors carry the same fields in structuredContent, and as a JSON text block.",
        "properties": {
          "error": {
            "type": "string",
            "description": "What went wrong, in words. For a 400, what to change."
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status, repeated in the body."
          },
          "code": {
            "type": "string",
            "description": "The kind of error, stable: invalid_input, unauthorized, insufficient_credits, forbidden, not_found, expired, quota_exceeded, cancelled, time_limit, temporarily_unavailable, posts_unavailable, account_restricted, accounts_unavailable, follow_up_not_sent, store_unreachable, upstream_error, target_error, internal_error, tool_error. A platform may add its own; more may be added. Treat a code you do not recognise by its retryable flag."
          },
          "retryable": {
            "type": "boolean",
            "description": "Whether asking again can succeed."
          },
          "requestId": {
            "type": "string",
            "description": "This request’s id, also sent as the X-Request-Id header. Quote it when reporting a problem."
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "With invalid_input when the request's parameters are refused before the request runs: the parameters that were missing. Always present on those errors, empty when nothing was missing."
          }
        },
        "required": [
          "error",
          "code",
          "retryable",
          "requestId"
        ]
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key",
        "description": "Send your FetchLayer key as Authorization: Bearer ss-your-key."
      }
    }
  },
  "paths": {
    "/post-detail": {
      "post": {
        "operationId": "post-detail",
        "tags": [
          "Posts & replies"
        ],
        "summary": "Get one post in full",
        "description": "One public Threads post in full: the text, author, time, exact like, reply, repost, quote and share counts, images and video, link card and topic, and the post it quotes or reposts. For a reply, the posts it answers come with includeParents. 1 credit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "post": {
                    "type": "string",
                    "description": "A post: its link (https://www.threads.com/@zuck/post/DfihFPxkaZ1, threads.net too), its code (DfihFPxkaZ1) or its numeric id."
                  },
                  "includeParents": {
                    "type": "boolean",
                    "description": "For a reply, also return the posts it replies to, oldest first, in parents.",
                    "example": "false"
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged listing returns what it has with nextCursor and a note, billed for what it returned; a request with nothing to return yet fails with a retryable 503. We answer at the latest about 2 seconds before timeoutMs runs out (15% of it, at least 0.75 s, for limits under 13 seconds). Send timeoutMs equal to your own client’s timeout: then we can answer in time, fast, instead of your client dropping the connection while the request is still running."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "post"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "post": "DgA_nk4kiBd"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"threads\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on, such as \"one page of results\" or a listing that stopped early. Empty when there are none. An empty result always comes with a note explaining it."
                    },
                    "post": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "The post. A post that does not exist or is not public is a 404.",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "The post’s numeric id."
                        },
                        "code": {
                          "type": "string",
                          "description": "The post’s short code, as in its link. post-detail and post-replies accept it."
                        },
                        "url": {
                          "type": "string",
                          "description": "Link to the post."
                        },
                        "author": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "The account’s numeric id."
                            },
                            "username": {
                              "type": "string",
                              "description": "The username, without @. Every tool that takes user accepts it."
                            },
                            "fullName": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "The display name."
                            },
                            "isVerified": {
                              "type": "boolean",
                              "description": "Whether the account shows a verification badge."
                            },
                            "isPrivate": {
                              "type": [
                                "boolean",
                                "null"
                              ],
                              "description": "Whether the account is private. A private account’s posts are not returned."
                            },
                            "profilePicUrl": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Profile picture. Expires after a few days like every media link."
                            },
                            "url": {
                              "type": "string",
                              "description": "Link to the profile."
                            }
                          },
                          "additionalProperties": true
                        },
                        "text": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The post’s text. null for a post that is only media."
                        },
                        "entities": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "description": "What the text mentions, in order: { type: \"mention\", text, username }, { type: \"link\", text, url } and { type: \"tag\", text, topic }."
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "When it was posted (ISO 8601, UTC)."
                        },
                        "likeCount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Likes. An exact count."
                        },
                        "replyCount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Replies. An exact count."
                        },
                        "repostCount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Reposts. An exact count; the accounts that reposted are not available."
                        },
                        "quoteCount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Quotes. An exact count; the quotes themselves are not available."
                        },
                        "shareCount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Shares. An exact count."
                        },
                        "mediaType": {
                          "type": "string",
                          "description": "text, image, video, carousel, audio or other."
                        },
                        "media": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "description": "Images and videos, in order: { type (image or video), url (the image, or a video’s poster), videoUrl, width, height, altText }. The links expire after a few days; read the post again for fresh ones, or download through /media."
                        },
                        "linkPreview": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": true,
                          "description": "A link card on the post: { url, displayUrl, title, imageUrl }."
                        },
                        "topic": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": true,
                          "description": "The topic tag shown above the post: { name, id, url }. Pass id as topicId to topic-posts."
                        },
                        "isReply": {
                          "type": "boolean",
                          "description": "Whether the post is a reply."
                        },
                        "replyToUsername": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "For a reply, the account it answers."
                        },
                        "isPinned": {
                          "type": "boolean",
                          "description": "Whether the author pinned it to their profile."
                        },
                        "quotedPost": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": true,
                          "description": "The post this one quotes, in the same shape, one level deep."
                        },
                        "repostedPost": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": true,
                          "description": "On a repost, the original post, in the same shape, one level deep."
                        }
                      }
                    },
                    "parents": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "With includeParents on a reply: the posts it replies to, oldest first, in the same shape. Empty otherwise."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "threads",
                      "notes": [],
                      "post": {
                        "id": "4035505062717562973",
                        "code": "DgA_nk4kiBd",
                        "url": "https://www.threads.com/@zuck/post/DgA_nk4kiBd",
                        "author": {
                          "id": "63055343223",
                          "username": "zuck",
                          "fullName": "Mark Zuckerberg",
                          "isVerified": true,
                          "isPrivate": false,
                          "profilePicUrl": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107…",
                          "url": "https://www.threads.com/@zuck"
                        },
                        "text": "Top things I did today:\n1. Fixed roof\n2. Installed drywall\n3. Jet skied with a dog\n4. Pet Arugula",
                        "entities": [],
                        "createdAt": "2026-11-21T19:35:13.000Z",
                        "likeCount": 59632,
                        "replyCount": 427,
                        "repostCount": 549,
                        "quoteCount": 37,
                        "shareCount": 186,
                        "mediaType": "text",
                        "media": [],
                        "linkPreview": null,
                        "topic": {
                          "name": "gta6",
                          "id": "18398838898065109",
                          "url": "https://www.threads.com/search?q=gta6&serp_type=tags&tag_id=18398838898065109"
                        },
                        "isReply": false,
                        "replyToUsername": null,
                        "isPinned": false,
                        "quotedPost": null,
                        "repostedPost": null
                      },
                      "parents": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/post-replies": {
      "post": {
        "operationId": "post-replies",
        "tags": [
          "Posts & replies"
        ],
        "summary": "Read the replies to a post",
        "description": "The replies to a Threads post, in the site’s own ranking (top) or newest first (recent), each with its exact counts. depth 1 or 2 also reads the first page of replies to the replies, for up to 25 replies per request. Up to 500 top-level replies, with nextCursor for more. 1 credit per 50 top-level replies returned, minimum 1.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "post": {
                    "type": "string",
                    "description": "A post: its link (https://www.threads.com/@zuck/post/DfihFPxkaZ1, threads.net too), its code (DfihFPxkaZ1) or its numeric id. Required unless cursor is given."
                  },
                  "sort": {
                    "type": "string",
                    "description": "top: the site’s own ranking. recent: newest first.",
                    "example": "top"
                  },
                  "depth": {
                    "type": "integer",
                    "description": "Also read replies to the replies, this many levels deep (0-2). With 1 or 2 the first page of each is read, for up to 25 replies per request; moreReplies marks a reply whose nested replies were not all read.",
                    "example": "0"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum top-level replies returned, 1-500. Each 50 returned is 1 credit, minimum 1.",
                    "example": "50"
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Continue from a previous response’s nextCursor, passed back unchanged with the same other parameters. The user or post is not needed alongside it."
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged listing returns what it has with nextCursor and a note, billed for what it returned; a request with nothing to return yet fails with a retryable 503. We answer at the latest about 2 seconds before timeoutMs runs out (15% of it, at least 0.75 s, for limits under 13 seconds). Send timeoutMs equal to your own client’s timeout: then we can answer in time, fast, instead of your client dropping the connection while the request is still running."
                  }
                },
                "additionalProperties": false
              },
              "examples": {
                "default": {
                  "value": {
                    "post": "DgA_nk4kiBd",
                    "sort": "top",
                    "limit": 3
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"threads\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on, such as \"one page of results\" or a listing that stopped early. Empty when there are none. An empty result always comes with a note explaining it."
                    },
                    "post": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "The post the replies belong to: { id, code, url }."
                    },
                    "sort": {
                      "type": "string",
                      "description": "The order the replies came back in."
                    },
                    "replyCount": {
                      "type": "number",
                      "description": "How many top-level replies are in this response."
                    },
                    "replies": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "post": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "The reply, in the post shape.",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "The post’s numeric id."
                              },
                              "code": {
                                "type": "string",
                                "description": "The post’s short code, as in its link. post-detail and post-replies accept it."
                              },
                              "url": {
                                "type": "string",
                                "description": "Link to the post."
                              },
                              "author": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "description": "The account’s numeric id."
                                  },
                                  "username": {
                                    "type": "string",
                                    "description": "The username, without @. Every tool that takes user accepts it."
                                  },
                                  "fullName": {
                                    "type": [
                                      "string",
                                      "null"
                                    ],
                                    "description": "The display name."
                                  },
                                  "isVerified": {
                                    "type": "boolean",
                                    "description": "Whether the account shows a verification badge."
                                  },
                                  "isPrivate": {
                                    "type": [
                                      "boolean",
                                      "null"
                                    ],
                                    "description": "Whether the account is private. A private account’s posts are not returned."
                                  },
                                  "profilePicUrl": {
                                    "type": [
                                      "string",
                                      "null"
                                    ],
                                    "description": "Profile picture. Expires after a few days like every media link."
                                  },
                                  "url": {
                                    "type": "string",
                                    "description": "Link to the profile."
                                  }
                                },
                                "additionalProperties": true
                              },
                              "text": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "The post’s text. null for a post that is only media."
                              },
                              "entities": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "additionalProperties": true
                                },
                                "description": "What the text mentions, in order: { type: \"mention\", text, username }, { type: \"link\", text, url } and { type: \"tag\", text, topic }."
                              },
                              "createdAt": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "When it was posted (ISO 8601, UTC)."
                              },
                              "likeCount": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Likes. An exact count."
                              },
                              "replyCount": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Replies. An exact count."
                              },
                              "repostCount": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Reposts. An exact count; the accounts that reposted are not available."
                              },
                              "quoteCount": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Quotes. An exact count; the quotes themselves are not available."
                              },
                              "shareCount": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Shares. An exact count."
                              },
                              "mediaType": {
                                "type": "string",
                                "description": "text, image, video, carousel, audio or other."
                              },
                              "media": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "additionalProperties": true
                                },
                                "description": "Images and videos, in order: { type (image or video), url (the image, or a video’s poster), videoUrl, width, height, altText }. The links expire after a few days; read the post again for fresh ones, or download through /media."
                              },
                              "linkPreview": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "additionalProperties": true,
                                "description": "A link card on the post: { url, displayUrl, title, imageUrl }."
                              },
                              "topic": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "additionalProperties": true,
                                "description": "The topic tag shown above the post: { name, id, url }. Pass id as topicId to topic-posts."
                              },
                              "isReply": {
                                "type": "boolean",
                                "description": "Whether the post is a reply."
                              },
                              "replyToUsername": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "For a reply, the account it answers."
                              },
                              "isPinned": {
                                "type": "boolean",
                                "description": "Whether the author pinned it to their profile."
                              },
                              "quotedPost": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "additionalProperties": true,
                                "description": "The post this one quotes, in the same shape, one level deep."
                              },
                              "repostedPost": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "additionalProperties": true,
                                "description": "On a repost, the original post, in the same shape, one level deep."
                              }
                            }
                          },
                          "replies": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "With depth 1 or 2: the nested replies read, in the same shape. Empty otherwise."
                          },
                          "moreReplies": {
                            "type": "boolean",
                            "description": "True when this reply has nested replies that were not all read."
                          }
                        }
                      },
                      "description": "The replies. Each is { post, replies, moreReplies }."
                    },
                    "hasMore": {
                      "type": "boolean",
                      "description": "Whether more replies exist beyond what was returned."
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "An opaque token to pass back unchanged as cursor, with the same other parameters, to continue where this response stopped. null when there is nothing further."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "threads",
                      "notes": [],
                      "post": {
                        "id": "4035505062717562973",
                        "code": "DgA_nk4kiBd",
                        "url": "https://www.threads.com/t/DgA_nk4kiBd"
                      },
                      "sort": "top",
                      "replyCount": 3,
                      "replies": [
                        {
                          "post": {
                            "id": "4035520738811282207",
                            "code": "DgBDLsYkYMf",
                            "url": "https://www.threads.com/@behn7m/post/DgBDLsYkYMf",
                            "author": {
                              "id": "63050397774",
                              "username": "behn7m",
                              "fullName": "به نام",
                              "isVerified": false,
                              "isPrivate": false,
                              "profilePicUrl": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-19/910055162_17996926815101775_6693512329989776…",
                              "url": "https://www.threads.com/@behn7m"
                            },
                            "text": "▓▓▓",
                            "entities": [],
                            "createdAt": "2026-11-21T20:06:21.000Z",
                            "likeCount": 2356,
                            "replyCount": 2,
                            "repostCount": 0,
                            "quoteCount": 0,
                            "shareCount": 1,
                            "mediaType": "text",
                            "media": [],
                            "linkPreview": null,
                            "topic": null,
                            "isReply": true,
                            "replyToUsername": "zuck",
                            "isPinned": false,
                            "quotedPost": null,
                            "repostedPost": null
                          },
                          "replies": [],
                          "moreReplies": true
                        }
                      ],
                      "nextCursor": null,
                      "hasMore": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/user-profile": {
      "post": {
        "operationId": "user-profile",
        "tags": [
          "Accounts"
        ],
        "summary": "Get an account’s profile",
        "description": "A public Threads account’s profile: name, bio and its links, the exact follower count, the linked Instagram account’s follower and following counts when public, verification, and the topics the account posts in. Follower and following lists are not available, only counts. 1 credit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "An account: its username (with or without @), its numeric id or its profile link (https://www.threads.com/@zuck)."
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged listing returns what it has with nextCursor and a note, billed for what it returned; a request with nothing to return yet fails with a retryable 503. We answer at the latest about 2 seconds before timeoutMs runs out (15% of it, at least 0.75 s, for limits under 13 seconds). Send timeoutMs equal to your own client’s timeout: then we can answer in time, fast, instead of your client dropping the connection while the request is still running."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "user"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "user": "zuck"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"threads\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on, such as \"one page of results\" or a listing that stopped early. Empty when there are none. An empty result always comes with a note explaining it."
                    },
                    "profile": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "The account. A username that does not exist is a 404.",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "The account’s numeric id."
                        },
                        "username": {
                          "type": "string",
                          "description": "The username, without @. Every tool that takes user accepts it."
                        },
                        "fullName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The display name."
                        },
                        "isVerified": {
                          "type": "boolean",
                          "description": "Whether the account shows a verification badge."
                        },
                        "isPrivate": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "Whether the account is private. A private account’s posts are not returned."
                        },
                        "profilePicUrl": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Profile picture. Expires after a few days like every media link."
                        },
                        "url": {
                          "type": "string",
                          "description": "Link to the profile."
                        },
                        "biography": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The bio text."
                        },
                        "bioLinks": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "description": "Links in the bio: { url, title }."
                        },
                        "followerCount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Followers, exact. The list of followers is not available."
                        },
                        "instagramFollowerCount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Followers of the linked Instagram account, when it is public and linked."
                        },
                        "instagramFollowingCount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Accounts the linked Instagram account follows, when public and linked."
                        },
                        "profilePicUrlHd": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "A larger profile picture. Expires like every media link."
                        },
                        "topics": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "description": "The topics the account posts in: { name, id, url }."
                        }
                      }
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "threads",
                      "notes": [],
                      "profile": {
                        "id": "63055343223",
                        "username": "zuck",
                        "fullName": "Mark Zuckerberg",
                        "isVerified": true,
                        "isPrivate": false,
                        "profilePicUrl": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107…",
                        "url": "https://www.threads.com/@zuck",
                        "biography": "Mostly superintelligence and MMA takes",
                        "bioLinks": [],
                        "followerCount": 5782937,
                        "instagramFollowerCount": 17300148,
                        "instagramFollowingCount": 627,
                        "profilePicUrlHd": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107…",
                        "topics": [
                          {
                            "name": "aithreads",
                            "id": "18399895213044171",
                            "url": "https://www.threads.com/search?q=aithreads&serp_type=tags&tag_id=18399895213044171"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/user-threads": {
      "post": {
        "operationId": "user-threads",
        "tags": [
          "Accounts"
        ],
        "summary": "List an account’s posts",
        "description": "An account’s posts, newest first, in four tabs: threads (its own posts), replies (its replies, each with the posts it answers), media (posts with images or video) and reposts (its most recent reposts only, in one list with no further pages). Each entry is { post, parents, continuation }. Up to 300 entries a request, 15 per read, with nextCursor for more. 1 credit per 30 entries returned, minimum 1.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "An account: its username (with or without @), its numeric id or its profile link (https://www.threads.com/@zuck). Required unless cursor is given."
                  },
                  "tab": {
                    "type": "string",
                    "description": "threads: the account’s own posts. replies: its replies, with the posts they answer in parents. media: posts with images or video. reposts: its most recent reposts, in one list; the original is in post.repostedPost.",
                    "example": "threads"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum entries returned, 1-300. Each 30 returned is 1 credit, minimum 1.",
                    "example": "30"
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Continue from a previous response’s nextCursor, passed back unchanged with the same other parameters. The user or post is not needed alongside it."
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged listing returns what it has with nextCursor and a note, billed for what it returned; a request with nothing to return yet fails with a retryable 503. We answer at the latest about 2 seconds before timeoutMs runs out (15% of it, at least 0.75 s, for limits under 13 seconds). Send timeoutMs equal to your own client’s timeout: then we can answer in time, fast, instead of your client dropping the connection while the request is still running."
                  }
                },
                "additionalProperties": false
              },
              "examples": {
                "default": {
                  "value": {
                    "user": "zuck",
                    "tab": "threads",
                    "limit": 3
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"threads\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on, such as \"one page of results\" or a listing that stopped early. Empty when there are none. An empty result always comes with a note explaining it."
                    },
                    "user": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "The account: { id, username }."
                    },
                    "tab": {
                      "type": "string",
                      "description": "The tab that was read."
                    },
                    "entryCount": {
                      "type": "number",
                      "description": "How many entries are in this response."
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "post": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "The account’s post; on the replies tab, its reply.",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "The post’s numeric id."
                              },
                              "code": {
                                "type": "string",
                                "description": "The post’s short code, as in its link. post-detail and post-replies accept it."
                              },
                              "url": {
                                "type": "string",
                                "description": "Link to the post."
                              },
                              "author": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "description": "The account’s numeric id."
                                  },
                                  "username": {
                                    "type": "string",
                                    "description": "The username, without @. Every tool that takes user accepts it."
                                  },
                                  "fullName": {
                                    "type": [
                                      "string",
                                      "null"
                                    ],
                                    "description": "The display name."
                                  },
                                  "isVerified": {
                                    "type": "boolean",
                                    "description": "Whether the account shows a verification badge."
                                  },
                                  "isPrivate": {
                                    "type": [
                                      "boolean",
                                      "null"
                                    ],
                                    "description": "Whether the account is private. A private account’s posts are not returned."
                                  },
                                  "profilePicUrl": {
                                    "type": [
                                      "string",
                                      "null"
                                    ],
                                    "description": "Profile picture. Expires after a few days like every media link."
                                  },
                                  "url": {
                                    "type": "string",
                                    "description": "Link to the profile."
                                  }
                                },
                                "additionalProperties": true
                              },
                              "text": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "The post’s text. null for a post that is only media."
                              },
                              "entities": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "additionalProperties": true
                                },
                                "description": "What the text mentions, in order: { type: \"mention\", text, username }, { type: \"link\", text, url } and { type: \"tag\", text, topic }."
                              },
                              "createdAt": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "When it was posted (ISO 8601, UTC)."
                              },
                              "likeCount": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Likes. An exact count."
                              },
                              "replyCount": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Replies. An exact count."
                              },
                              "repostCount": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Reposts. An exact count; the accounts that reposted are not available."
                              },
                              "quoteCount": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Quotes. An exact count; the quotes themselves are not available."
                              },
                              "shareCount": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Shares. An exact count."
                              },
                              "mediaType": {
                                "type": "string",
                                "description": "text, image, video, carousel, audio or other."
                              },
                              "media": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "additionalProperties": true
                                },
                                "description": "Images and videos, in order: { type (image or video), url (the image, or a video’s poster), videoUrl, width, height, altText }. The links expire after a few days; read the post again for fresh ones, or download through /media."
                              },
                              "linkPreview": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "additionalProperties": true,
                                "description": "A link card on the post: { url, displayUrl, title, imageUrl }."
                              },
                              "topic": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "additionalProperties": true,
                                "description": "The topic tag shown above the post: { name, id, url }. Pass id as topicId to topic-posts."
                              },
                              "isReply": {
                                "type": "boolean",
                                "description": "Whether the post is a reply."
                              },
                              "replyToUsername": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "For a reply, the account it answers."
                              },
                              "isPinned": {
                                "type": "boolean",
                                "description": "Whether the author pinned it to their profile."
                              },
                              "quotedPost": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "additionalProperties": true,
                                "description": "The post this one quotes, in the same shape, one level deep."
                              },
                              "repostedPost": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "additionalProperties": true,
                                "description": "On a repost, the original post, in the same shape, one level deep."
                              }
                            }
                          },
                          "parents": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "On the replies tab, the posts the reply answers, oldest first, in the post shape."
                          },
                          "continuation": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "The rest of a multi-part thread by the same author, in the post shape."
                          }
                        }
                      },
                      "description": "The entries, newest first. Each is { post, parents, continuation }."
                    },
                    "hasMore": {
                      "type": "boolean",
                      "description": "Whether more entries exist beyond what was returned."
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "An opaque token to pass back unchanged as cursor, with the same other parameters, to continue where this response stopped. null when there is nothing further."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "threads",
                      "notes": [],
                      "user": {
                        "id": "63055343223",
                        "username": "zuck"
                      },
                      "tab": "threads",
                      "entryCount": 3,
                      "entries": [
                        {
                          "post": {
                            "id": "4035505062717562973",
                            "code": "DgA_nk4kiBd",
                            "url": "https://www.threads.com/@zuck/post/DgA_nk4kiBd",
                            "author": {
                              "id": "63055343223",
                              "username": "zuck",
                              "fullName": "Mark Zuckerberg",
                              "isVerified": true,
                              "isPrivate": false,
                              "profilePicUrl": "https://scontent-mxp2-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107…",
                              "url": "https://www.threads.com/@zuck"
                            },
                            "text": "Top things I did today:\n1. Fixed roof\n2. Installed drywall\n3. Jet skied with a dog\n4. Pet Arugula",
                            "entities": [],
                            "createdAt": "2026-11-21T19:35:13.000Z",
                            "likeCount": 59632,
                            "replyCount": 427,
                            "repostCount": 549,
                            "quoteCount": 37,
                            "shareCount": 186,
                            "mediaType": "text",
                            "media": [],
                            "linkPreview": null,
                            "topic": {
                              "name": "gta6",
                              "id": "18398838898065109",
                              "url": "https://www.threads.com/search?q=gta6&serp_type=tags&tag_id=18398838898065109"
                            },
                            "isReply": false,
                            "replyToUsername": null,
                            "isPinned": false,
                            "quotedPost": null,
                            "repostedPost": null
                          },
                          "parents": [],
                          "continuation": []
                        }
                      ],
                      "nextCursor": "eyJ2IjoxLCJrIjoidXNlciIsInUiOiI2MzA1NTM0MzIyMyIsInQiOiJ0aHJlYWRzIiwiYyI6IkFRSFRvT0NNRnd6ZTNoRmtBRGVWTjl4ZDVxeEVRamcyWjd3cUl4T2s2czBvZERrOHhnRDVucEZLUWtIS2p3THdHVUs2V01OMkhPbmprT18zRjhLd3pDZVBVUSJ9",
                      "hasMore": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/search-posts": {
      "post": {
        "operationId": "search-posts",
        "tags": [
          "Search & trending"
        ],
        "summary": "Search posts",
        "description": "Search Threads posts for words: one page only, with no further pages. About 20 posts for sort top, about 6 for sort recent. Each post carries exact counts. 1 credit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Words to search posts for."
                  },
                  "sort": {
                    "type": "string",
                    "description": "top: the site’s own ranking, about 20 posts. recent: newest first, about 6 posts.",
                    "example": "top"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum posts returned, 1-30. Threads shows one page, so fewer can come back.",
                    "example": "20"
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged listing returns what it has with nextCursor and a note, billed for what it returned; a request with nothing to return yet fails with a retryable 503. We answer at the latest about 2 seconds before timeoutMs runs out (15% of it, at least 0.75 s, for limits under 13 seconds). Send timeoutMs equal to your own client’s timeout: then we can answer in time, fast, instead of your client dropping the connection while the request is still running."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "query"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "query": "openai",
                    "sort": "top",
                    "limit": 3
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"threads\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on, such as \"one page of results\" or a listing that stopped early. Empty when there are none. An empty result always comes with a note explaining it."
                    },
                    "query": {
                      "type": "string",
                      "description": "The search words."
                    },
                    "sort": {
                      "type": "string",
                      "description": "The order used."
                    },
                    "postCount": {
                      "type": "number",
                      "description": "How many posts are in this response."
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The post’s numeric id."
                          },
                          "code": {
                            "type": "string",
                            "description": "The post’s short code, as in its link. post-detail and post-replies accept it."
                          },
                          "url": {
                            "type": "string",
                            "description": "Link to the post."
                          },
                          "author": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "The account’s numeric id."
                              },
                              "username": {
                                "type": "string",
                                "description": "The username, without @. Every tool that takes user accepts it."
                              },
                              "fullName": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "The display name."
                              },
                              "isVerified": {
                                "type": "boolean",
                                "description": "Whether the account shows a verification badge."
                              },
                              "isPrivate": {
                                "type": [
                                  "boolean",
                                  "null"
                                ],
                                "description": "Whether the account is private. A private account’s posts are not returned."
                              },
                              "profilePicUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Profile picture. Expires after a few days like every media link."
                              },
                              "url": {
                                "type": "string",
                                "description": "Link to the profile."
                              }
                            },
                            "additionalProperties": true
                          },
                          "text": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The post’s text. null for a post that is only media."
                          },
                          "entities": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "What the text mentions, in order: { type: \"mention\", text, username }, { type: \"link\", text, url } and { type: \"tag\", text, topic }."
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When it was posted (ISO 8601, UTC)."
                          },
                          "likeCount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Likes. An exact count."
                          },
                          "replyCount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Replies. An exact count."
                          },
                          "repostCount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Reposts. An exact count; the accounts that reposted are not available."
                          },
                          "quoteCount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Quotes. An exact count; the quotes themselves are not available."
                          },
                          "shareCount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Shares. An exact count."
                          },
                          "mediaType": {
                            "type": "string",
                            "description": "text, image, video, carousel, audio or other."
                          },
                          "media": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "Images and videos, in order: { type (image or video), url (the image, or a video’s poster), videoUrl, width, height, altText }. The links expire after a few days; read the post again for fresh ones, or download through /media."
                          },
                          "linkPreview": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "A link card on the post: { url, displayUrl, title, imageUrl }."
                          },
                          "topic": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "The topic tag shown above the post: { name, id, url }. Pass id as topicId to topic-posts."
                          },
                          "isReply": {
                            "type": "boolean",
                            "description": "Whether the post is a reply."
                          },
                          "replyToUsername": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "For a reply, the account it answers."
                          },
                          "isPinned": {
                            "type": "boolean",
                            "description": "Whether the author pinned it to their profile."
                          },
                          "quotedPost": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "The post this one quotes, in the same shape, one level deep."
                          },
                          "repostedPost": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "On a repost, the original post, in the same shape, one level deep."
                          }
                        }
                      },
                      "description": "The posts, in the post shape. There is no further page: a notes entry says so."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "threads",
                      "notes": [
                        "Search returns one page of results: up to about 20 posts for top, fewer for recent."
                      ],
                      "query": "openai",
                      "sort": "top",
                      "postCount": 3,
                      "posts": [
                        {
                          "id": "4019628605428007691",
                          "code": "DfIlutziQML",
                          "url": "https://www.threads.com/@darren_fm/post/DfIlutziQML",
                          "author": {
                            "id": "63060094583",
                            "username": "darren_fm",
                            "fullName": "Darren Worts™",
                            "isVerified": false,
                            "isPrivate": false,
                            "profilePicUrl": "https://scontent-sea5-1.cdninstagram.com/v/t51.2885-19/462764088_3569869276637314_568486819098625667…",
                            "url": "https://www.threads.com/@darren_fm"
                          },
                          "text": "Sam Altman (OpenAI) thinks people having RAM in their personal computers is a waste when it could just be serving Data Centers instead.\n\nWeird, I was just thinking that all those billions of dollar…",
                          "entities": [],
                          "createdAt": "2026-10-30T21:51:32.000Z",
                          "likeCount": 16052,
                          "replyCount": 129,
                          "repostCount": 1346,
                          "quoteCount": 57,
                          "shareCount": 108,
                          "mediaType": "text",
                          "media": [],
                          "linkPreview": null,
                          "topic": null,
                          "isReply": false,
                          "replyToUsername": null,
                          "isPinned": false,
                          "quotedPost": null,
                          "repostedPost": null
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/search-users": {
      "post": {
        "operationId": "search-users",
        "tags": [
          "Search & trending"
        ],
        "summary": "Search accounts",
        "description": "Find Threads accounts by name or username: the closest matches, one page only, with no further pages (about 10). 1 credit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "A name or username to look up."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum accounts returned, 1-30. Threads shows one page, so fewer can come back.",
                    "example": "10"
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged listing returns what it has with nextCursor and a note, billed for what it returned; a request with nothing to return yet fails with a retryable 503. We answer at the latest about 2 seconds before timeoutMs runs out (15% of it, at least 0.75 s, for limits under 13 seconds). Send timeoutMs equal to your own client’s timeout: then we can answer in time, fast, instead of your client dropping the connection while the request is still running."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "query"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "query": "nasa",
                    "limit": 3
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"threads\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on, such as \"one page of results\" or a listing that stopped early. Empty when there are none. An empty result always comes with a note explaining it."
                    },
                    "query": {
                      "type": "string",
                      "description": "The search words."
                    },
                    "userCount": {
                      "type": "number",
                      "description": "How many accounts are in this response."
                    },
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The account’s numeric id."
                          },
                          "username": {
                            "type": "string",
                            "description": "The username, without @. Every tool that takes user accepts it."
                          },
                          "fullName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The display name."
                          },
                          "isVerified": {
                            "type": "boolean",
                            "description": "Whether the account shows a verification badge."
                          },
                          "isPrivate": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "Whether the account is private. A private account’s posts are not returned."
                          },
                          "profilePicUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Profile picture. Expires after a few days like every media link."
                          },
                          "url": {
                            "type": "string",
                            "description": "Link to the profile."
                          },
                          "isActiveOnThreads": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "Whether the account is active on Threads, as opposed to only holding the username."
                          }
                        }
                      },
                      "description": "The accounts, closest match first."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "threads",
                      "notes": [
                        "Account search returns one page of the closest matches (about 10)."
                      ],
                      "query": "nasa",
                      "userCount": 3,
                      "users": [
                        {
                          "id": "28829152388",
                          "username": "nasa",
                          "fullName": "NASA",
                          "isVerified": true,
                          "isPrivate": null,
                          "profilePicUrl": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-19/669747085_18089786557960389_9220726220693516…",
                          "url": "https://www.threads.com/@nasa",
                          "isActiveOnThreads": true
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/topic-posts": {
      "post": {
        "operationId": "topic-posts",
        "tags": [
          "Search & trending"
        ],
        "summary": "Read the posts under a topic",
        "description": "Posts filed under a Threads topic (the tag shown above a post): one page only, with no further pages, about 10 posts. Pass topicId, returned with every topic, to pin the exact topic. 1 credit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "topic": {
                    "type": "string",
                    "description": "The topic’s name, as shown on a post or a profile (for example gta6 or Baking Threads)."
                  },
                  "topicId": {
                    "type": "string",
                    "description": "The topic’s numeric id, when known (returned with every topic: on a post, a profile and a topic response); narrows the results to exactly that topic. Digits only."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum posts returned, 1-30. Threads shows one page, so fewer can come back.",
                    "example": "20"
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged listing returns what it has with nextCursor and a note, billed for what it returned; a request with nothing to return yet fails with a retryable 503. We answer at the latest about 2 seconds before timeoutMs runs out (15% of it, at least 0.75 s, for limits under 13 seconds). Send timeoutMs equal to your own client’s timeout: then we can answer in time, fast, instead of your client dropping the connection while the request is still running."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "topic"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "topic": "gta6",
                    "limit": 3
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"threads\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on, such as \"one page of results\" or a listing that stopped early. Empty when there are none. An empty result always comes with a note explaining it."
                    },
                    "topic": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "The topic: { name, id, url }. id is null when the request did not pin one with topicId and Threads did not name it."
                    },
                    "postCount": {
                      "type": "number",
                      "description": "How many posts are in this response."
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The post’s numeric id."
                          },
                          "code": {
                            "type": "string",
                            "description": "The post’s short code, as in its link. post-detail and post-replies accept it."
                          },
                          "url": {
                            "type": "string",
                            "description": "Link to the post."
                          },
                          "author": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "The account’s numeric id."
                              },
                              "username": {
                                "type": "string",
                                "description": "The username, without @. Every tool that takes user accepts it."
                              },
                              "fullName": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "The display name."
                              },
                              "isVerified": {
                                "type": "boolean",
                                "description": "Whether the account shows a verification badge."
                              },
                              "isPrivate": {
                                "type": [
                                  "boolean",
                                  "null"
                                ],
                                "description": "Whether the account is private. A private account’s posts are not returned."
                              },
                              "profilePicUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Profile picture. Expires after a few days like every media link."
                              },
                              "url": {
                                "type": "string",
                                "description": "Link to the profile."
                              }
                            },
                            "additionalProperties": true
                          },
                          "text": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The post’s text. null for a post that is only media."
                          },
                          "entities": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "What the text mentions, in order: { type: \"mention\", text, username }, { type: \"link\", text, url } and { type: \"tag\", text, topic }."
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When it was posted (ISO 8601, UTC)."
                          },
                          "likeCount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Likes. An exact count."
                          },
                          "replyCount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Replies. An exact count."
                          },
                          "repostCount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Reposts. An exact count; the accounts that reposted are not available."
                          },
                          "quoteCount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Quotes. An exact count; the quotes themselves are not available."
                          },
                          "shareCount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Shares. An exact count."
                          },
                          "mediaType": {
                            "type": "string",
                            "description": "text, image, video, carousel, audio or other."
                          },
                          "media": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "Images and videos, in order: { type (image or video), url (the image, or a video’s poster), videoUrl, width, height, altText }. The links expire after a few days; read the post again for fresh ones, or download through /media."
                          },
                          "linkPreview": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "A link card on the post: { url, displayUrl, title, imageUrl }."
                          },
                          "topic": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "The topic tag shown above the post: { name, id, url }. Pass id as topicId to topic-posts."
                          },
                          "isReply": {
                            "type": "boolean",
                            "description": "Whether the post is a reply."
                          },
                          "replyToUsername": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "For a reply, the account it answers."
                          },
                          "isPinned": {
                            "type": "boolean",
                            "description": "Whether the author pinned it to their profile."
                          },
                          "quotedPost": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "The post this one quotes, in the same shape, one level deep."
                          },
                          "repostedPost": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "On a repost, the original post, in the same shape, one level deep."
                          }
                        }
                      },
                      "description": "The posts, in the post shape."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "threads",
                      "notes": [
                        "Topic pages return one page of posts (about 10)."
                      ],
                      "topic": {
                        "name": "gta6",
                        "id": null,
                        "url": "https://www.threads.com/search?q=gta6&serp_type=tags"
                      },
                      "postCount": 3,
                      "posts": [
                        {
                          "id": "4037040702714149359",
                          "code": "DgGcyFFEfnv",
                          "url": "https://www.threads.com/@meettheskrimps/post/DgGcyFFEfnv",
                          "author": {
                            "id": "63312627788",
                            "username": "meettheskrimps",
                            "fullName": "Meet the Skrimps",
                            "isVerified": true,
                            "isPrivate": false,
                            "profilePicUrl": "https://scontent-lax3-1.cdninstagram.com/v/t51.82787-19/531196224_17921171949109742_3030187237304853…",
                            "url": "https://www.threads.com/@meettheskrimps"
                          },
                          "text": "Grand Theft America.\n\nThe most realistic open-world crime game ever made. No cheat codes. No respawns.\n\nRated M for Maladministration.\n\nNext drop 12.7.2026\n\n#GTA6 #GrandTheftAuto #GTAVI #Skrimp Mee…",
                          "entities": [],
                          "createdAt": "2026-11-23T22:26:18.000Z",
                          "likeCount": 10,
                          "replyCount": 0,
                          "repostCount": 0,
                          "quoteCount": 0,
                          "shareCount": 1,
                          "mediaType": "video",
                          "media": [
                            {
                              "type": "video",
                              "url": "https://scontent-lax3-2.cdninstagram.com/v/t51.71878-15/922900381_1453646419636779_51149405203460122…",
                              "videoUrl": "https://scontent-lax3-2.cdninstagram.com/o1/v/t2/f2/m86/AQMdiLitSmryTN8YUCrvnmNaCIqZhaYOCN1lXuOkNEVP…",
                              "width": 640,
                              "height": 356,
                              "altText": null
                            }
                          ],
                          "linkPreview": null,
                          "topic": null,
                          "isReply": false,
                          "replyToUsername": null,
                          "isPinned": false,
                          "quotedPost": null,
                          "repostedPost": null
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/trending-topics": {
      "post": {
        "operationId": "trending-topics",
        "tags": [
          "Search & trending"
        ],
        "summary": "See what is trending",
        "description": "What is trending on Threads right now, for the United States: each topic with the search phrase behind it and a one-line summary of the conversation. Up to 20 topics. 1 credit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "limit": {
                    "type": "integer",
                    "description": "Maximum topics returned, 1-20.",
                    "example": "10"
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged listing returns what it has with nextCursor and a note, billed for what it returned; a request with nothing to return yet fails with a retryable 503. We answer at the latest about 2 seconds before timeoutMs runs out (15% of it, at least 0.75 s, for limits under 13 seconds). Send timeoutMs equal to your own client’s timeout: then we can answer in time, fast, instead of your client dropping the connection while the request is still running."
                  }
                },
                "additionalProperties": false
              },
              "examples": {
                "default": {
                  "value": {
                    "limit": 3
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"threads\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on, such as \"one page of results\" or a listing that stopped early. Empty when there are none. An empty result always comes with a note explaining it."
                    },
                    "topicCount": {
                      "type": "number",
                      "description": "How many topics are in this response."
                    },
                    "topics": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The topic’s id."
                          },
                          "query": {
                            "type": "string",
                            "description": "The search phrase; pass it to search-posts to read the posts behind it."
                          },
                          "title": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The topic’s title; often null, in which case query names it."
                          },
                          "summary": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "One line on the conversation."
                          },
                          "url": {
                            "type": "string",
                            "description": "Link to the topic."
                          }
                        }
                      },
                      "description": "The trending topics."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "threads",
                      "notes": [
                        "Trending topics reflect the United States and change through the day."
                      ],
                      "topicCount": 3,
                      "topics": [
                        {
                          "id": "1122571380394508",
                          "query": "Gilded Age",
                          "title": null,
                          "summary": "Fans follow Marian and Ada storylines in season four of HBO's The Gilded Age",
                          "url": "https://www.threads.com/search?q=Gilded+Age&serp_type=trends&trend_fbid=1122571380394508"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/resolve-url": {
      "post": {
        "operationId": "resolve-url",
        "tags": [
          "Utilities"
        ],
        "summary": "Parse a Threads link",
        "description": "Whether a threads.com or threads.net address is a post, a profile, a profile tab, a topic, a search, the trending page or the home page, with the ids it carries and the route and arguments that read it. Fetches nothing and costs no credit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Any threads.com or threads.net address."
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown.",
                    "example": "json"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "url"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "url": "https://www.threads.net/@zuck/post/DfihFPxkaZ1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"threads\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "What to do with a link that is not one of the above."
                    },
                    "kind": {
                      "type": "string",
                      "description": "post, profile, profile_tab, topic, search, trending or home."
                    },
                    "url": {
                      "type": "string",
                      "description": "The canonical address."
                    },
                    "username": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The account, for a post, profile or profile-tab link."
                    },
                    "postCode": {
                      "type": "string",
                      "description": "The post’s code, for a post link."
                    },
                    "postId": {
                      "type": "string",
                      "description": "The post’s numeric id, when the link carries it."
                    },
                    "tab": {
                      "type": "string",
                      "description": "The tab, for a profile-tab link."
                    },
                    "topic": {
                      "type": "string",
                      "description": "The topic name, for a topic link."
                    },
                    "topicId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The topic id, when the link carries it."
                    },
                    "query": {
                      "type": "string",
                      "description": "The search words, for a search link."
                    },
                    "tool": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The tool that reads this link, such as threads_post_detail; null when none does."
                    },
                    "arguments": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "The arguments to give that tool."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "threads",
                      "notes": [],
                      "kind": "post",
                      "url": "https://www.threads.com/@zuck/post/DfihFPxkaZ1",
                      "username": "zuck",
                      "postCode": "DfihFPxkaZ1",
                      "postId": "4026926512892651125",
                      "tool": "threads_post_detail",
                      "arguments": {
                        "post": "DfihFPxkaZ1"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/media": {
      "get": {
        "operationId": "media",
        "tags": [
          "Utilities"
        ],
        "summary": "Download an image or video",
        "description": "Delivers one image or video from a result, by the link the result gave. Supports Range requests so players can seek and downloads can resume. The links in a result expire after a few days: an expired link is a 404, and reading the post again returns a fresh one. Each request costs 1 credit, a range request included.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "An image or video link as a result gave it (media[].url or media[].videoUrl, or a profile picture). Only Threads media links; anything else is a 400. A link that has expired is a 404: read the post again for a fresh one.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    }
  }
}