VibeStarter uses session-based authentication with email/password login. All API endpoints require valid authentication except public data endpoints.
{
"email": "user@example.com",
"password": "your_secure_password"
}{
"startups": [
{
"id": 1,
"name": "TaskFlow Pro",
"tagline": "Next-gen productivity suite",
"description": "Revolutionary task management...",
"category": "Productivity",
"status": "active",
"current_users": 15420,
"monthly_downloads": 3200,
"total_downloads": 28540,
"creator_id": 42,
"created_at": "2024-01-15T10:30:00Z"
}
]
}{
"market": {
"id": 15,
"startup_id": 1,
"title": "TaskFlow Pro to reach 100K downloads",
"description": "Will TaskFlow Pro reach 100,000 total downloads by March 2024?",
"market_type": "downloads",
"target_value": 100000,
"end_date": "2024-03-31T23:59:59Z",
"resolved": false,
"total_yes_amount": "450.25",
"total_no_amount": "234.80",
"yes_price": 0.65,
"no_price": 0.35
}
}{
"amount": "0.5",
"wallet_address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"transaction_hash": "2ZE7Rt5x..."
}{
"market_id": 15,
"position": "yes",
"amount": "10.0"
}
// Response:
{
"shares": "15.384615",
"price_impact": "0.0234",
"current_price": "0.65",
"new_price": "0.6734",
"fees": "0.10"
}VibeStarter API uses conventional HTTP status codes and returns structured error responses.
{
"error": {
"code": "INSUFFICIENT_BALANCE",
"message": "Insufficient SOL balance",
"details": {
"required": "0.5",
"available": "0.25"
}
}
}// Fetch active prediction markets
const response = await fetch('https://yourdomain.com/api/markets');
const { markets } = await response.json();
// Place a prediction
const prediction = await fetch('https://yourdomain.com/api/predictions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Cookie': 'session=your_session_token'
},
body: JSON.stringify({
market_id: 15,
position: 'yes',
amount: '10.0'
})
});import requests
# Get user balance
response = requests.get(
'https://yourdomain.com/api/user/balance',
cookies={'session': 'your_session_token'}
)
balance_data = response.json()
# Create startup listing
startup_data = {
'name': 'My SaaS App',
'tagline': 'Revolutionary productivity tool',
'category': 'Productivity'
}
response = requests.post(
'https://yourdomain.com/api/startups',
json=startup_data,
cookies={'session': 'your_session_token'}
)import { useState, useEffect } from 'react';
const useMarkets = () => {
const [markets, setMarkets] = useState([]);
const [loading, setLoading] = useState(true);
useEffect(() => {
fetch('/api/markets')
.then(res => res.json())
.then(data => {
setMarkets(data.markets);
setLoading(false);
});
}, []);
return { markets, loading };
};