SPMC API Documentation

Welcome to the SPMC API documentation. This API provides access to prediction market data from multiple platforms including Polymarket, Kalshi, and Limitless.

Quick Start

All API endpoints are available at https://api.spmc.dev. No authentication is required for public endpoints.

cURL
curl https://api.spmc.dev/api/v1/markets?limit=10

Base URL

https://api.spmc.dev/api/v1

Response Format

All responses are returned in JSON format with the following structure:

{
  "data": [...],
  "meta": {
    "total": 100,
    "page": 1,
    "limit": 10
  }
}

Authentication

Most endpoints are publicly accessible and do not require authentication. For endpoints that require authentication, include your API key in the request header:

curl -H "Authorization: Bearer YOUR_API_KEY" https://api.spmc.dev/api/v1/endpoint

Builder-Orders

GET /api/v1/builder-orders/

List Builder Orders

Retrieve builder orders with optional filtering. **Query Parameters:** - `group_id`: UUID of the group to filter by - `writer_id`: UUID of the writer to filter by - `page`: Page number (1-based) - `page_size`: Number of orders per page (1-100) **Note:** Only one of `group_id` or `writer_id` can be specified at a time. If neither is provided, returns a 400 error as this would be too broad.

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string query Optional Filter by group ID
writer_id string query Optional Filter by writer ID
page integer query Optional Page number
Default: 1
page_size integer query Optional Items per page
Default: 50

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/builder-orders/

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/builder-orders/" \
  -H "Content-Type: application/json"

Fetch list builder orders

javascript
async function apiV1Builder-orders(group_id, writer_id, page, page_size) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/builder-orders/', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/builder-orders/:', error);
    throw error;
  }
}

Call list builder orders

python
import requests
from typing import Dict, Any, Optional

def apiV1Builder-orders(group_id, writer_id, page, page_size) -> Dict[str, Any]:
    """
    List Builder Orders
    
    Args:
        group_id: Filter by group ID
        writer_id: Filter by writer ID
        page: Page number
        page_size: Items per page
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/builder-orders/'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'group_id': group_id,
            'writer_id': writer_id,
            'page': page,
            'page_size': page_size,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/builder-orders/: {e}')
        raise
POST /api/v1/builder-orders/

Create Builder Order

Create a new builder order record. This endpoint records order metadata from the builder signing server for tracking order volume attribution to writers and groups over time. **Request Body:** ```json { "token_id": "32338220190071351435772801779725302244575775216413325951443816017994629993401", "side": "BUY", "order_volume": 1.0, "price": 0.99, "group_id": "6a2e8d58-622c-4c44-bb15-ab1e176a9891", "writer_id": "09ca3de3-0c38-40bd-b168-923742fa1d62", "request_path": "/api/orders/metadata", "request_method": "POST" } ``` **Validation:** - `token_id`: Required, non-empty string (accepts both decimal and hex formats) - `side`: Required, must be "BUY" or "SELL" - `order_volume`: Required, positive number - `price`: Optional, if provided must be between 0.01 and 0.99 - `group_id`: Optional, must exist in `unified.market_groups` if provided - `writer_id`: Optional, must exist in `pmf.authors` if provided - `request_path`: Required, non-empty string - `request_method`: Required, non-empty string

Platform Support: Polymarket Kalshi Limitless

Request Body

Reference: #/components/schemas/BuilderOrderCreate

Responses

201 Successful Response
422 Validation Error

Code Examples

Example POST request to /api/v1/builder-orders/

curl
curl -X POST \
  "https://api.spmc.dev/api/v1/builder-orders/" \
  -H "Content-Type: application/json"

Fetch create builder order

javascript
async function postApiV1Builder-orders() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/builder-orders/', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/builder-orders/:', error);
    throw error;
  }
}

Call create builder order

python
import requests
from typing import Dict, Any, Optional

def postApiV1Builder-orders() -> Dict[str, Any]:
    """
    Create Builder Order
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/builder-orders/'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.post(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/builder-orders/: {e}')
        raise
GET /api/v1/builder-orders/{order_id}

Get Builder Order

Retrieve a specific builder order by ID. **Path Parameters:** - `order_id`: UUID of the builder order

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
order_id string path Required

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/builder-orders/{order_id}

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/builder-orders/example" \
  -H "Content-Type: application/json"

Fetch get builder order

javascript
async function apiV1Builder-orders(order_id) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/builder-orders/example', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/builder-orders/{order_id}:', error);
    throw error;
  }
}

Call get builder order

python
import requests
from typing import Dict, Any, Optional

def apiV1Builder-orders(order_id) -> Dict[str, Any]:
    """
    Get Builder Order
    
    Args:
        order_id: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/builder-orders/example'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/builder-orders/{order_id}: {e}')
        raise

Groups

GET /api/v1/groups/

List Groups

List groups with filtering and pagination

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_type string query Optional Filter by group type
is_template string query Optional Filter by template status
is_system_generated string query Optional Filter by system generation status
search string query Optional Search in title and description
page integer query Optional Page number
Default: 1
page_size integer query Optional Items per page
Default: 50

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/groups/

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/groups/" \
  -H "Content-Type: application/json"

Fetch list groups

javascript
async function apiV1Groups(group_type, is_template, is_system_generated, search, page, page_size) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/:', error);
    throw error;
  }
}

Call list groups

python
import requests
from typing import Dict, Any, Optional

def apiV1Groups(group_type, is_template, is_system_generated, search, page, page_size) -> Dict[str, Any]:
    """
    List Groups
    
    Args:
        group_type: Filter by group type
        is_template: Filter by template status
        is_system_generated: Filter by system generation status
        search: Search in title and description
        page: Page number
        page_size: Items per page
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'group_type': group_type,
            'is_template': is_template,
            'is_system_generated': is_system_generated,
            'search': search,
            'page': page,
            'page_size': page_size,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/: {e}')
        raise
POST /api/v1/groups/

Create Group

Create a new market group

Platform Support: Polymarket Kalshi Limitless

Request Body

Reference: #/components/schemas/GroupCreate

Responses

201 Successful Response
422 Validation Error

Code Examples

Example POST request to /api/v1/groups/

curl
curl -X POST \
  "https://api.spmc.dev/api/v1/groups/" \
  -H "Content-Type: application/json"

Fetch create group

javascript
async function postApiV1Groups() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/:', error);
    throw error;
  }
}

Call create group

python
import requests
from typing import Dict, Any, Optional

def postApiV1Groups() -> Dict[str, Any]:
    """
    Create Group
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.post(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/: {e}')
        raise
POST /api/v1/groups/from-template

Create From Template

Create a new group from a template

Platform Support: Polymarket Kalshi Limitless

Request Body

Reference: #/components/schemas/TemplateInstantiate

Responses

201 Successful Response
422 Validation Error

Code Examples

Example POST request to /api/v1/groups/from-template

curl
curl -X POST \
  "https://api.spmc.dev/api/v1/groups/from-template" \
  -H "Content-Type: application/json"

Fetch create from template

javascript
async function postApiV1GroupsFrom-template() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/from-template', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/from-template:', error);
    throw error;
  }
}

Call create from template

python
import requests
from typing import Dict, Any, Optional

def postApiV1GroupsFrom-template() -> Dict[str, Any]:
    """
    Create From Template
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/from-template'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.post(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/from-template: {e}')
        raise
POST /api/v1/groups/resolve-polymarket

Resolve Polymarket Url

Resolve a Polymarket URL to get market options. This endpoint takes a Polymarket URL or condition ID and returns: - For single markets: The market details - For events: A list of all markets in the event **Example Request:** ```json { "url": "https://polymarket.com/event/us-x-venezuela-military-engagement-by-october-31" } ``` **Example Response (Event with multiple markets):** ```json { "type": "event", "event_title": "US x Venezuela military engagement by...?", "markets": [ { "condition_id": "0x...", "question": "by September 30?", "group_item_title": "September 30", "yes_token_id": "...", "no_token_id": "...", "active": true, "closed": false } ] } ```

Platform Support: Polymarket Kalshi Limitless

Request Body

Responses

200 Successful Response
422 Validation Error

Code Examples

Example POST request to /api/v1/groups/resolve-polymarket

curl
curl -X POST \
  "https://api.spmc.dev/api/v1/groups/resolve-polymarket" \
  -H "Content-Type: application/json"

Fetch resolve polymarket url

javascript
async function postApiV1GroupsResolve-polymarket() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/resolve-polymarket', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/resolve-polymarket:', error);
    throw error;
  }
}

Call resolve polymarket url

python
import requests
from typing import Dict, Any, Optional

def postApiV1GroupsResolve-polymarket() -> Dict[str, Any]:
    """
    Resolve Polymarket Url
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/resolve-polymarket'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.post(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/resolve-polymarket: {e}')
        raise
GET /api/v1/groups/templates

List Templates

List available group templates

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_type string query Optional Filter by group type
is_active boolean query Optional Filter by active status
Default: True
tags string query Optional Filter by tags
search string query Optional Search in name and description
limit integer query Optional Maximum results
Default: 100
offset integer query Optional Pagination offset
Default: 0

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/groups/templates

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/groups/templates" \
  -H "Content-Type: application/json"

Fetch list templates

javascript
async function apiV1GroupsTemplates(group_type, is_active, tags, search, limit, offset) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/templates', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/templates:', error);
    throw error;
  }
}

Call list templates

python
import requests
from typing import Dict, Any, Optional

def apiV1GroupsTemplates(group_type, is_active, tags, search, limit, offset) -> Dict[str, Any]:
    """
    List Templates
    
    Args:
        group_type: Filter by group type
        is_active: Filter by active status
        tags: Filter by tags
        search: Search in name and description
        limit: Maximum results
        offset: Pagination offset
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/templates'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'group_type': group_type,
            'is_active': is_active,
            'tags': tags,
            'search': search,
            'limit': limit,
            'offset': offset,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/templates: {e}')
        raise
POST /api/v1/groups/templates

Create Template

Create a new template (admin only)

Platform Support: Polymarket Kalshi Limitless

Request Body

Reference: #/components/schemas/TemplateCreate

Responses

201 Successful Response
422 Validation Error

Code Examples

Example POST request to /api/v1/groups/templates

curl
curl -X POST \
  "https://api.spmc.dev/api/v1/groups/templates" \
  -H "Content-Type: application/json"

Fetch create template

javascript
async function postApiV1GroupsTemplates() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/templates', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/templates:', error);
    throw error;
  }
}

Call create template

python
import requests
from typing import Dict, Any, Optional

def postApiV1GroupsTemplates() -> Dict[str, Any]:
    """
    Create Template
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/templates'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.post(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/templates: {e}')
        raise
DELETE /api/v1/groups/templates/{template_id}

Delete Template

Soft delete a template (admin only)

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
template_id string path Required

Responses

204 Successful Response
422 Validation Error

Code Examples

Example DELETE request to /api/v1/groups/templates/{template_id}

curl
curl -X DELETE \
  "https://api.spmc.dev/api/v1/groups/templates/example" \
  -H "Content-Type: application/json"

Fetch delete template

javascript
async function deleteApiV1GroupsTemplates(template_id) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/templates/example', {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/templates/{template_id}:', error);
    throw error;
  }
}

Call delete template

python
import requests
from typing import Dict, Any, Optional

def deleteApiV1GroupsTemplates(template_id) -> Dict[str, Any]:
    """
    Delete Template
    
    Args:
        template_id: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/templates/example'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.delete(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/templates/{template_id}: {e}')
        raise
GET /api/v1/groups/templates/{template_id}

Get Template

Get a specific template by ID

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
template_id string path Required

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/groups/templates/{template_id}

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/groups/templates/example" \
  -H "Content-Type: application/json"

Fetch get template

javascript
async function apiV1GroupsTemplates(template_id) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/templates/example', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/templates/{template_id}:', error);
    throw error;
  }
}

Call get template

python
import requests
from typing import Dict, Any, Optional

def apiV1GroupsTemplates(template_id) -> Dict[str, Any]:
    """
    Get Template
    
    Args:
        template_id: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/templates/example'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/templates/{template_id}: {e}')
        raise
PUT /api/v1/groups/templates/{template_id}

Update Template

Update an existing template (admin only)

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
template_id string path Required

Request Body

Reference: #/components/schemas/TemplateUpdate

Responses

200 Successful Response
422 Validation Error

Code Examples

Example PUT request to /api/v1/groups/templates/{template_id}

curl
curl -X PUT \
  "https://api.spmc.dev/api/v1/groups/templates/example" \
  -H "Content-Type: application/json"

Fetch update template

javascript
async function putApiV1GroupsTemplates(template_id) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/templates/example', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/templates/{template_id}:', error);
    throw error;
  }
}

Call update template

python
import requests
from typing import Dict, Any, Optional

def putApiV1GroupsTemplates(template_id) -> Dict[str, Any]:
    """
    Update Template
    
    Args:
        template_id: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/templates/example'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.put(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/templates/{template_id}: {e}')
        raise
POST /api/v1/groups/templates/{template_id}/preview

Preview Template

Preview what markets would be selected by a template

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
template_id string path Required
limit integer query Optional Maximum markets to preview
Default: 20

Request Body

Responses

200 Successful Response
422 Validation Error

Code Examples

Example POST request to /api/v1/groups/templates/{template_id}/preview

curl
curl -X POST \
  "https://api.spmc.dev/api/v1/groups/templates/example/preview" \
  -H "Content-Type: application/json"

Fetch preview template

javascript
async function postApiV1GroupsTemplatesPreview(template_id, limit) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/templates/example/preview', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/templates/{template_id}/preview:', error);
    throw error;
  }
}

Call preview template

python
import requests
from typing import Dict, Any, Optional

def postApiV1GroupsTemplatesPreview(template_id, limit) -> Dict[str, Any]:
    """
    Preview Template
    
    Args:
        template_id: 
        limit: Maximum markets to preview
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/templates/example/preview'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'limit': limit,
        }
        response = requests.post(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/templates/{template_id}/preview: {e}')
        raise
DELETE /api/v1/groups/{group_id}

Delete Group

Delete a group and all its market relationships

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required

Responses

204 Successful Response
422 Validation Error

Code Examples

Example DELETE request to /api/v1/groups/{group_id}

curl
curl -X DELETE \
  "https://api.spmc.dev/api/v1/groups/example" \
  -H "Content-Type: application/json"

Fetch delete group

javascript
async function deleteApiV1Groups(group_id) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example', {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}:', error);
    throw error;
  }
}

Call delete group

python
import requests
from typing import Dict, Any, Optional

def deleteApiV1Groups(group_id) -> Dict[str, Any]:
    """
    Delete Group
    
    Args:
        group_id: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.delete(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}: {e}')
        raise
GET /api/v1/groups/{group_id}

Get Group

Get a specific group by ID. By default, resolved markets are filtered out to show only active positions. Set include_resolved=true to see all markets including resolved ones.

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required
include_resolved boolean query Optional Include resolved markets in response. By default, resolved markets are filtered out to show only active positions.
Default: False

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/groups/{group_id}

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/groups/example" \
  -H "Content-Type: application/json"

Fetch get group

javascript
async function apiV1Groups(group_id, include_resolved) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}:', error);
    throw error;
  }
}

Call get group

python
import requests
from typing import Dict, Any, Optional

def apiV1Groups(group_id, include_resolved) -> Dict[str, Any]:
    """
    Get Group
    
    Args:
        group_id: 
        include_resolved: Include resolved markets in response. By default, resolved markets are filtered out to show only active positions.
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'include_resolved': include_resolved,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}: {e}')
        raise
PUT /api/v1/groups/{group_id}

Update Group

Update a group's metadata

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required

Request Body

Reference: #/components/schemas/GroupUpdate

Responses

200 Successful Response
422 Validation Error

Code Examples

Example PUT request to /api/v1/groups/{group_id}

curl
curl -X PUT \
  "https://api.spmc.dev/api/v1/groups/example" \
  -H "Content-Type: application/json"

Fetch update group

javascript
async function putApiV1Groups(group_id) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}:', error);
    throw error;
  }
}

Call update group

python
import requests
from typing import Dict, Any, Optional

def putApiV1Groups(group_id) -> Dict[str, Any]:
    """
    Update Group
    
    Args:
        group_id: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.put(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}: {e}')
        raise
GET /api/v1/groups/{group_id}/arbitrage-spread

Get Arbitrage Spread

Get current arbitrage spread and profit potential for an arbitrage group

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/groups/{group_id}/arbitrage-spread

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/groups/example/arbitrage-spread" \
  -H "Content-Type: application/json"

Fetch get arbitrage spread

javascript
async function apiV1GroupsArbitrage-spread(group_id) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example/arbitrage-spread', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}/arbitrage-spread:', error);
    throw error;
  }
}

Call get arbitrage spread

python
import requests
from typing import Dict, Any, Optional

def apiV1GroupsArbitrage-spread(group_id) -> Dict[str, Any]:
    """
    Get Arbitrage Spread
    
    Args:
        group_id: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example/arbitrage-spread'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}/arbitrage-spread: {e}')
        raise
GET /api/v1/groups/{group_id}/correlation

Get Correlation Data

Get correlation analysis for a correlation group

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/groups/{group_id}/correlation

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/groups/example/correlation" \
  -H "Content-Type: application/json"

Fetch get correlation data

javascript
async function apiV1GroupsCorrelation(group_id) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example/correlation', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}/correlation:', error);
    throw error;
  }
}

Call get correlation data

python
import requests
from typing import Dict, Any, Optional

def apiV1GroupsCorrelation(group_id) -> Dict[str, Any]:
    """
    Get Correlation Data
    
    Args:
        group_id: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example/correlation'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}/correlation: {e}')
        raise
GET /api/v1/groups/{group_id}/index-value

Get Index Value

Get index value for an index group. Without parameters, returns current index value and constituent contributions. With interval/fidelity or start_time/end_time parameters, returns historical weighted index data. The historical data aggregates price history from all constituent markets using their weights to produce a single weighted index time series.

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required
interval string query Optional Time interval (1m, 1h, 6h, 1d, 1w, max). If provided, returns historical data. Mutually exclusive with start_time/end_time
fidelity string query Optional Resolution in minutes for historical data
Default: 60
start_time string query Optional Start timestamp (Unix UTC) for historical data. Mutually exclusive with interval
end_time string query Optional End timestamp (Unix UTC) for historical data. Mutually exclusive with interval

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/groups/{group_id}/index-value

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/groups/example/index-value" \
  -H "Content-Type: application/json"

Fetch get index value

javascript
async function apiV1GroupsIndex-value(group_id, interval, fidelity, start_time, end_time) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example/index-value', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}/index-value:', error);
    throw error;
  }
}

Call get index value

python
import requests
from typing import Dict, Any, Optional

def apiV1GroupsIndex-value(group_id, interval, fidelity, start_time, end_time) -> Dict[str, Any]:
    """
    Get Index Value
    
    Args:
        group_id: 
        interval: Time interval (1m, 1h, 6h, 1d, 1w, max). If provided, returns historical data. Mutually exclusive with start_time/end_time
        fidelity: Resolution in minutes for historical data
        start_time: Start timestamp (Unix UTC) for historical data. Mutually exclusive with interval
        end_time: End timestamp (Unix UTC) for historical data. Mutually exclusive with interval
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example/index-value'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'interval': interval,
            'fidelity': fidelity,
            'start_time': start_time,
            'end_time': end_time,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}/index-value: {e}')
        raise
POST /api/v1/groups/{group_id}/markets

Add Markets To Group

Add markets to an existing group

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required

Request Body

Reference: #/components/schemas/MarketAdd

Responses

200 Successful Response
422 Validation Error

Code Examples

Example POST request to /api/v1/groups/{group_id}/markets

curl
curl -X POST \
  "https://api.spmc.dev/api/v1/groups/example/markets" \
  -H "Content-Type: application/json"

Fetch add markets to group

javascript
async function postApiV1GroupsMarkets(group_id) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example/markets', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}/markets:', error);
    throw error;
  }
}

Call add markets to group

python
import requests
from typing import Dict, Any, Optional

def postApiV1GroupsMarkets(group_id) -> Dict[str, Any]:
    """
    Add Markets To Group
    
    Args:
        group_id: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example/markets'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.post(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}/markets: {e}')
        raise
POST /api/v1/groups/{group_id}/markets/from-polymarket

Add Polymarket To Group

Add a Polymarket market to a group by condition ID. This endpoint allows adding markets directly from Polymarket using their condition ID (the hexadecimal string starting with 0x). The market will be fetched from Polymarket's API if it doesn't exist in our database. **Supported Input Formats:** - Condition ID: `0x0ed1d3981a2067c9a53364b00d4342e703026926615de49aec9bead2cb2f8393` - Polymarket URL: The condition ID will be extracted automatically **Process:** 1. Check if market exists in our database 2. If not, fetch from Polymarket API and insert 3. Add market to group with specified weight and position **Example:** ```json { "condition_id": "0x0ed1d3981a2067c9a53364b00d4342e703026926615de49aec9bead2cb2f8393", "weight": 2.5, "position_type": "long" } ```

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required

Request Body

Reference: #/components/schemas/PolymarketMarketAdd

Responses

200 Successful Response
422 Validation Error

Code Examples

Example POST request to /api/v1/groups/{group_id}/markets/from-polymarket

curl
curl -X POST \
  "https://api.spmc.dev/api/v1/groups/example/markets/from-polymarket" \
  -H "Content-Type: application/json"

Fetch add polymarket to group

javascript
async function postApiV1GroupsMarketsFrom-polymarket(group_id) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example/markets/from-polymarket', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}/markets/from-polymarket:', error);
    throw error;
  }
}

Call add polymarket to group

python
import requests
from typing import Dict, Any, Optional

def postApiV1GroupsMarketsFrom-polymarket(group_id) -> Dict[str, Any]:
    """
    Add Polymarket To Group
    
    Args:
        group_id: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example/markets/from-polymarket'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.post(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}/markets/from-polymarket: {e}')
        raise
DELETE /api/v1/groups/{group_id}/markets/{market_id}

Remove Market From Group

Remove a market from a group

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required
market_id string path Required

Responses

204 Successful Response
422 Validation Error

Code Examples

Example DELETE request to /api/v1/groups/{group_id}/markets/{market_id}

curl
curl -X DELETE \
  "https://api.spmc.dev/api/v1/groups/example/markets/example" \
  -H "Content-Type: application/json"

Fetch remove market from group

javascript
async function deleteApiV1GroupsMarkets(group_id, market_id) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example/markets/example', {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}/markets/{market_id}:', error);
    throw error;
  }
}

Call remove market from group

python
import requests
from typing import Dict, Any, Optional

def deleteApiV1GroupsMarkets(group_id, market_id) -> Dict[str, Any]:
    """
    Remove Market From Group
    
    Args:
        group_id: 
        market_id: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example/markets/example'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.delete(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}/markets/{market_id}: {e}')
        raise
PUT /api/v1/groups/{group_id}/markets/{market_id}

Update Market In Group

Update a market's properties within a group

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required
market_id string path Required

Request Body

Reference: #/components/schemas/MarketUpdate

Responses

200 Successful Response
422 Validation Error

Code Examples

Example PUT request to /api/v1/groups/{group_id}/markets/{market_id}

curl
curl -X PUT \
  "https://api.spmc.dev/api/v1/groups/example/markets/example" \
  -H "Content-Type: application/json"

Fetch update market in group

javascript
async function putApiV1GroupsMarkets(group_id, market_id) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example/markets/example', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}/markets/{market_id}:', error);
    throw error;
  }
}

Call update market in group

python
import requests
from typing import Dict, Any, Optional

def putApiV1GroupsMarkets(group_id, market_id) -> Dict[str, Any]:
    """
    Update Market In Group
    
    Args:
        group_id: 
        market_id: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example/markets/example'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.put(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}/markets/{market_id}: {e}')
        raise
GET /api/v1/groups/{group_id}/membership-history

Get Membership History

Get history of market additions, removals, weight changes, and resolutions for a group. This endpoint returns a chronological log of all changes to the group's composition: - Markets added with their initial weights - Markets removed from the group - Weight changes for existing markets - Market resolutions (automatic settlements) Action type filtering: - 'manual': Only manual changes (added, removed, weight_changed) - 'automatic': Only automatic changes (resolved_win, resolved_loss, resolved_invalid) - 'all' or None: All changes (default) Resolution filtering: - include_resolutions=True: Include resolution events (default) - include_resolutions=False: Exclude resolution events (show only manual changes) Note: If action_type is specified, it takes precedence over include_resolutions. Useful for understanding how a group evolved over time and for simulating historical performance with accurate composition.

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required
start_time string query Optional Unix timestamp (start filter)
end_time string query Optional Unix timestamp (end filter)
limit integer query Optional Maximum number of changes
Default: 100
action_type string query Optional Filter by action type: 'manual' (added, removed, weight_changed), 'automatic' (resolved_win, resolved_loss, resolved_invalid), or 'all' for everything
include_resolutions boolean query Optional Include resolution events (resolved_win, resolved_loss, resolved_invalid) in response. Set to false to show only manual changes.
Default: True

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/groups/{group_id}/membership-history

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/groups/example/membership-history" \
  -H "Content-Type: application/json"

Fetch get membership history

javascript
async function apiV1GroupsMembership-history(group_id, start_time, end_time, limit, action_type, include_resolutions) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example/membership-history', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}/membership-history:', error);
    throw error;
  }
}

Call get membership history

python
import requests
from typing import Dict, Any, Optional

def apiV1GroupsMembership-history(group_id, start_time, end_time, limit, action_type, include_resolutions) -> Dict[str, Any]:
    """
    Get Membership History
    
    Args:
        group_id: 
        start_time: Unix timestamp (start filter)
        end_time: Unix timestamp (end filter)
        limit: Maximum number of changes
        action_type: Filter by action type: 'manual' (added, removed, weight_changed), 'automatic' (resolved_win, resolved_loss, resolved_invalid), or 'all' for everything
        include_resolutions: Include resolution events (resolved_win, resolved_loss, resolved_invalid) in response. Set to false to show only manual changes.
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example/membership-history'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'start_time': start_time,
            'end_time': end_time,
            'limit': limit,
            'action_type': action_type,
            'include_resolutions': include_resolutions,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}/membership-history: {e}')
        raise
GET /api/v1/groups/{group_id}/metrics

Get Group Metrics

Calculate and return metrics for a group based on its type

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/groups/{group_id}/metrics

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/groups/example/metrics" \
  -H "Content-Type: application/json"

Fetch get group metrics

javascript
async function apiV1GroupsMetrics(group_id) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example/metrics', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}/metrics:', error);
    throw error;
  }
}

Call get group metrics

python
import requests
from typing import Dict, Any, Optional

def apiV1GroupsMetrics(group_id) -> Dict[str, Any]:
    """
    Get Group Metrics
    
    Args:
        group_id: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example/metrics'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}/metrics: {e}')
        raise
GET /api/v1/groups/{group_id}/nav-history

Get Nav History

Get NAV history for a group over a specified time range. This endpoint returns hourly NAV snapshots for a group, allowing you to track portfolio performance over time. The data is suitable for charting and includes both NAV values and cash allocation ratios. **Default Behavior:** - If no date range is provided, returns the last 7 days of data - Returns absolute NAV values by default (use normalized=true for relative performance) **Query Parameters:** - `start_ts`: Unix timestamp in seconds for the start of the range - `end_ts`: Unix timestamp in seconds for the end of the range - `normalized`: Boolean flag to return normalized NAV (1.0 at inception) vs absolute NAV **Response Format:** ```json { "history": [ { "t": 1732560000, "p": 1.0, "nav": 100.0, "cash_ratio": 0.25 }, { "t": 1732563600, "p": 1.012, "nav": 101.2, "cash_ratio": 0.20 } ], "metadata": { "group_id": "abc-123", "group_title": "My Portfolio", "group_type": "portfolio", "base_currency": "USDC", "inception_ts": 1732560000, "interval": "1h", "data_points": 168, "start_ts": 1732560000, "end_ts": 1733164800, "normalized": false } } ``` **Use Cases:** - Display performance charts in the frontend - Calculate returns over specific periods - Compare portfolio performance across different time ranges - Monitor cash allocation changes over time **Requirements:** Group must have track_nav=true and at least one NAV snapshot computed.

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required
start_ts string query Optional Start timestamp (Unix seconds). Defaults to 7 days ago if not provided.
end_ts string query Optional End timestamp (Unix seconds). Defaults to now if not provided.
normalized boolean query Optional If true, return normalized NAV (1.0 at inception). If false, return absolute NAV.
Default: False

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/groups/{group_id}/nav-history

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/groups/example/nav-history" \
  -H "Content-Type: application/json"

Fetch get nav history

javascript
async function apiV1GroupsNav-history(group_id, start_ts, end_ts, normalized) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example/nav-history', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}/nav-history:', error);
    throw error;
  }
}

Call get nav history

python
import requests
from typing import Dict, Any, Optional

def apiV1GroupsNav-history(group_id, start_ts, end_ts, normalized) -> Dict[str, Any]:
    """
    Get Nav History
    
    Args:
        group_id: 
        start_ts: Start timestamp (Unix seconds). Defaults to 7 days ago if not provided.
        end_ts: End timestamp (Unix seconds). Defaults to now if not provided.
        normalized: If true, return normalized NAV (1.0 at inception). If false, return absolute NAV.
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example/nav-history'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'start_ts': start_ts,
            'end_ts': end_ts,
            'normalized': normalized,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}/nav-history: {e}')
        raise
