Skip to main content
Generate a Twitter intent URL for a single market prediction. This enables you to build custom UIs that open Twitter with pre-filled prediction tweets.

How It Works

When users click your custom prediction buttons:
  1. Twitter opens with a pre-composed prediction tweet
  2. User posts the tweet
  3. Our Twitter bot (@kash_bot) detects and processes the prediction
  4. User is automatically onboarded if they don’t have an account
No wallet connection or login required! Everything happens via Twitter.

Endpoint

GET https://app.kash.bot/api/markets/{id}/twitter-link

Path Parameters

id
string
required
The market ID

Query Parameters

side
string
required
Prediction side: yes or no
amount
number
required
Prediction amount in USD (1-10000)

Response

twitterUrl
string
Full Twitter intent URL ready to open
tweetContent
string
The pre-filled tweet content
market
object
Market information

Rate Limit

100 requests per minute per IP address

Example Request

curl "https://app.kash.bot/api/markets/abc123/twitter-link?side=yes&amount=25"

Example Response

200 - Success
{
  "twitterUrl": "https://twitter.com/intent/tweet?text=%40kash_bot%20%2425%20on%20Yes%20https%3A%2F%2Ftwitter.com%2Fkash_bot%2Fstatus%2F123...",
  "tweetContent": "@kash_bot $25 on Yes https://twitter.com/kash_bot/status/123...",
  "market": {
    "id": "abc123",
    "question": "Will BTC hit $100k by end of 2025?",
    "sourceTweetUrl": "https://twitter.com/kash_bot/status/123..."
  }
}
400 - Invalid Parameters
{
  "error": "Invalid or missing side parameter",
  "message": "side must be 'yes' or 'no'",
  "code": "INVALID_SIDE"
}
404 - Market Not Found
{
  "error": "Market not found",
  "message": "No market found with id: xyz789",
  "code": "MARKET_NOT_FOUND"
}

Custom UI Example

Build your own prediction buttons:
<button id="yes-btn">Predict Yes ($25)</button>
<button id="no-btn">Predict No ($25)</button>

<script>
  const MARKET_ID = 'your-market-id';
  const AMOUNT = 25;

  async function loadMarketLinks() {
    const [yesRes, noRes] = await Promise.all([
      fetch(`https://app.kash.bot/api/markets/${MARKET_ID}/twitter-link?side=yes&amount=${AMOUNT}`),
      fetch(`https://app.kash.bot/api/markets/${MARKET_ID}/twitter-link?side=no&amount=${AMOUNT}`)
    ]);

    const yesData = await yesRes.json();
    const noData = await noRes.json();
    
    document.getElementById('yes-btn').onclick = () => window.open(yesData.twitterUrl, '_blank');
    document.getElementById('no-btn').onclick = () => window.open(noData.twitterUrl, '_blank');
  }

  loadMarketLinks();
</script>