API Documentation
Overview
The Solshi API allows developers to programmatically access market data, place orders, and manage accounts. Our RESTful API provides a comprehensive interface for building applications on top of the Solshi platform.
Getting Started
Authentication
API access requires authentication using API keys. Generate your API key from the API Keys page.
Include your API key in the Authorization header of all requests:
Authorization: Bearer sk_live_your_api_key_here
Base URL
All API requests are made to: https://api.solshi.fun/api/v1
Try the API
Use the interactive playground below to test API endpoints directly from your browser.
/api/v1/marketsFilter by category slug
Maximum number of results
Number of results to skip
Sort order
API Endpoints
Markets
GET/api/v1/marketsList all markets
Query parameters:
categorySlug(optional) - Filter by category sluglimit(optional, default: 24) - Maximum number of resultsoffset(optional, default: 0) - Number of results to skipsort(optional, default: "trending") - Sort order: "trending" or "new"
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.solshi.fun/api/v1/markets?limit=10&sort=trending"
GET/api/v1/markets/:idGet market details by ID or slug
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.solshi.fun/api/v1/markets/1"
GET/api/v1/markets/:id/historyGet price history for a market
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.solshi.fun/api/v1/markets/1/history"
Orders
POST/api/v1/ordersPlace an order
Request body:
{
"marketId": 1,
"outcomeId": 2,
"amount": 100,
"direction": "buy"
}curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"marketId":1,"outcomeId":2,"amount":100,"direction":"buy"}' \
"https://api.solshi.fun/api/v1/orders"GET/api/v1/ordersList your orders
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.solshi.fun/api/v1/orders"
DELETE/api/v1/orders/:idCancel an order (not supported - orders execute immediately)
Account
GET/api/v1/accountGet account information
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.solshi.fun/api/v1/account"
GET/api/v1/account/positionsGet your positions across all markets
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.solshi.fun/api/v1/account/positions"
GET/api/v1/account/balanceGet account balance
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.solshi.fun/api/v1/account/balance"
Python SDK
View on GitHubWe provide a Python SDK to make it easy to interact with the Solshi API. Install it from GitHub:
pip install git+https://github.com/SolshiMarkets/solshi-python-sdk.git
Or install from source:
git clone https://github.com/SolshiMarkets/solshi-python-sdk.git cd solshi-python-sdk pip install -e .
Example usage:
from solshi import SolshiClient
# Initialize client
client = SolshiClient(api_key="sk_live_your_api_key_here")
# List markets
markets = client.markets.list(limit=10)
# Get market details
market = client.markets.get(market_id=1)
# Place an order
order = client.orders.place(
market_id=1,
outcome_id=2,
amount=100,
direction="buy"
)
# Get account info
account = client.account.get()
balance = client.account.get_balance()
positions = client.account.get_positions()For complete documentation, examples, and updates, visit the GitHub repository.
Rate Limits
API requests are subject to rate limits to ensure fair usage. Standard accounts have a limit of 20 requests per minute per API key. When the rate limit is exceeded, the API will return a 429 status code.
Higher Rate Limits: Token holders are eligible for higher rate limits. Hold tight while we work on the details :).
Rate Limit Headers: Rate limit information is included in response headers when available.
Error Responses
The API uses standard HTTP status codes and returns errors in JSON format:
401Unauthorized
Invalid or missing API key
400Bad Request
Invalid request parameters
404Not Found
Resource not found
429Too Many Requests
Rate limit exceeded
500Internal Server Error
Server error occurred
{
"error": "Error message description"
}Account Scoping
All account-related endpoints (/api/v1/account/* and /api/v1/orders) are automatically scoped to the user associated with the API key. You can only access your own account data and orders.