> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kash.bot/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /api/threads/:id/twitter-links

> Generate Twitter prediction URLs for all markets in a thread

Generate Twitter intent URLs for all active markets in a thread. Returns both YES and NO links for each market, making it easy to build custom thread UIs.

***

## Endpoint

```
GET https://app.kash.bot/api/threads/{id}/twitter-links
```

## Path Parameters

<ParamField path="id" type="string" required>
  The thread ID
</ParamField>

## Query Parameters

<ParamField query="amount" type="number" default="10">
  Default prediction amount in USD for all markets (1-10000)
</ParamField>

## Response

<ResponseField name="thread" type="object">
  Thread information

  <Expandable title="Thread Object">
    <ResponseField name="id" type="string">
      Thread ID
    </ResponseField>

    <ResponseField name="title" type="string">
      Thread title
    </ResponseField>

    <ResponseField name="description" type="string">
      Thread description
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="markets" type="array">
  Array of markets with Twitter links

  <Expandable title="Market Link Object">
    <ResponseField name="marketId" type="string">
      Market ID
    </ResponseField>

    <ResponseField name="question" type="string">
      Market question
    </ResponseField>

    <ResponseField name="sourceTweetUrl" type="string">
      Original market tweet URL
    </ResponseField>

    <ResponseField name="yesLink" type="string">
      Twitter URL for YES prediction
    </ResponseField>

    <ResponseField name="noLink" type="string">
      Twitter URL for NO prediction
    </ResponseField>

    <ResponseField name="yesTweetContent" type="string">
      Tweet content for YES prediction
    </ResponseField>

    <ResponseField name="noTweetContent" type="string">
      Tweet content for NO prediction
    </ResponseField>
  </Expandable>
</ResponseField>

## Rate Limit

<Info>
  **100 requests per minute** per IP address
</Info>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://app.kash.bot/api/threads/thread123/twitter-links?amount=25"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://app.kash.bot/api/threads/thread123/twitter-links?amount=25'
  );
  const data = await response.json();

  // Render buttons for each market
  data.markets.forEach(market => {
    console.log(`${market.question}`);
    console.log(`  Yes: ${market.yesLink}`);
    console.log(`  No: ${market.noLink}`);
  });
  ```
</CodeGroup>

## Example Response

```json 200 - Success theme={null}
{
  "thread": {
    "id": "thread123",
    "title": "2024 Election Predictions",
    "description": "Markets for the 2024 US Presidential Election"
  },
  "markets": [
    {
      "marketId": "market-1",
      "question": "Will Biden win the nomination?",
      "sourceTweetUrl": "https://twitter.com/kash_bot/status/123...",
      "yesLink": "https://twitter.com/intent/tweet?text=...",
      "noLink": "https://twitter.com/intent/tweet?text=...",
      "yesTweetContent": "@kash_bot $25 on Yes https://twitter.com/...",
      "noTweetContent": "@kash_bot $25 on No https://twitter.com/..."
    },
    {
      "marketId": "market-2",
      "question": "Will Trump be the Republican nominee?",
      "sourceTweetUrl": "https://twitter.com/kash_bot/status/456...",
      "yesLink": "https://twitter.com/intent/tweet?text=...",
      "noLink": "https://twitter.com/intent/tweet?text=...",
      "yesTweetContent": "@kash_bot $25 on Yes https://twitter.com/...",
      "noTweetContent": "@kash_bot $25 on No https://twitter.com/..."
    }
  ],
  "_meta": {
    "requestedAt": "2025-01-15T12:00:00Z",
    "amount": 25,
    "totalMarkets": 2
  }
}
```
