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.

GET/api/v1/markets

Filter by category slug

Maximum number of results

Number of results to skip

Sort order

API Endpoints

Markets

GET/api/v1/markets
Try it →

List all markets

Query parameters:

  • categorySlug (optional) - Filter by category slug
  • limit (optional, default: 24) - Maximum number of results
  • offset (optional, default: 0) - Number of results to skip
  • sort (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/:id
Try it →

Get 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/history
Try it →

Get 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/orders
Try it →

Place 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/orders
Try it →

List your orders

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.solshi.fun/api/v1/orders"
DELETE/api/v1/orders/:id

Cancel an order (not supported - orders execute immediately)

Account

GET/api/v1/account
Try it →

Get account information

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.solshi.fun/api/v1/account"
GET/api/v1/account/positions
Try it →

Get your positions across all markets

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.solshi.fun/api/v1/account/positions"
GET/api/v1/account/balance
Try it →

Get account balance

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.solshi.fun/api/v1/account/balance"

Python SDK

View on GitHub

We 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:

401

Unauthorized

Invalid or missing API key

400

Bad Request

Invalid request parameters

404

Not Found

Resource not found

429

Too Many Requests

Rate limit exceeded

500

Internal 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.