gexbot api
general

authentication

Authenticate REST requests using Bearer tokens, API keys, and required headers.

The gexbot API uses API Keys for request authentication.


Authorization Header & User-Agent

Include your API Key in the Authorization HTTP header for all authenticated requests. The API also requires a descriptive User-Agent header.

Authorization: Bearer <YOUR_API_KEY>
User-Agent: <YOUR_APP_NAME>/1.0

Example Request

BASE_URL="<your host and version>"

curl -X GET "$BASE_URL/SPX/classic/gex_full" \
  -H "Authorization: Bearer gexbot_custom_abcdef123456" \
  -H "User-Agent: MyTradingApp/1.0" \
  -H "Accept: application/json"

Public vs. Authenticated Endpoints

  • Public Endpoints: GET /tickers, GET /tickers/quant and GET /{package}/categories are open and unauthenticated. Every request still requires the User-Agent header.
  • Package-Gated Endpoints: Endpoints under /{ticker}/classic/*, /{ticker}/state/* and /{ticker}/orderflow/* require an active subscription that includes the package.
  • All Paid Tiers: The end-of-day report GET /hist/eod/{ticker} and the futures conversion GET /futures/conversion are available to Classic, State, Orderflow and Quant. A Research API key cannot call them.
  • Quant-Tier Endpoints: Bulk historical downloads (/hist/{ticker}/{package}/{category}/{date}), option expiration lookups (/options/{ticker}/expiries), and WebSocket streaming negotiation (POST /negotiate) require an active Quant Tier subscription.
  • Research Endpoints: /research/* require a Research API key. You can create one only with the active Research add-on.
  • API Key Formats:
    • A custom gexbot API key has the format gexbot_custom_<43 characters> (for example Bearer gexbot_custom_<secret>). A platform-integration key uses the platform name in place of custom.
    • A Research API key has the format research_<43 characters>. Research API endpoints (/research/*) accept only this key.
    • API keys are product-specific and not interchangeable.

Identify the Authenticated Account

GET/whoami

Use GET /whoami to verify an API key and inspect its access. The response includes the account's subscription levels, add-ons, entitlements, permissions, account flags, and masked API key metadata. A gexbot API key or a gexbot research API key can call this endpoint, even when the plan does not include REST data access. A key for another product, such as a skewbot key, receives 403 Forbidden. Session cookies cannot authenticate the request.

Request

curl "https://api.gex.bot/whoami" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "User-Agent: <YOUR_APP_NAME>/1.0" \
  -H "Accept: application/json"

Headers

NameTypeDescription
AuthorizationstringRequired. Use Bearer <YOUR_API_KEY>.
User-AgentstringRequired. Identify your client application.
AcceptstringRequired. Set to application/json.

Response

A successful response sets Cache-Control: no-store. It never returns the API key secret.

FieldTypeDescription
_idstringUser identifier.
rolestringAccount role.
levelstring[]Deprecated. Each subscription level of the account. Read entitlements.gexbot.level instead.
max_levelstringDeprecated. The highest subscription level of the account. Read entitlements.gexbot.level instead.
addonsstring[]Deprecated. Each subscription add-on of the account. Read entitlements.gexbot.addons instead.
entitlementsobjectPaid access for each product family.
entitlements.gexbot.levelstringThe highest subscription level of the account, as one string. Package access checks this value.
entitlements.gexbot.addonsstring[]Each subscription add-on of the account.
permissionsstring[]Permission flags held by the account.
accountobjectCommercial, delegated, child-seat, and managed-account flags.
api_keyobjectMetadata for the API key used in this request. The id is masked.
createdstring | nullAccount creation time in ISO 8601 format.

Deprecated fields

level, max_level and addons are deprecated fields. The response keeps them for older clients. Read entitlements.gexbot in new code. entitlements.gexbot.level is one string, not an array. When level holds more than one level, entitlements.gexbot.level holds the highest one. When level is empty, entitlements.gexbot.level is free.

{
  "_id": "0123456789abcdef01234567",
  "role": "user",
  "level": [
    "orderflow"
  ],
  "max_level": "orderflow",
  "addons": [],
  "entitlements": {
    "gexbot": {
      "level": "orderflow",
      "addons": []
    },
    "skewbot": {
      "active": false,
      "tier": null
    }
  },
  "permissions": [
    "app_access",
    "api_rest_access",
    "api_websocket_access"
  ],
  "account": {
    "commercial": false,
    "commercial_delegate": false,
    "display_use": false,
    "child": false,
    "managed": false,
    "delegated": false
  },
  "api_key": {
    "id": "gexbot_custom_...AbCd",
    "label": "custom_key",
    "product": "gexbot",
    "integration": "custom",
    "created_at": "2025-01-15T14:30:00Z"
  },
  "created": "2025-01-10T12:00:00Z"
}

Status Codes

StatusDescription
200 OKThe response contains the account and masked API key metadata.
400 Bad RequestThe request is invalid.
401 UnauthorizedThe API key is missing, unknown, expired, or revoked.
403 ForbiddenThe key is for another product, such as a skewbot key, or the parent account suspended the commercial child seat.
429 Too Many RequestsThe caller exceeded a configured limit.

On this page