{"id":18895643,"url":"https://github.com/binance/binance-connector-typescript","last_synced_at":"2025-04-05T18:05:50.614Z","repository":{"id":198111841,"uuid":"699263376","full_name":"binance/binance-connector-typescript","owner":"binance","description":"Simple Typescript connector to Binance API","archived":false,"fork":false,"pushed_at":"2025-03-24T05:17:53.000Z","size":683,"stargazers_count":88,"open_issues_count":0,"forks_count":31,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-29T17:03:09.821Z","etag":null,"topics":["binance-api","connector","crypto","library","market-data","real-time","spot","trading"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/binance.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-02T09:27:41.000Z","updated_at":"2025-03-24T12:21:36.000Z","dependencies_parsed_at":"2024-11-08T08:30:48.307Z","dependency_job_id":"64313488-1d3c-4c34-95bc-f2bc8e4e5f4d","html_url":"https://github.com/binance/binance-connector-typescript","commit_stats":null,"previous_names":["binance/binance-connector-typescript"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binance%2Fbinance-connector-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binance%2Fbinance-connector-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binance%2Fbinance-connector-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binance%2Fbinance-connector-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binance","download_url":"https://codeload.github.com/binance/binance-connector-typescript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378138,"owners_count":20929296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binance-api","connector","crypto","library","market-data","real-time","spot","trading"],"created_at":"2024-11-08T08:29:12.848Z","updated_at":"2025-04-05T18:05:50.584Z","avatar_url":"https://github.com/binance.png","language":"TypeScript","readme":"# Binance connector in Typescript - DEPRECATED\n\n[![npm version](https://badge.fury.io/js/@binance%2Fconnector-typescript.svg)](https://badge.fury.io/js/@binance%2Fconnector-typescript)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n**This repository is deprecated. Please use the new repository: [binance-connector-js](https://github.com/binance/binance-connector-js)**\n\nThis library is an easy, simple and clean connector to the [Binance public API](https://github.com/binance/binance-spot-api-docs). It is divided into three distinct endpoints:\n- [RESTful API](./src/spot.ts)\n- [Websocket API](./src/websocketAPI.ts)\n- [Websocket Stream](./src/websocketStream.ts)\n\n\n- Supported APIs:\n    - `/api/*`\n    - `/sapi/*`\n- Inclusion of test cases and examples\n- Request and response types\n\n## Installation\n\n```bash\nnpm install @binance/connector-typescript\n```\n\n## Documentation\n\n### RESTful APIs\n\nAll REST API endpoints are linked to a unique module called [`Spot`](./src/spot.ts#L4).\nTo start working with the REST API, you will need to import and create the client. Keep in mind that some of the endpoints require authentication with your API credentials keys:\n```typescript\nimport { Spot } from '@binance/connector-typescript';\n\nconst API_KEY = '';\nconst API_SECRET = '';\nconst BASE_URL = 'https://api.binance.com';\n\nconst client = new Spot(API_KEY, API_SECRET, { baseURL: BASE_URL });\nclient.exchangeInformation().then((res) =\u003e {\n    console.log(res);\n}).catch(err =\u003e { console.log(err) });\n```\nPlease look at [`examples/restful`](./examples/restful/) folder to check for more endpoints.\n\n#### Testnet\n\nWhile `/sapi/*` endpoints don't have testnet environment yet, `/api/*` endpoints can be tested in\n[Spot Testnet](https://testnet.binance.vision/). You can use it by changing the base URL:\n\n```typescript\n// provide the testnet base url\nconst client = new Spot(apiKey, apiSecret, { baseURL: 'https://testnet.binance.vision'})\n```\nIf base_url is not provided, it defaults to api.binance.com.\n\n### Websockets\n\n#### Websocket API Client\n\nAll websocket are available with the [`WebsocketAPI`](./src/websocketAPI.ts#L6) module.\nTo work with the websocket API, you will need to import the client and generate a callBack function to handle the messages:\n```typescript\nimport { WebsocketAPI } from '@binance/connector-typescript';\n\nconst API_KEY = '';\nconst API_SECRET = '';\n\nconst callbacks = {\n    open: (client: WebsocketAPI) =\u003e client.exchangeInfo(),\n    close: () =\u003e console.debug('Disconnected from WebSocket server'),\n    message: (data: string) =\u003e console.info(JSON.parse(data))\n}\nconst websocketAPIClient = new WebsocketAPI(API_KEY, API_SECRET, { callbacks });\nsetTimeout(() =\u003e websocketAPIClient.disconnect(), 20000);\n```\nPlease look at [`examples/websocketAPI`](./examples/websocketAPI/) folder to check for more endpoints.\n\n#### Websocket Stream Client\n\nAll websocket streams are available with the [`WebsocketStream`](./src/websocketStream.ts#L4) module.\nTo work with the websocket API, you will need to import the client and generate a callBack function to handle the messages:\n```typescript\nimport { WebsocketStream } from '@binance/connector-typescript';\n\nconst callbacks = {\n  open: () =\u003e console.debug('Connected to WebSocket server'),\n  close: () =\u003e console.debug('Disconnected from WebSocket server'),\n  message: (data: string) =\u003e console.info(data)\n}\n\nconst websocketStreamClient = new WebsocketStream({ callbacks });\nwebsocketStreamClient.aggTrade('bnbusdt');\nsetTimeout(() =\u003e websocketStreamClient.disconnect(), 6000);\n```\nPlease look at [`examples/websocketStream`](./examples/websocketStream/) folder to check for more endpoints.\n\n## Test\n\n```bash\nnpm install\n\nnpm run test\n```\n\n## Limitation\n\nFutures and European Options APIs are not supported:\n\n  - `/fapi/*`\n  - `/dapi/*`\n  - `/eapi/*`\n  -  Associated Websocket Market and User Data Streams\n\n## License\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinance%2Fbinance-connector-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinance%2Fbinance-connector-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinance%2Fbinance-connector-typescript/lists"}