KLCI Screener API

RESTful API for mobile apps and third-party integrations

Getting Started

Welcome to the KLCI Screener API! This RESTful API allows you to integrate KLCI trading signals, portfolio management, and channel functionality into your applications.

Your API Key

To use the API, you need an API key. Generate one from your dashboard.

klci_live_1234567890abcdef1234567890abcdef
Generate API Key

Base URL

https://api.klciscreener.com/v1

All API requests should be made to this base URL. The API uses HTTPS for all requests.

Authentication

The KLCI API uses API keys to authenticate requests. Include your API key in the request header:

X-API-Key: your_api_key_here
Bearer Token Authentication

For user-specific endpoints, use Bearer token authentication:

Authorization: Bearer your_jwt_token_here

Authentication Endpoints

POST /api/auth/login

Authenticate user and receive access token.

Request Body:
Parameter Type Required Description
username string Required Username or email
password string Required User password
remember_me boolean Optional Extended session duration
Response Example:
{
    "success": true,
    "data": {
        "user": {
            "id": 1,
            "username": "john_doe",
            "email": "john@example.com",
            "subscription_active": true
        },
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
        "expires_at": "2024-12-31T23:59:59Z"
    }
}
Try it out
POST /api/auth/register

Create a new user account.

POST /api/auth/logout

Invalidate current access token.

Signal Endpoints

GET /api/signals/list

Retrieve list of trading signals.

Query Parameters:
Parameter Type Description
channel_id integer Filter by channel ID
symbol string Filter by stock symbol
action string Filter by action (BUY/SELL/HOLD)
date_from date Start date (YYYY-MM-DD)
date_to date End date (YYYY-MM-DD)
limit integer Number of results (default: 20, max: 100)
offset integer Pagination offset
GET /api/signals/get/{id}

Get details of a specific signal.

Channel Endpoints

GET /api/channels/list

Get list of user's channels.

POST /api/channels/create

Create a new signal channel.

PUT /api/channels/update/{id}

Update channel settings.

DELETE /api/channels/delete/{id}

Delete a channel.

Webhook Endpoints

POST /api/webhook-tradingview

Receive signals from TradingView alerts.

Webhook URL for TradingView:
https://api.klciscreener.com/v1/webhook-tradingview?key=your_webhook_key
Alert Message Format:
{
    "symbol": "{{ticker}}",
    "action": "{{strategy.order.action}}",
    "price": {{close}},
    "time": "{{timenow}}",
    "message": "Your custom message"
}
POST /api/webhook-telegram

Receive signals from Telegram bot.

Rate Limits

API Rate Limiting

To ensure fair usage and system stability, the API implements rate limiting:

  • Free Plan: 100 requests per hour
  • Basic Plan: 1,000 requests per hour
  • Premium Plan: 5,000 requests per hour
  • Pro Plan: Unlimited requests
Rate Limit Headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200

Error Codes

Status Code Error Code Description
200 SUCCESS Request successful
201 CREATED Resource created successfully
400 BAD_REQUEST Invalid request parameters
401 UNAUTHORIZED Authentication required
403 FORBIDDEN Access denied
404 NOT_FOUND Resource not found
429 RATE_LIMITED Too many requests
500 SERVER_ERROR Internal server error
Error Response Format:
{
    "success": false,
    "error": {
        "code": "UNAUTHORIZED",
        "message": "Invalid API key provided",
        "details": "Please check your API key and try again"
    }
}

Code Examples

JavaScript (Fetch API)
// Get signals
const getSignals = async () => {
    const response = await fetch('https://api.klciscreener.com/v1/signals/list', {
        method: 'GET',
        headers: {
            'X-API-Key': 'your_api_key_here',
            'Content-Type': 'application/json'
        }
    });
    
    const data = await response.json();
    console.log(data);
};

// Create channel
const createChannel = async (channelData) => {
    const response = await fetch('https://api.klciscreener.com/v1/channels/create', {
        method: 'POST',
        headers: {
            'Authorization': 'Bearer your_token_here',
            'Content-Type': 'application/json'
        },
        body: JSON.stringify(channelData)
    });
    
    const data = await response.json();
    return data;
};
PHP (cURL)
// Get signals
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.klciscreener.com/v1/signals/list');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-API-Key: your_api_key_here',
    'Content-Type: application/json'
]);

$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);

print_r($data);
Python (Requests)
import requests

# Get signals
headers = {
    'X-API-Key': 'your_api_key_here',
    'Content-Type': 'application/json'
}

response = requests.get('https://api.klciscreener.com/v1/signals/list', headers=headers)
data = response.json()

print(data)

SDKs & Libraries

Official SDKs are available for popular programming languages:

JavaScript/Node.js
npm install @klciscreener/sdk
Python
pip install klciscreener
PHP
composer require klciscreener/sdk
Java
Coming Soon

Support & Resources

Documentation

Comprehensive API guides

View Docs
Community

Join our Discord server

Join Discord
Email Support

Get help from our team

Contact Us