GET /api/v1/groups/{group_id}/nav-latest

Get Latest Nav

Get the latest NAV snapshot for a group. This endpoint returns the most recent NAV snapshot for a group, providing current portfolio value, cash allocation, and performance metrics. Optionally includes position-level cost basis and PnL details for paper trading portfolios. **Query Parameters:** - `include_position_details`: Boolean flag to include position-level cost basis and PnL data **Response Format (Basic):** ```json { "group_id": "abc-123", "ts": 1732563600, "nav": 101.2, "nav_normalized": 1.012, "cash_value": 20.0, "invested_value": 81.2, "invested_ratio": 0.802, "base_currency": "USDC", "nav_metadata": { "stale_prices": [], "missing_data": false } } ``` **Response Format (With Position Details):** ```json { "group_id": "abc-123", "ts": 1732563600, "nav": 101.2, "nav_normalized": 1.012, "cash_value": 20.0, "invested_value": 81.2, "invested_ratio": 0.802, "base_currency": "USDC", "nav_metadata": {...}, "position_details": [ { "market_id": "def-456", "shares": 63.14, "cost_basis_per_share": 0.50, "total_cost_basis": 31.57, "current_value": 32.83, "unrealized_pnl": 1.26, "unrealized_pnl_percent": 3.99 } ] } ``` **Response Fields:** - `group_id`: Group UUID as string - `ts`: Unix timestamp of the snapshot - `nav`: Total portfolio value in base currency - `nav_normalized`: Normalized NAV (1.0 at inception, shows cumulative performance) - `cash_value`: Uninvested cash portion - `invested_value`: Market value of all positions - `invested_ratio`: Percentage invested (0.0 to 1.0) - `base_currency`: Currency unit (e.g., USDC) - `nav_metadata`: Additional context and data quality indicators - `position_details`: Optional array of position-level cost basis and PnL data **Position Detail Fields:** - `market_id`: Market UUID as string - `shares`: Number of shares held - `cost_basis_per_share`: Original purchase price per share - `total_cost_basis`: Total amount originally invested - `current_value`: Current market value of position - `unrealized_pnl`: Unrealized profit/loss in dollars - `unrealized_pnl_percent`: Unrealized profit/loss as percentage **Use Cases:** - Display current portfolio value in dashboard - Show current cash vs invested allocation - Display cumulative performance since inception - Monitor portfolio composition - Track individual position performance and cost basis **Error Responses:** - `404 Not Found`: No NAV data exists for this group (track_nav may be false or no snapshots computed yet) - `500 Internal Server Error`: Database or service error **Requirements:** Group must have track_nav=true and at least one NAV snapshot computed. Position details are only available for paper trading portfolios with rebalance history.

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required
include_position_details boolean query Optional Include position-level cost basis and PnL details
Default: False

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/groups/{group_id}/nav-latest

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/groups/example/nav-latest" \
  -H "Content-Type: application/json"

Fetch get latest nav

javascript
async function apiV1GroupsNav-latest(group_id, include_position_details) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example/nav-latest', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}/nav-latest:', error);
    throw error;
  }
}

Call get latest nav

python
import requests
from typing import Dict, Any, Optional

def apiV1GroupsNav-latest(group_id, include_position_details) -> Dict[str, Any]:
    """
    Get Latest Nav
    
    Args:
        group_id: 
        include_position_details: Include position-level cost basis and PnL details
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example/nav-latest'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'include_position_details': include_position_details,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}/nav-latest: {e}')
        raise
GET /api/v1/groups/{group_id}/performance

Get Group Performance

Get price performance data optimized for frontend charts and monitoring. This endpoint returns aggregated price performance metrics for all markets in a group, using weighted averages based on each market's weight in the group. Returns: - Weighted average price for the group - Individual market prices and their contributions - Performance changes over the specified period - Volume and liquidity metrics

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required
period string query Optional Time period: 1h, 24h, 7d, 30d, all
Default: 24h

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/groups/{group_id}/performance

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/groups/example/performance" \
  -H "Content-Type: application/json"

Fetch get group performance

javascript
async function apiV1GroupsPerformance(group_id, period) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example/performance', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}/performance:', error);
    throw error;
  }
}

Call get group performance

python
import requests
from typing import Dict, Any, Optional

def apiV1GroupsPerformance(group_id, period) -> Dict[str, Any]:
    """
    Get Group Performance
    
    Args:
        group_id: 
        period: Time period: 1h, 24h, 7d, 30d, all
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example/performance'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'period': period,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}/performance: {e}')
        raise
GET /api/v1/groups/{group_id}/portfolio-value

Get Portfolio Value

Get portfolio value and P&L for a portfolio group

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/groups/{group_id}/portfolio-value

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/groups/example/portfolio-value" \
  -H "Content-Type: application/json"

Fetch get portfolio value

javascript
async function apiV1GroupsPortfolio-value(group_id) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example/portfolio-value', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}/portfolio-value:', error);
    throw error;
  }
}

Call get portfolio value

python
import requests
from typing import Dict, Any, Optional

def apiV1GroupsPortfolio-value(group_id) -> Dict[str, Any]:
    """
    Get Portfolio Value
    
    Args:
        group_id: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example/portfolio-value'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}/portfolio-value: {e}')
        raise
POST /api/v1/groups/{group_id}/rebalance

Rebalance Portfolio

Rebalance a portfolio group with new allocations. This endpoint: 1. Validates the group is a portfolio type and is paper trading 2. Calculates current portfolio value using market prices 3. Applies the new percentage allocations 4. Calculates shares for each market based on current prices 5. Updates the group's market relationships 6. Records the rebalance event in the portfolio_rebalances table 7. Updates group membership history for audit trail **Request Body:** ```json { "allocations": [ {"market_id": "abc-123", "percentage": 30.0}, {"market_id": "def-456", "percentage": 25.0} ], "cash_percentage": 45.0, "notes": "Monthly rebalance" } ``` **Response:** ```json { "rebalance_id": "...", "group_id": "...", "timestamp": "2024-11-26T10:30:00Z", "portfolio_value_before": 105.23, "portfolio_value_after": 105.23, "allocations_applied": [ { "market_id": "abc-123", "market_title": "Will BTC hit $100k?", "percentage": 30.0, "dollar_amount": 31.57, "shares": 63.14, "price": 0.50 }, { "symbol": "CASH", "percentage": 45.0, "dollar_amount": 47.35 } ] } ```

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required

Request Body

Reference: #/components/schemas/RebalanceRequest

Responses

200 Successful Response
422 Validation Error

Code Examples

Example POST request to /api/v1/groups/{group_id}/rebalance

curl
curl -X POST \
  "https://api.spmc.dev/api/v1/groups/example/rebalance" \
  -H "Content-Type: application/json"

Fetch rebalance portfolio

javascript
async function postApiV1GroupsRebalance(group_id) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example/rebalance', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}/rebalance:', error);
    throw error;
  }
}

Call rebalance portfolio

python
import requests
from typing import Dict, Any, Optional

def postApiV1GroupsRebalance(group_id) -> Dict[str, Any]:
    """
    Rebalance Portfolio
    
    Args:
        group_id: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example/rebalance'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.post(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}/rebalance: {e}')
        raise
