RESTful API for mobile apps and third-party integrations
Welcome to the KLCI Screener API! This RESTful API allows you to integrate KLCI trading signals, portfolio management, and channel functionality into your applications.
To use the API, you need an API key. Generate one from your dashboard.
klci_live_1234567890abcdef1234567890abcdef
https://api.klciscreener.com/v1
All API requests should be made to this base URL. The API uses HTTPS for all requests.
The KLCI API uses API keys to authenticate requests. Include your API key in the request header:
X-API-Key: your_api_key_here
For user-specific endpoints, use Bearer token authentication:
Authorization: Bearer your_jwt_token_here
/api/auth/login
Authenticate user and receive access token.
| Parameter | Type | Required | Description |
|---|---|---|---|
| username | string | Required | Username or email |
| password | string | Required | User password |
| remember_me | boolean | Optional | Extended session duration |
{
"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"
}
}
/api/auth/register
Create a new user account.
/api/auth/logout
Invalidate current access token.
/api/signals/list
Retrieve list of trading signals.
| 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 |
/api/signals/get/{id}
Get details of a specific signal.
/api/channels/list
Get list of user's channels.
/api/channels/create
Create a new signal channel.
/api/channels/update/{id}
Update channel settings.
/api/channels/delete/{id}
Delete a channel.
/api/webhook-tradingview
Receive signals from TradingView alerts.
https://api.klciscreener.com/v1/webhook-tradingview?key=your_webhook_key
{
"symbol": "{{ticker}}",
"action": "{{strategy.order.action}}",
"price": {{close}},
"time": "{{timenow}}",
"message": "Your custom message"
}
/api/webhook-telegram
Receive signals from Telegram bot.
To ensure fair usage and system stability, the API implements rate limiting:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200
| 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 |
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key provided",
"details": "Please check your API key and try again"
}
}
// 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;
};
// 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);
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)
Official SDKs are available for popular programming languages: