A set of wrapper classes that make using The Bot Place API easier — licensing, customers and job-delivery checks for MT5 bots.
The same CTbpBase / CTbpCustomers / CTbpJobs surface is implemented three times: MQL5, C++ and Python, each using the native HTTP/JSON stack of its ecosystem.
---
## Main Features
- **Three parallel implementations, one API shape**: MQL5 (`Src/MQL5`) uses `WebRequest` + [JsonParserByLeo](https://forge.mql5.io/nique_372/JsonParserByLeo)'s `CJsonParser`; C++ (`Src/C++`) uses libcurl through a small `CHttpClient` wrapper + [simdjson](https://github.com/simdjson/simdjson); Python (`Src/Py`) uses `requests` + its built-in `.json()`. Method names, parameters and behavior match across all three.
- **`CTbpBase`**: holds the api-key and timeout, exposes `GetAllClients()` and the last parsed JSON response (`GetLastJson()` / `m_json`, depending on language).
- **`CTbpCustomers`**: license and customer checks — `GetCustomersSotfware()`, `UserHasSoftware()` (with additional-data binding, e.g. account login), `UserHastSoftwareNoaAdditionalData()` (resale-friendly, no additional-data check), `UserHastSoftwareTelegram()`, `FirstDemoDowlandSoftware()`.
- **`CTbpJobs`**: `GetJobSoftwareAccess()` and `CheckJobDeliveryAccess()`, for validating access to marketplace job deliveries.
- **`ITbpAdditionalData`**: small interface to plug in whatever "additional data" your license check binds to (account login, machine id, etc). MQL5 ships a ready `CAddtionalDataTbpAccountLoggin` that resolves to `AccountInfoInteger(ACCOUNT_LOGIN)`.
- **Wraps every documented endpoint** from [thebotplace.com/documentation](https://thebotplace.com/documentation): job delivery access, all customers, customers of a software, user-has-software (with/without additional data, and the Telegram variant), and first demo download.
### Usage examples
**MQL5:**
```mql5
#include
TSN::CTbpCustomers tbp;
tbp.ApyKey("YOUR_API_KEY");
tbp.SoftwareId("YOUR_SOFTWARE_ID");
tbp.AdditionalData(new TSN::CAddtionalDataTbpAccountLoggin(), true);
bool has_license = false;
if(tbp.UserHasSoftware(InpUserId, has_license) && has_license)
{
Print("Licencia activa");
}
```
**C++:**
```cpp
#include "tbp_api_warper_cpp/Customers.hpp"
TSN::CTbpCustomers tbp;
tbp.ApyKey("YOUR_API_KEY");
tbp.SoftwareId("YOUR_SOFTWARE_ID");
bool has_license = false;
if (tbp.UserHastSoftwareNoaAdditionalData("user-id", has_license) && has_license)
{
// licencia activa
}
```
**Python:**
```python
from tbp_api_wraper_py import CTbpCustomers
tbp = CTbpCustomers()
tbp.m_api_key = "YOUR_API_KEY"
tbp.m_software_id = "YOUR_SOFTWARE_ID"
ok, has_license = tbp.UserHastSoftwareNoaAdditionalData("user-id")
if ok and has_license:
print("Licencia activa")
```
---
## Repository Structure
```
TbpWrraper/
├── Src/ # MQL5, C++ and Py implementations (one folder per language)
├── CppEx/ # Standalone C++ usage example
└── Workflows/ # MQL5 test scripts and CI workflow entry (EA.mq5)
```
---
## Requirements
See [dependencies.json](./dependencies.json) for the full list.
- MetaTrader 5, build 5430+ (MQL5) — depends on [JsonParserByLeo](https://forge.mql5.io/nique_372/JsonParserByLeo) and [MQLArticles](https://forge.mql5.io/nique_372/MQLArticles) (`CLoggerBase`)
- C++17+ — depends on [CppBases](https://forge.mql5.io/nique_372/CppBases) (`CLoggerBase`), libcurl and [simdjson](https://github.com/simdjson/simdjson) (see `vcpkg.json`)
- Python >= 3.10.9 — depends on `tsn_utils` (`CLoggerBase`) and `requests` (see `requirements.txt`)
- WebRequest / outbound HTTPS access to `europe-west2-thebotplace.cloudfunctions.net` must be allowed (MT5: add to the WebRequest whitelist)
---
## Installation
```bash
cd "C:\Users\YOUR_USER\AppData\Roaming\MetaQuotes\Terminal\YOUR_ID\MQL5\Shared Projects"
tsndep install "https://forge.mql5.io/nique_372/TbpWrraper.git"
```
Requires the `tsndep` package, available on [PyPI](https://pypi.org/project/tsndep). It automatically installs the MQL5 dependencies and runs the Python/C++ hooks declared in `dependencies.json` (`pip install -r requirements.txt`, `vcpkg install`).
### Python package (standalone)
The Python implementation is also published as its own package, without needing `tsndep` or the rest of the repo:
- **PyPI:** [tbp-api-wraper-py](https://pypi.org/project/tbp-api-wraper-py/)
- **Forge registry:** [tbp-api-wraper-py 2.5.0](https://forge.mql5.io/nique_372/-/packages/pypi/tbp-api-wraper-py/2.5.0)
```bash
pip install tbp-api-wraper-py
```
---
## Quick Start
**1. Get your api-key** from [The Bot Place](https://thebotplace.com) and your software id from your bot's dashboard.
**2. Include/import the wrapper for your language** (see usage examples above).
**3. Call the endpoint you need** — results come back either as a return value (`bool`/`out` params) or in the last parsed JSON document, depending on the call (see inline comments in each `Customers`/`Jobs` file — every method states where its result lives).
---
## License
**[Read Full License](./LICENSE)**
By downloading or using this repository, you accept the license terms.
---
## Contact
- **Platform:** [MQL5 Community](https://www.mql5.com/es/users/nique_372)
- **Profile:** https://www.mql5.com/es/users/nique_372
- **Articles:** https://www.mql5.com/es/users/nique_372/publications