GET /api/v1/groups/{group_id}/rebalance-history

Get Rebalance History

Get history of portfolio rebalances for a group. This endpoint returns a chronological log of all rebalances for a portfolio group: - When rebalances occurred - Portfolio value before and after - Type of rebalance (manual, automatic, initial) - Optional notes Only available for groups with group_type='portfolio'.

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
group_id string path Required
start_time string query Optional Unix timestamp in seconds (start filter)
end_time string query Optional Unix timestamp in seconds (end filter)
limit integer query Optional Maximum number of rebalances to return
Default: 50

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/groups/{group_id}/rebalance-history

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/groups/example/rebalance-history" \
  -H "Content-Type: application/json"

Fetch get rebalance history

javascript
async function apiV1GroupsRebalance-history(group_id, start_time, end_time, limit) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/groups/example/rebalance-history', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/groups/{group_id}/rebalance-history:', error);
    throw error;
  }
}

Call get rebalance history

python
import requests
from typing import Dict, Any, Optional

def apiV1GroupsRebalance-history(group_id, start_time, end_time, limit) -> Dict[str, Any]:
    """
    Get Rebalance History
    
    Args:
        group_id: 
        start_time: Unix timestamp in seconds (start filter)
        end_time: Unix timestamp in seconds (end filter)
        limit: Maximum number of rebalances to return
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/groups/example/rebalance-history'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'start_time': start_time,
            'end_time': end_time,
            'limit': limit,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/groups/{group_id}/rebalance-history: {e}')
        raise

Kalshi Monitoring

GET /api/v1/monitoring/kalshi/kalshi-status

Get Kalshi Status

Quick Kalshi WebSocket status check. Returns simplified status for monitoring/alerting. Usage: curl "https://api.spmc.dev/api/v1/monitoring/kalshi-status"

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/kalshi/kalshi-status

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/kalshi-status" \
  -H "Content-Type: application/json"

Fetch get kalshi status

javascript
async function apiV1MonitoringKalshiKalshi-status() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/kalshi-status', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/kalshi-status:', error);
    throw error;
  }
}

Call get kalshi status

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiKalshi-status() -> Dict[str, Any]:
    """
    Get Kalshi Status
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/kalshi-status'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/kalshi-status: {e}')
        raise
GET /api/v1/monitoring/kalshi/metrics

Get Kalshi Metrics

Comprehensive metrics for Kalshi WebSocket system. Monitors: 1. WebSocket connection status and channel subscriptions 2. Message processing rates (ticker, trade, orderbook, lifecycle) 3. Database update rates and latency 4. Data freshness per market 5. Error rates and connection health Usage: curl "https://api.spmc.dev/api/v1/monitoring/kalshi-metrics"

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/kalshi/metrics

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/metrics" \
  -H "Content-Type: application/json"

Fetch get kalshi metrics

javascript
async function apiV1MonitoringKalshiMetrics() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/metrics', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/metrics:', error);
    throw error;
  }
}

Call get kalshi metrics

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiMetrics() -> Dict[str, Any]:
    """
    Get Kalshi Metrics
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/metrics'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/metrics: {e}')
        raise
GET /api/v1/monitoring/kalshi/metrics/scaling-readiness

Check Scaling Readiness

Check if system is ready to scale to target number of markets. Args: target_markets: Number of markets to scale to (default 25000)

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
target_markets integer query Optional
Default: 25000

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/monitoring/kalshi/metrics/scaling-readiness

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/metrics/scaling-readiness" \
  -H "Content-Type: application/json"

Fetch check scaling readiness

javascript
async function apiV1MonitoringKalshiMetricsScaling-readiness(target_markets) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/metrics/scaling-readiness', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/metrics/scaling-readiness:', error);
    throw error;
  }
}

Call check scaling readiness

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiMetricsScaling-readiness(target_markets) -> Dict[str, Any]:
    """
    Check Scaling Readiness
    
    Args:
        target_markets: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/metrics/scaling-readiness'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'target_markets': target_markets,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/metrics/scaling-readiness: {e}')
        raise
GET /api/v1/monitoring/kalshi/orderbook-status

Get Kalshi Orderbook Status

Get Kalshi orderbook subscription status from database.

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/kalshi/orderbook-status

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/orderbook-status" \
  -H "Content-Type: application/json"

Fetch get kalshi orderbook status

javascript
async function apiV1MonitoringKalshiOrderbook-status() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/orderbook-status', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/orderbook-status:', error);
    throw error;
  }
}

Call get kalshi orderbook status

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiOrderbook-status() -> Dict[str, Any]:
    """
    Get Kalshi Orderbook Status
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/orderbook-status'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/orderbook-status: {e}')
        raise
GET /api/v1/monitoring/kalshi/pipeline

Get Kalshi Pipeline Status

Get comprehensive status of the Kalshi websocket data pipeline. Checks: 1. WebSocket connection status 2. Message reception rate 3. Processing success/failure rates 4. Database write status 5. Data freshness in order_book_current

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/kalshi/pipeline

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/pipeline" \
  -H "Content-Type: application/json"

Fetch get kalshi pipeline status

javascript
async function apiV1MonitoringKalshiPipeline() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/pipeline', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/pipeline:', error);
    throw error;
  }
}

Call get kalshi pipeline status

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiPipeline() -> Dict[str, Any]:
    """
    Get Kalshi Pipeline Status
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/pipeline'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/pipeline: {e}')
        raise
GET /api/v1/monitoring/kalshi/pipeline/logs

Get Kalshi Pipeline Logs

Get recent Kalshi pipeline activity from logs. This endpoint helps identify where data is getting stuck.

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
minutes integer query Optional
Default: 5

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/monitoring/kalshi/pipeline/logs

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/pipeline/logs" \
  -H "Content-Type: application/json"

Fetch get kalshi pipeline logs

javascript
async function apiV1MonitoringKalshiPipelineLogs(minutes) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/pipeline/logs', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/pipeline/logs:', error);
    throw error;
  }
}

