Bitget TypeScript SDK example: rest-public-spot.ts
Bitget V2 Classic REST REST public spot example for the Siebly Bitget SDK, with TypeScript source for exchange REST API and WebSocket integration, setup, and production SDK docs.
What This Example Covers
- Bitget REST API example in TypeScript.
- Uses the Siebly Bitget SDK package
bitget-apiinstead of hand-written HTTP request plumbing. - Source path:
Bitget/V2 - Classic/Rest/rest-public-spot.ts. - Example category: V2 Classic REST.
- Imports SDK symbols including
RestClientV2. - Calls SDK methods such as
getSpotCandles().
How To Use This Example
- Start here for the specific request or stream pattern, then check the matching SDK guide for install, credentials, and operational notes.
- Open the repository source when you need the latest committed version: GitHub source file.
Example Path
Bitget/V2 - Classic/Rest/rest-public-spot.ts
Source Link
Repository source: https://github.com/sieblyio/crypto-api-examples/blob/master/examples/Bitget/V2 - Classic/Rest/rest-public-spot.ts
Related SDK Docs
Example Source
import { RestClientV2 } from 'bitget-api';
const restClient = new RestClientV2();
(async () => {
try {
const response = await restClient.getSpotCandles({
symbol: 'BTCUSDT',
granularity: '1min',
limit: '1000',
});
console.table(response.data);
console.log('getCandles: ', response.data.length);
} catch (e) {
console.error('request failed: ', e);
}
})();