Skip to content

API Reference

Igor Sazonov edited this page Jul 21, 2026 · 1 revision

The CoinQuantClient provides methods corresponding to all 37 public endpoints of the CoinQuant API [1]. All methods return the decoded JSON payload as a plain PHP array, representing the data key of the API response.

Health

Endpoint Method
GET /health health(): array

Chats

Endpoint Method
GET /v1/chats listChats(array $options = []): array
POST /v1/chats createChat(array $data): array
GET /v1/chats/{id} getChat(string $id): array
PATCH /v1/chats/{id} updateChat(string $id, array $data): array
DELETE /v1/chats/{id} deleteChat(string $id): array
GET /v1/chats/{id}/messages listMessages(string $id, array $options = []): array
POST /v1/chats/{id}/messages appendMessage(string $id, array $data): array
POST /v1/chats/{id}/messages:stream streamChatMessage(string $id, string $content, array $options = []): Generator
POST /v1/prompts/stream streamPrompt(string $message, ?string $chatId = null, array $options = []): Generator
Helper prompt(string $message, ?string $chatId = null, array $options = []): StreamResult

Strategies

Endpoint Method
GET /v1/strategies listStrategies(array $options = []): array
POST /v1/strategies createStrategy(array $data): array
Helper finalizeChat(string $chatId, ?string $name = null, ?string $description = null): array
GET /v1/strategies/{id} getStrategy(string $id): array
PATCH /v1/strategies/{id} updateStrategy(string $id, array $data): array
GET /v1/strategies/{id}/versions listStrategyVersions(string $id, array $options = []): array
GET /v1/strategies/{id}/versions/{vid} getStrategyVersion(string $id, string $vid): array
PATCH /v1/strategies/{id}/versions/{vid} updateStrategyVersion(string $id, string $vid, array $data): array

Backtests

Endpoint Method
GET /v1/backtests listBacktests(array $options = []): array
POST /v1/backtests createBacktest(string $strategyVersionId): array
GET /v1/backtests/{id} getBacktest(string $id): array
GET /v1/backtests/{id}/results getBacktestResults(string $id): array
GET /v1/backtests/{id}/exports/summary.csv getBacktestSummaryCsv(string $id): string
GET /v1/backtests/{id}/exports/trades.csv getBacktestTradesCsv(string $id): string
POST /v1/backtests/compare compareBacktests(array $ids): array
POST /v1/backtests/{id}/duplicate duplicateBacktest(string $id): array
Helper createBacktestAndWait(string $strategyVersionId, int $timeoutSeconds = 900, int $pollIntervalSeconds = 5): array

Reports

Endpoint Method
GET /v1/reports listReports(array $options = []): array
GET /v1/reports/{id} getReport(string $id): array

Templates

Endpoint Method
GET /v1/templates listTemplates(array $options = []): array
GET /v1/templates/{id} getTemplate(string $id): array

Credits

Endpoint Method
GET /v1/credits getCredits(): array
GET /v1/credits/usage getCreditUsage(array $options = []): array
GET /v1/credits/transactions listCreditTransactions(array $options = []): array
GET /v1/credits/estimates/tick estimateTickCredits(int $days, int $minutes): array

Community

Endpoint Method
GET /v1/community/leaderboards listLeaderboards(array $options = []): array
GET /v1/community/backtests listCommunityBacktests(array $options = []): array
GET /v1/community/backtests/{id} getCommunityBacktest(string $id, string $include = ''): array
GET /v1/community/me getCommunityMe(string $include = ''): array
GET /v1/community/me/activities listCommunityActivities(array $options = []): array

Error Handling

Any non-2xx response from the API will throw a CoinQuantException. This exception contains useful methods for debugging [1]:

use CoinQuant\Exceptions\CoinQuantException;

try {
    $credits = $client->getCredits();
} catch (CoinQuantException $e) {
    echo "HTTP Status: " . $e->getHttpStatus() . "\n";
    echo "Machine Code: " . $e->getErrorCode() . "\n";
    echo "Request ID: " . $e->getRequestId() . "\n";
    echo "Message: " . $e->getMessage() . "\n";
}

When contacting CoinQuant support, always provide the Request ID as it allows them to trace the exact API call.


References

[1] CoinQuant PHP SDK README

Clone this wiki locally