{"id":19674099,"url":"https://github.com/longbridge/openapi-cpp","last_synced_at":"2026-01-30T02:01:43.770Z","repository":{"id":41704463,"uuid":"486467061","full_name":"longbridge/openapi-cpp","owner":"longbridge","description":"Longbridge OpenAPI SDK for C++","archived":false,"fork":false,"pushed_at":"2022-05-12T14:33:24.000Z","size":319,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-06-05T08:14:37.850Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","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/longbridge.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-28T06:06:41.000Z","updated_at":"2022-05-19T01:10:01.000Z","dependencies_parsed_at":"2022-08-10T11:14:01.627Z","dependency_job_id":null,"html_url":"https://github.com/longbridge/openapi-cpp","commit_stats":null,"previous_names":["longbridge/openapi-cpp"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/longbridge/openapi-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longbridge%2Fopenapi-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longbridge%2Fopenapi-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longbridge%2Fopenapi-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longbridge%2Fopenapi-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/longbridge","download_url":"https://codeload.github.com/longbridge/openapi-cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longbridge%2Fopenapi-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28895737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T21:06:44.224Z","status":"online","status_checked_at":"2026-01-30T02:00:06.810Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-11T17:17:13.384Z","updated_at":"2026-01-30T02:01:43.738Z","avatar_url":"https://github.com/longbridge.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Longbridge OpenAPI SDK for C++\n\n- [简体中文](./README_zh.md)\n- [繁体中文](./README_hk.md)\n\n## User Guide\n\nLongbridge OpenAPI SDK offer to use your [Auth](https://open.longbridgeapp.com) to create HttpClient and WebSocketClient.\n\nHttpClient has `get`, `post`, `put`, `del` method, and you can use it to call the [API](https://open.longbridgeapp.com/docs) conveniently.\n\nWebSocketClient has `send_request` method, and you can register the message callback and the WebSocket State callback.\nYou can have the user-defined function to handle the push message and WebSocket State change. \n\nMeanwhile the SDK offer the log utility, user can have custom log path, and default path is  [path](https://docs.rs/dirs/4.0.0/dirs/fn.data_local_dir.html) `/Longbridge OpenAPI`，\nexcept macOS system's is `$HOME/Library/Logs/Longbridge OpenAPI`. The log file default is `longbridge.log`.\n\n**If you have any question about using the SDK, please raising an issue。**\n\n### Requirement\n\n- C++ compile (at least C++11 standard)\n  - clang (MacOS)\n  - gcc (Unix)\n  - msvc (Windows only)\n- CMake build system\n- Protobuf installed\n\n### Usage\n### Download the SDK\n   ```bash\n   # clone sdk repo\n   cd /your/path\n   git clone https://github.com/longbridgeapp//openapi-cpp.git\n   # init submodule about proto\n   cd openapi-cpp\n   git submodule update --init\n   ```\n\n\u003e NOTE: Use need know yourself dev environment, and select the suitable arch static lib.\n\nOpen the [Longbridge OpenAPI official site](https://open.longbridgeapp.com/account), and get your\n**App Key**, **App Secret**, **Access Token**.\n\nUnzip the downloaded static lib to the path `openapi-cpp/lib`.\n\nAnd you can use the SDK's HttpClient and WebSocketClient develop yourself application.\n\n## Run Demo\n\nReplacing the `app_key`, `app_secret`, `access_token` in `demo/src/const/value.h` as the value you get from forward step.\n\n- Clion user can open the project, and demo has three binary target, you can run directly.\n- Unix-like user else can run follow shell.\n\n  ```bash\n  cd /path/to/lb-openapi-cpp\n  mkdir build\n  cmake ..\n  make\n\n  # run the binary\n  # cd demo\n  # ./http\n  # ./ws_test\n  # ./logger\n  ```\n\n- Windows user can config cmake plugin in VS Code, press `CMD + Shift + P` open the command window, input `CMake:Config`, auto create the build directory.\nand the bottom button run the selected binary.\n- Other user can read the follow Fully Document to config project as yourself.\n\n## User Fully Document\n\n### Project Dir\n\n```bash\ndemo\n └─src -- demo src\n    └─proto -- protobuf generate .cc/.h file\ndocs -- gendoc.sh will gen the doc in the directory\ninclude -- SDK include file\nlib -- User downloaded static lib\nproto -- proto definition\nsrc -- SDK cpp implementation\n```\n\n### Project compose\n\nSDK mostly contain:\n\n- HttpClient \n- WebSocketClient \n- Log utility\n- proto file\n- demo example\n\n\n#### About Protobuf\n`proto` directory submodule another repo, store the Protobuf Message definition from [the site](https://open.longbridgeapp.com/docs),  `demo/src/proto` store the generated cpp from proto file.\nYou can generate the cpp file by yourself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flongbridge%2Fopenapi-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flongbridge%2Fopenapi-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flongbridge%2Fopenapi-cpp/lists"}