API Dökümanları

PredictAPI REST API ve WebSocket akışları için kapsamlı referans

Base URL

https://api.predictapi.net

WebSocket

wss://ws.predictapi.net/ws

Authentication

Partner API endpoints use API key authentication. Include your key in the X-API-Key header:

curl -H "X-API-Key: pk_live_abc123..." \
     https://api.predictapi.net/api/v1/partner/markets

Response Format

All responses follow a consistent envelope format:

Success

{
  "success": true,
  "data": { ... },
  "meta": { "page": 1, ... }
}

Error

{
  "success": false,
  "error": {
    "code": "INVALID_INPUT",
    "message": "description"
  }
}

Obtain JWT tokens for panel access. Partner API endpoints use API key authentication instead.

POST/api/v1/auth/login

Authenticate with email and password. Returns a JWT token for panel/admin access.

Request

{
  "email": "[email protected]",
  "password": "your_password"
}

Response

{
  "success": true,
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIs...",
    "user": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "email": "[email protected]",
      "role": "partner_admin",
      "full_name": "John Doe"
    }
  }
}
GET/api/v1/auth/me
Bearer JWT

Get the currently authenticated user profile.

Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "email": "[email protected]",
    "role": "partner_admin",
    "full_name": "John Doe"
  }
}

Rate Limiting

API requests are rate-limited per API key. Default limits vary by plan:

Starter

60 req/min

Professional

300 req/min

Enterprise

Custom

Integration Flow

  1. 1Apply — Submit a partner application via the form or API.
  2. 2Get API Keys — Once approved, log into the partner panel and create API keys.
  3. 3Browse Markets — Use GET /partner/markets to list available markets.
  4. 4Place Orders — Submit orders via POST /partner/orders on behalf of your users.
  5. 5Handle Settlements — Poll GET /partner/settlements or receive webhooks to credit winning users.