Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/markzuckerbergas/gbmplus-api-python/llms.txt

Use this file to discover all available pages before exploring further.

By the end of this page you will have the gbmplus library installed, your GBM+ credentials configured as environment variables, and a working Python script that authenticates with the platform and retrieves the list of your investment strategies (accounts). The whole process takes under five minutes.
1

Install the library

Install gbmplus from the Python Package Index using pip:
pip install gbmplus
If your system has both Python 2 and Python 3 installed, use pip3 to ensure the package is installed for Python 3:
pip3 install gbmplus
If you already have a previous version of gbmplus installed and want to upgrade to the latest release, run:
pip install --upgrade gbmplus
2

Obtain your credentials

The SDK requires three credentials to authenticate with GBM+:
  • USER_EMAIL — the email address you use to log in to GBM+.
  • USER_PASSWORD — your GBM+ account password.
  • CLIENT_ID — a client identifier associated with your GBM+ session.
Finding your CLIENT_ID: The CLIENT_ID is not the same as your account or contract number. To find it, open the GBM+ login page in your browser, open the developer tools (F12), go to the Network tab, and log in. Inspect the POST request sent to auth.gbm.com — the clientid field in the request body is your CLIENT_ID. The project README also includes a screenshot showing exactly where to look.
Keep all three values secret and never commit them to source control.
3

Set environment variables

The recommended way to supply credentials is through environment variables. The SDK reads USER_EMAIL, USER_PASSWORD, and CLIENT_ID from your shell environment at startup.
export USER_EMAIL="your@email.com"
export USER_PASSWORD="your_password"
export CLIENT_ID="your_client_id"
Add these lines to your ~/.bashrc, ~/.zshrc, or equivalent shell profile to persist them across sessions.
4

Instantiate the client

Import the library and create a GBMPlusAPI instance. A single object manages your entire session:
import gbmplus

gbm = gbmplus.GBMPlusAPI(output_log=False)
As soon as GBMPlusAPI is instantiated, the SDK automatically:
  1. Reads your credentials from the environment variables you set in the previous step.
  2. Authenticates against https://auth.gbm.com/api/v1/session/user and stores your Bearer access token.
  3. Fetches your primary contract ID from https://api.gbm.com/v1/contracts, which is required by most subsequent API calls.
Setting output_log=False suppresses creation of a log file on disk. You can omit this parameter (or set it to True) to keep a timestamped log of all API activity.
5

Make your first API call

Retrieve the list of all your strategies (accounts) and print the result:
accounts = gbm.accounts.getAccounts()
print(accounts)
You can also look up a single account by its strategy name. For example, to retrieve only the Smart Cash strategy:
account = gbm.accounts.getAccount("Smart Cash")
print(account)
Both calls follow the client.scope.operation() pattern — gbm is the client, accounts is the scope (module), and getAccounts() / getAccount() are the operations.
The GBMPlusAPI constructor accepts several additional parameters to fine-tune session behaviour — including request timeouts, retry logic, and logging options. See the Configuration guide for the full list of available settings and their defaults.
Never hardcode credentials in your source code. Storing USER_EMAIL, USER_PASSWORD, or CLIENT_ID as plain strings in a script exposes them to anyone who can read the file, including version control history. Always use environment variables, a secrets manager, or a .env file that is excluded from source control via .gitignore.

Build docs developers (and LLMs) love