Call get kalshi pipeline logs

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiPipelineLogs(minutes) -> Dict[str, Any]:
    """
    Get Kalshi Pipeline Logs
    
    Args:
        minutes: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/pipeline/logs'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'minutes': minutes,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/pipeline/logs: {e}')
        raise
GET /api/v1/monitoring/kalshi/status

Get Kalshi Status

Get basic Kalshi subscription and data status.

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/kalshi/status

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/status" \
  -H "Content-Type: application/json"

Fetch get kalshi status

javascript
async function apiV1MonitoringKalshiStatus() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/status', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/status:', error);
    throw error;
  }
}

Call get kalshi status

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiStatus() -> Dict[str, Any]:
    """
    Get Kalshi Status
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/status'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/status: {e}')
        raise
GET /api/v1/monitoring/kalshi/status/can-scale

Check Can Scale

Simple check if we can scale to more markets.

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
target_markets integer query Optional
Default: 1000

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/monitoring/kalshi/status/can-scale

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/status/can-scale" \
  -H "Content-Type: application/json"

Fetch check can scale

javascript
async function apiV1MonitoringKalshiStatusCan-scale(target_markets) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/status/can-scale', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/status/can-scale:', error);
    throw error;
  }
}

Call check can scale

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiStatusCan-scale(target_markets) -> Dict[str, Any]:
    """
    Check Can Scale
    
    Args:
        target_markets: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/status/can-scale'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'target_markets': target_markets,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/status/can-scale: {e}')
        raise

Monitoring

GET /api/v1/monitoring/kalshi/kalshi-status

Get Kalshi Status

Quick Kalshi WebSocket status check. Returns simplified status for monitoring/alerting. Usage: curl "https://api.spmc.dev/api/v1/monitoring/kalshi-status"

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/kalshi/kalshi-status

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/kalshi-status" \
  -H "Content-Type: application/json"

Fetch get kalshi status

javascript
async function apiV1MonitoringKalshiKalshi-status() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/kalshi-status', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/kalshi-status:', error);
    throw error;
  }
}

Call get kalshi status

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiKalshi-status() -> Dict[str, Any]:
    """
    Get Kalshi Status
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/kalshi-status'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/kalshi-status: {e}')
        raise
GET /api/v1/monitoring/kalshi/metrics

Get Kalshi Metrics

Comprehensive metrics for Kalshi WebSocket system. Monitors: 1. WebSocket connection status and channel subscriptions 2. Message processing rates (ticker, trade, orderbook, lifecycle) 3. Database update rates and latency 4. Data freshness per market 5. Error rates and connection health Usage: curl "https://api.spmc.dev/api/v1/monitoring/kalshi-metrics"

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/kalshi/metrics

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/metrics" \
  -H "Content-Type: application/json"

Fetch get kalshi metrics

javascript
async function apiV1MonitoringKalshiMetrics() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/metrics', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/metrics:', error);
    throw error;
  }
}

Call get kalshi metrics

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiMetrics() -> Dict[str, Any]:
    """
    Get Kalshi Metrics
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/metrics'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/metrics: {e}')
        raise
GET /api/v1/monitoring/kalshi/metrics/scaling-readiness

Check Scaling Readiness

Check if system is ready to scale to target number of markets. Args: target_markets: Number of markets to scale to (default 25000)

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
target_markets integer query Optional
Default: 25000

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/monitoring/kalshi/metrics/scaling-readiness

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/metrics/scaling-readiness" \
  -H "Content-Type: application/json"

Fetch check scaling readiness

javascript
async function apiV1MonitoringKalshiMetricsScaling-readiness(target_markets) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/metrics/scaling-readiness', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/metrics/scaling-readiness:', error);
    throw error;
  }
}

Call check scaling readiness

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiMetricsScaling-readiness(target_markets) -> Dict[str, Any]:
    """
    Check Scaling Readiness
    
    Args:
        target_markets: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/metrics/scaling-readiness'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'target_markets': target_markets,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/metrics/scaling-readiness: {e}')
        raise
GET /api/v1/monitoring/kalshi/orderbook-status

Get Kalshi Orderbook Status

Get Kalshi orderbook subscription status from database.

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/kalshi/orderbook-status

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/orderbook-status" \
  -H "Content-Type: application/json"

Fetch get kalshi orderbook status

javascript
async function apiV1MonitoringKalshiOrderbook-status() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/orderbook-status', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/orderbook-status:', error);
    throw error;
  }
}

Call get kalshi orderbook status

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiOrderbook-status() -> Dict[str, Any]:
    """
    Get Kalshi Orderbook Status
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/orderbook-status'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/orderbook-status: {e}')
        raise
GET /api/v1/monitoring/kalshi/pipeline

Get Kalshi Pipeline Status

Get comprehensive status of the Kalshi websocket data pipeline. Checks: 1. WebSocket connection status 2. Message reception rate 3. Processing success/failure rates 4. Database write status 5. Data freshness in order_book_current

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/kalshi/pipeline

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/pipeline" \
  -H "Content-Type: application/json"

Fetch get kalshi pipeline status

javascript
async function apiV1MonitoringKalshiPipeline() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/pipeline', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/pipeline:', error);
    throw error;
  }
}

Call get kalshi pipeline status

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiPipeline() -> Dict[str, Any]:
    """
    Get Kalshi Pipeline Status
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/pipeline'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/pipeline: {e}')
        raise
GET /api/v1/monitoring/kalshi/pipeline/logs

Get Kalshi Pipeline Logs

Get recent Kalshi pipeline activity from logs. This endpoint helps identify where data is getting stuck.

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
minutes integer query Optional
Default: 5

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/monitoring/kalshi/pipeline/logs

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/pipeline/logs" \
  -H "Content-Type: application/json"

Fetch get kalshi pipeline logs

javascript
async function apiV1MonitoringKalshiPipelineLogs(minutes) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/pipeline/logs', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/pipeline/logs:', error);
    throw error;
  }
}

Call get kalshi pipeline logs

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiPipelineLogs(minutes) -> Dict[str, Any]:
    """
    Get Kalshi Pipeline Logs
    
    Args:
        minutes: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/pipeline/logs'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'minutes': minutes,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/pipeline/logs: {e}')
        raise
GET /api/v1/monitoring/kalshi/status

Get Kalshi Status

Get basic Kalshi subscription and data status.

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/kalshi/status

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/status" \
  -H "Content-Type: application/json"

Fetch get kalshi status

javascript
async function apiV1MonitoringKalshiStatus() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/status', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/status:', error);
    throw error;
  }
}

Call get kalshi status

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiStatus() -> Dict[str, Any]:
    """
    Get Kalshi Status
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/status'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/status: {e}')
        raise
GET /api/v1/monitoring/kalshi/status/can-scale

Check Can Scale

Simple check if we can scale to more markets.

Platform Support: Polymarket Kalshi Limitless

Parameters

Name Type Location Required Description
target_markets integer query Optional
Default: 1000

Responses

200 Successful Response
422 Validation Error

Code Examples

Example GET request to /api/v1/monitoring/kalshi/status/can-scale

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/kalshi/status/can-scale" \
  -H "Content-Type: application/json"

Fetch check can scale

javascript
async function apiV1MonitoringKalshiStatusCan-scale(target_markets) {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/kalshi/status/can-scale', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/kalshi/status/can-scale:', error);
    throw error;
  }
}

Call check can scale

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringKalshiStatusCan-scale(target_markets) -> Dict[str, Any]:
    """
    Check Can Scale
    
    Args:
        target_markets: 
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/kalshi/status/can-scale'
        headers = {
            "Content-Type": "application/json"
    }
        params = {
            'target_markets': target_markets,
        }
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/kalshi/status/can-scale: {e}')
        raise
GET /api/v1/monitoring/polymarket/metrics

Get Polymarket Metrics

Comprehensive metrics for Polymarket WebSocket system. Monitors: 1. WebSocket connection status and channel subscriptions 2. Message processing rates (book, ticker, orderbook updates) 3. Database update rates and latency 4. Data freshness per market 5. Token-specific metrics (YES/NO) Usage: curl "https://api.spmc.dev/api/v1/monitoring/polymarket-metrics"

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/polymarket/metrics

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/polymarket/metrics" \
  -H "Content-Type: application/json"

Fetch get polymarket metrics

javascript
async function apiV1MonitoringPolymarketMetrics() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/polymarket/metrics', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/polymarket/metrics:', error);
    throw error;
  }
}

Call get polymarket metrics

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringPolymarketMetrics() -> Dict[str, Any]:
    """
    Get Polymarket Metrics
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/polymarket/metrics'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/polymarket/metrics: {e}')
        raise
GET /api/v1/monitoring/polymarket/orderbook-status

Get Polymarket Orderbook Status

Get detailed Polymarket orderbook subscription status.

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/polymarket/orderbook-status

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/polymarket/orderbook-status" \
  -H "Content-Type: application/json"

Fetch get polymarket orderbook status

javascript
async function apiV1MonitoringPolymarketOrderbook-status() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/polymarket/orderbook-status', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/polymarket/orderbook-status:', error);
    throw error;
  }
}

Call get polymarket orderbook status

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringPolymarketOrderbook-status() -> Dict[str, Any]:
    """
    Get Polymarket Orderbook Status
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/polymarket/orderbook-status'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/polymarket/orderbook-status: {e}')
        raise
GET /api/v1/monitoring/polymarket/status

Get Polymarket Status

Quick Polymarket WebSocket status check. Returns simplified status for monitoring/alerting. Usage: curl "https://api.spmc.dev/api/v1/monitoring/polymarket-status"

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/polymarket/status

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/polymarket/status" \
  -H "Content-Type: application/json"

Fetch get polymarket status

javascript
async function apiV1MonitoringPolymarketStatus() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/polymarket/status', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/polymarket/status:', error);
    throw error;
  }
}

Call get polymarket status

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringPolymarketStatus() -> Dict[str, Any]:
    """
    Get Polymarket Status
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/polymarket/status'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/polymarket/status: {e}')
        raise
GET /api/v1/monitoring/polymarket/subscription-analysis

Analyze Polymarket Subscriptions

Analyze Polymarket subscription patterns and identify issues. Returns detailed analysis of which markets are/aren't receiving updates.

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/polymarket/subscription-analysis

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/polymarket/subscription-analysis" \
  -H "Content-Type: application/json"

Fetch analyze polymarket subscriptions

javascript
async function apiV1MonitoringPolymarketSubscription-analysis() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/polymarket/subscription-analysis', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/polymarket/subscription-analysis:', error);
    throw error;
  }
}

Call analyze polymarket subscriptions

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringPolymarketSubscription-analysis() -> Dict[str, Any]:
    """
    Analyze Polymarket Subscriptions
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/polymarket/subscription-analysis'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/polymarket/subscription-analysis: {e}')
        raise

Polymarket Monitoring

GET /api/v1/monitoring/polymarket/metrics

Get Polymarket Metrics

Comprehensive metrics for Polymarket WebSocket system. Monitors: 1. WebSocket connection status and channel subscriptions 2. Message processing rates (book, ticker, orderbook updates) 3. Database update rates and latency 4. Data freshness per market 5. Token-specific metrics (YES/NO) Usage: curl "https://api.spmc.dev/api/v1/monitoring/polymarket-metrics"

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/polymarket/metrics

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/polymarket/metrics" \
  -H "Content-Type: application/json"

Fetch get polymarket metrics

javascript
async function apiV1MonitoringPolymarketMetrics() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/polymarket/metrics', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/polymarket/metrics:', error);
    throw error;
  }
}

Call get polymarket metrics

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringPolymarketMetrics() -> Dict[str, Any]:
    """
    Get Polymarket Metrics
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/polymarket/metrics'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/polymarket/metrics: {e}')
        raise
GET /api/v1/monitoring/polymarket/orderbook-status

Get Polymarket Orderbook Status

Get detailed Polymarket orderbook subscription status.

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/polymarket/orderbook-status

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/polymarket/orderbook-status" \
  -H "Content-Type: application/json"

Fetch get polymarket orderbook status

javascript
async function apiV1MonitoringPolymarketOrderbook-status() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/polymarket/orderbook-status', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/polymarket/orderbook-status:', error);
    throw error;
  }
}

Call get polymarket orderbook status

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringPolymarketOrderbook-status() -> Dict[str, Any]:
    """
    Get Polymarket Orderbook Status
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/polymarket/orderbook-status'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/polymarket/orderbook-status: {e}')
        raise
GET /api/v1/monitoring/polymarket/status

Get Polymarket Status

Quick Polymarket WebSocket status check. Returns simplified status for monitoring/alerting. Usage: curl "https://api.spmc.dev/api/v1/monitoring/polymarket-status"

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/polymarket/status

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/polymarket/status" \
  -H "Content-Type: application/json"

Fetch get polymarket status

javascript
async function apiV1MonitoringPolymarketStatus() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/polymarket/status', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/polymarket/status:', error);
    throw error;
  }
}

Call get polymarket status

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringPolymarketStatus() -> Dict[str, Any]:
    """
    Get Polymarket Status
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/polymarket/status'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/polymarket/status: {e}')
        raise
GET /api/v1/monitoring/polymarket/subscription-analysis

Analyze Polymarket Subscriptions

Analyze Polymarket subscription patterns and identify issues. Returns detailed analysis of which markets are/aren't receiving updates.

Platform Support: Polymarket Kalshi Limitless

Responses

200 Successful Response

Code Examples

Example GET request to /api/v1/monitoring/polymarket/subscription-analysis

curl
curl -X GET \
  "https://api.spmc.dev/api/v1/monitoring/polymarket/subscription-analysis" \
  -H "Content-Type: application/json"

Fetch analyze polymarket subscriptions

javascript
async function apiV1MonitoringPolymarketSubscription-analysis() {
  try {
    const response = await fetch('https://api.spmc.dev/api/v1/monitoring/polymarket/subscription-analysis', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error calling /api/v1/monitoring/polymarket/subscription-analysis:', error);
    throw error;
  }
}

Call analyze polymarket subscriptions

python
import requests
from typing import Dict, Any, Optional

def apiV1MonitoringPolymarketSubscription-analysis() -> Dict[str, Any]:
    """
    Analyze Polymarket Subscriptions
    
    
    Returns:
        API response as dictionary
    
    Raises:
        requests.exceptions.RequestException: If the request fails
    """
    try:
        url = 'https://api.spmc.dev/api/v1/monitoring/polymarket/subscription-analysis'
        headers = {
            "Content-Type": "application/json"
    }
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f'Error calling /api/v1/monitoring/polymarket/subscription-analysis: {e}')
        raise