const response =awaitfetch('https://jupiter.digitalbkk.cloud/api/v1/sheets',{headers:{'X-API-Key':'your_api_key','X-Client-ID':'your_client_id'}});const data =await response.json();console.log(data);
<?php// Using Guzzlerequire'vendor/autoload.php';$client=newGuzzleHttp\Client(['base_uri'=>'https://jupiter.digitalbkk.cloud/api/v1','headers'=>['X-API-Key'=>'your_api_key','X-Client-ID'=>'your_client_id']]);$response=$client->get('/sheets');$data=json_decode($response->getBody(),true);print_r($data);
The API is pay-as-you-go. There are no subscription plans, and no request rate limit is published or enforced by the API. Chargeable requests deduct their price from your wallet balance when the request is made, so a request that is later rejected or fails to process is still charged. Top up your wallet in the dashboard.
Request
Cost (USD)
Upload a sheet for processing
$0.03
Reprocess a sheet
$0.03
Process a sheet directly
$0.03
Create a template
$0.05
Update a template
$0.05
Upload a template image
$0.05
Creating a template from a new image is a two-step flow: uploading the template image and saving the template are each charged $0.05. Reading data is free: listing and fetching sheets, answers, templates and template images are not charged.
When your balance is too low for a chargeable request, the API answers with 402 Payment Required and a message that includes your current balance and the cost of the request.
Supported Files
Sheet and template images can be JPG, JPEG or PNG files up to 10 MB each. Upload one sheet per request. Results are returned as JSON, and the web app also exports them as CSV or TXT.
Error Handling
The API uses conventional HTTP response codes to indicate the success or failure of an API request:
Code Range
Description
2xx
Success - The request was successfully received and processed
4xx
Client Error - Invalid input, authentication issues, or missing parameters
5xx
Server Error - Something went wrong on our end
Common Error Codes
Code
Description
401
Invalid or missing API key
402
Insufficient balance for a chargeable request
403
API key doesn't have permission
404
Sheet, template or other resource not found
500
Internal server error
Error Response Format
When an error occurs, you'll receive a JSON response with details:
Error Response Format
Example error response
interfaceValidationError{loc:(string|number)[];// Location of the error (e.g., ["body", "field_name"])msg:string;// Error messagetype:string;// Error type identifier}interfaceErrorResponse{detail: ValidationError[];}// Example error response{"detail":[{"loc":["body","sheet_type"],"msg":"Field required","type":"value_error.missing"},{"loc":["body","file"],"msg":"File type not supported","type":"value_error.file"}]}
// Example error handlingtry{const response =awaitfetch('https://jupiter.digitalbkk.cloud/api/v1/sheets',{method:'POST',headers:{'X-API-Key':'your_api_key','X-Client-ID':'your_client_id'}});if(!response.ok){const error =await response.json();console.error('API Error:', error.detail);// Handle specific error casesif(response.status===402){// Insufficient balance: top up the wallet before retryingconsole.log('Insufficient balance:', error.detail);}}}catch(error){console.error('Network error:', error);}
<?phptry{$response=$client->post('/sheets',['multipart'=>[['name'=>'file','contents'=>fopen('sheet.jpg','r')],['name'=>'sheet_type','contents'=>'SHEET_50']]]);}catch(GuzzleHttp\Exception\ClientException$e){$error=json_decode($e->getResponse()->getBody(),true);echo"API Error: ".print_r($error['detail'],true);// Handle insufficient balanceif($e->getResponse()->getStatusCode()===402){echo"Insufficient balance: top up your wallet before retrying.";}}catch(GuzzleHttp\Exception\ServerException$e){echo"Server error: ".$e->getMessage();}
Validation Errors
The API performs validation on request parameters and will return detailed error messages when validation fails. Common validation errors include:
Missing required fields
Invalid field values or formats
File type or size restrictions
Authentication or permission issues
Best Practices for Error Handling
Always check response status codes - Don't assume requests will succeed
Parse error responses - Extract useful information from error messages
Handle insufficient balance - A 402 response means the wallet needs a top-up; do not retry until it is funded
Implement exponential backoff - When retrying failed requests caused by network or server errors
Log errors appropriately - Store error details for debugging
Show user-friendly messages - Transform API errors into readable messages for end-users
Sheets API
The Sheets API allows you to process and manage OMR answer sheets.