Skip to content

Call any BitBadges API route from the terminal with bb api, search routes, print schemas, and attach a session.

bb api <group> <route> [path-params] [flags] calls a BitBadges API route. The route list is generated from the OpenAPI spec, so bb api --help and bb api --search are the current inventory.

Example

bash
bb api tokens get-collection 1
bb api accounts get-account --body '{"address":"bb1p0rrel3365scadq5k9pv0x0zp9j22js6dnw70d"}'
bb api accounts get-accounts --body '{"accountsToFetch":[{"address":"bb1p0rrel3365scadq5k9pv0x0zp9j22js6dnw70d"}]}'
bb api tx broadcast-tx --body @tx.json
bb api accounts get-tokens-view-for-user bb1p0rrel3365scadq5k9pv0x0zp9j22js6dnw70d --body '{"viewType":"collected"}'   # GET: body becomes query params
bb api tokens get-collection 1 --dry-run                                          # print the request, do not send
bb api --search swap | jq -r '.data.matches[] | "\(.name)\t\(.method)\t\(.path)"'
bb api tokens get-collection --schema

bb api accounts get-account for the fixture address returns (mainnet output, views and empty arrays trimmed):

json
{
  "ok": true,
  "data": {
    "account": {
      "bitbadgesAddress": "bb1p0rrel3365scadq5k9pv0x0zp9j22js6dnw70d",
      "ethAddress": "0x0bC63Cfe31D5218eB414b142c799e20964a54A1A",
      "accountNumber": "-1",
      "sequence": "-1",
      "balances": [{ "amount": "0", "denom": "ubadge" }],
      "pubKeyType": "secp256k1",
      "publicKey": "",
      "chain": "Cosmos",
      "address": "bb1p0rrel3365scadq5k9pv0x0zp9j22js6dnw70d"
    }
  },
  "warnings": [],
  "error": null
}

Ask your agent. query_collection, query_balance, and search wrap the most-used routes:

text
Fetch collection 1 and tell me whether bb1p0rrel3365scadq5k9pv0x0zp9j22js6dnw70d holds any of its tokens.

Route Groups

bash
bb api --help            # groups with route counts
bb api tokens --help     # routes in one group
bb api all --help        # every route, flat

Generated from the SDK OpenAPI route registry: 134 routes across 11 active groups (bitbadges 0.45.15, revision f5253c8d7619).

GroupRoutesRoutes for
accounts9Account and user routes
tokens31Collection and token routes
claims13Claim management routes
auth13Sign In with BitBadges / OAuth routes
tx4Transaction broadcast and simulation
plugins7Plugin management routes
stores11Dynamic data store routes
onchain-stores4On-chain dynamic store routes
pages6Utility page routes
assets30DEX, pools, and asset pair routes
misc6Miscellaneous routes
all134Every route, ungrouped

bb api --help only prints groups that have at least one route in the generated inventory. Path parameters are positional (<param>). Each route's --help shows the HTTP method, path template, SDK type names, key body and query fields, and an SDK example where one exists.

Command Tree

accounts

Account and user routes (9 routes).

CommandMethodPathDescription
bb api accounts get-accountGET/userGet Account
bb api accounts get-accountsPOST/usersGet Accounts - Batch
bb api accounts get-claim-activity-for-user <address>GET/account/{address}/activity/claimsGet Claim Activity For User
bb api accounts get-points-activity-for-user <address>GET/account/{address}/activity/pointsGet Points Activity For User
bb api accounts get-siwbb-requests-for-user <address>GET/account/{address}/requests/siwbbGet SIWBB Requests For User
bb api accounts get-tokens-view-for-user <address>GET/account/{address}/tokensGet Tokens For User
bb api accounts get-transfer-activity-for-user <address>GET/account/{address}/activity/tokensGet Transfer Activity For User
bb api accounts get-user-balances <address>GET/account/{address}/balancesGet User Balances
bb api accounts get-votes-by-voter <voter>GET/voter/{voter}/votesGet Votes By Voter

tokens

Collection and token routes (31 routes).

CommandMethodPathDescription
bb api tokens filter-collection-approvals <collectionId>POST/collection/{collectionId}/filterApprovalsFilter Collection Approvals
bb api tokens filter-tokens <collectionId>POST/collection/{collectionId}/filterFilter Tokens in Collection
bb api tokens get-all-listings <collectionId>GET/collection/{collectionId}/allListingsGet All Listings for Collection
bb api tokens get-balance-by-address <collectionId> <address>GET/collection/{collectionId}/balance/{address}Get Balances By Address
bb api tokens get-balance-by-address-specific-token <collectionId> <address> <tokenId>GET/collection/{collectionId}/{tokenId}/balance/{address}Get Balance By Address - Specific Token
bb api tokens get-candlestick-data <collectionId> <tokenId>POST/collection/{collectionId}/candlestick/{tokenId}Get Candlestick Data
bb api tokens get-collection <collectionId>GET/collection/{collectionId}Get Collection
bb api tokens get-collection-amount-tracker-by-id <collectionId>GET/collection/{collectionId}/amountTrackerGet Collection Amount Tracker By ID
bb api tokens get-collection-amount-trackers <collectionId>GET/collection/{collectionId}/amountTrackersGet Collection Amount Trackers
bb api tokens get-collection-challenge-tracker-by-id <collectionId>GET/collection/{collectionId}/challengeTrackerGet Collection Challenge Tracker By ID
bb api tokens get-collection-challenge-trackers <collectionId>GET/collection/{collectionId}/challengeTrackersGet Collection Challenge Trackers
bb api tokens get-collection-claims <collectionId>GET/collection/{collectionId}/claimsGet Collection Claims
bb api tokens get-collection-listings <collectionId>GET/collection/{collectionId}/listingsGet Collection Listings
bb api tokens get-collection-offers <collectionId>GET/collection/{collectionId}/collectionOffersGet Collection-Wide Offers
bb api tokens get-collection-owners <collectionId>GET/collection/{collectionId}/ownersGet Collection Owners
bb api tokens get-collection-transfer-activity <collectionId>GET/collection/{collectionId}/activityGet Collection Transfer Activity
bb api tokens get-collections-batchPOST/collectionsGet Collections - Batch
bb api tokens get-filter-suggestions <collectionId>POST/collection/{collectionId}/filterSuggestionsGet Filter Suggestions
bb api tokens get-listings-for-token-id <collectionId> <tokenId>GET/collection/{collectionId}/listings/{tokenId}Get Listings For Token
bb api tokens get-offers-for-token-id <collectionId> <tokenId>GET/collection/{collectionId}/offers/{tokenId}Get Offers For Token
bb api tokens get-orderbook-depth <collectionId> <tokenId>GET/collection/{collectionId}/orderbook/{tokenId}Get Orderbook Depth
bb api tokens get-owners <collectionId> <tokenId>GET/collection/{collectionId}/{tokenId}/ownersGet Token Owners
bb api tokens get-prediction-detail <collectionId>GET/predictions/{collectionId}Get Prediction Market Detail
bb api tokens get-prediction-prices <collectionId>GET/predictions/{collectionId}/pricesGet Prediction Market Price History
bb api tokens get-predictionsGET/predictionsBrowse Prediction Markets
bb api tokens get-refresh-status <collectionId>GET/collection/{collectionId}/refreshStatusGet Refresh Status
bb api tokens get-token-activity <collectionId> <tokenId>GET/collection/{collectionId}/{tokenId}/activityGet Token Activity
bb api tokens get-token-metadata <collectionId> <tokenId>GET/collection/{collectionId}/{tokenId}/metadataGet Token Metadata
bb api tokens get-vote-by-proposal-id <proposalId>GET/vote/{proposalId}Get Vote By Proposal ID
bb api tokens get-votes-by-collection <collectionId>GET/collection/{collectionId}/votesGet Votes By Collection
bb api tokens refresh-metadata <collectionId>POST/collection/{collectionId}/refreshRefresh Metadata

claims

Claim management routes (13 routes).

CommandMethodPathDescription
bb api claims complete-claim <claimId> <address>POST/claims/complete/{claimId}/{address}Complete Claim
bb api claims create-claimPOST/claimsCreate Claim
bb api claims delete-claimDELETE/claimsDelete Claim
bb api claims generate-codeGET/codesGet Code (Codes Plugin)
bb api claims get-claim <claimId>GET/claim/{claimId}Get Claim
bb api claims get-claim-attempt-status <claimAttemptId>GET/claims/status/{claimAttemptId}Get Claim Attempt Status
bb api claims get-claim-attempts <claimId>GET/claims/{claimId}/attemptsGet Claim Attempts
bb api claims get-claimsPOST/claims/fetchGet Claims - Batch
bb api claims get-gated-content-for-claim <claimId>GET/claims/gatedContent/{claimId}Get Gated Content for Claim
bb api claims get-reserved-codes <claimId> <address>POST/claims/reserved/{claimId}/{address}Get Reserved Claim Codes
bb api claims search-claimsGET/claims/searchSearch Claims
bb api claims simulate-claim <claimId> <address>POST/claims/simulate/{claimId}/{address}Simulate Claim
bb api claims update-claimPUT/claimsUpdate Claim

auth

Sign In with BitBadges / OAuth routes (13 routes).

CommandMethodPathDescription
bb api auth check-sign-in-statusPOST/auth/statusCheck Sign In Status
bb api auth create-developer-appPOST/developerAppsCreate OAuth App
bb api auth create-siwbb-requestPOST/siwbbRequestCreate SIWBB Request
bb api auth delete-developer-app <clientId>DELETE/developerAppsDelete OAuth App
bb api auth delete-siwbb-requestDELETE/siwbbRequestDelete SIWBB Request
bb api auth exchange-siwbb-authorization-codePOST/siwbb/tokenExchange SIWBB Code
bb api auth fetch-developer-appsPOST/developerApps/fetchFetch Developer Apps (Batch)
bb api auth get-developer-app <clientId>GET/developerApp/{clientId}Get OAuth App
bb api auth get-siwbb-requests-for-developer-appGET/developerApps/siwbbRequestsGet SIWBB Requests For Developer App
bb api auth revoke-oauth-authorizationPOST/siwbb/token/revokeRevoke Authorization
bb api auth rotate-siwbb-requestPOST/siwbbRequest/rotateRotate SIWBB Request
bb api auth search-developer-appsGET/developerApps/searchSearch Developer Apps
bb api auth update-developer-app <clientId>PUT/developerAppsUpdate OAuth App

tx

Transaction broadcast and simulation (4 routes).

CommandMethodPathDescription
bb api tx broadcast-txPOST/broadcastBroadcast a transaction via the indexer API. NOTE: If using the chain CLI, prefer bitbadgeschaind tx for direct node broadcast.
bb api tx broadcast-tx-evmPOST/broadcast-evmBroadcast EVM Transaction
bb api tx simulate-txPOST/simulateSimulate a transaction via the indexer API. NOTE: If using the chain CLI, prefer bitbadgeschaind tx ... --dry-run for direct node simulation.
bb api tx simulate-tx-evmPOST/simulate-evmSimulate EVM Transaction

plugins

Plugin management routes (7 routes).

CommandMethodPathDescription
bb api plugins create-pluginPOST/pluginsCreate Plugin
bb api plugins delete-pluginDELETE/pluginsDelete Plugin
bb api plugins get-creator-pluginsGET/plugins/creatorGet Creator Plugins
bb api plugins get-plugin <pluginId>GET/plugin/{pluginId}Get Plugin
bb api plugins get-pluginsPOST/plugins/fetchGet Plugins - Batch
bb api plugins search-pluginsGET/plugins/searchSearch Plugins
bb api plugins update-pluginPUT/pluginsUpdate Plugin

stores

Dynamic data store routes (11 routes).

CommandMethodPathDescription
bb api stores create-dynamic-data-storePOST/dynamicStoresCreate Dynamic Data Store
bb api stores delete-dynamic-data-store <dynamicStoreId>DELETE/dynamicStoresDelete Dynamic Data Store
bb api stores get-dynamic-data-activityGET/dynamicStores/activityGet Dynamic Data Activity
bb api stores get-dynamic-data-store <dynamicStoreId>GET/dynamicStore/{dynamicStoreId}Get Dynamic Data Store
bb api stores get-dynamic-data-store-value <dynamicStoreId>GET/dynamicStore/{dynamicStoreId}/valueGet Dynamic Data Store Value
bb api stores get-dynamic-data-store-values-paginated <dynamicStoreId>GET/dynamicStore/{dynamicStoreId}/valuesGet Dynamic Data Store Values Paginated
bb api stores get-dynamic-data-storesPOST/dynamicStores/fetchFetch Dynamic Data Stores - Batch
bb api stores perform-store-action-batch-with-body-authPOST/storeActions/batchPerform Batch Store Actions (Body Auth)
bb api stores perform-store-action-single-with-body-authPOST/storeActions/singlePerform Single Store Action (Body Auth)
bb api stores search-dynamic-data-storesGET/dynamicStores/searchSearch Dynamic Data Stores For User
bb api stores update-dynamic-data-store <dynamicStoreId>PUT/dynamicStoresUpdate Dynamic Data Store

onchain-stores

On-chain dynamic store routes (4 routes).

CommandMethodPathDescription
bb api onchain-stores get-on-chain-dynamic-store <storeId>GET/onChainDynamicStore/{storeId}Get On-Chain Dynamic Store
bb api onchain-stores get-on-chain-dynamic-store-value <storeId> <address>GET/onChainDynamicStore/{storeId}/value/{address}Get On-Chain Dynamic Store Value
bb api onchain-stores get-on-chain-dynamic-store-values-paginated <storeId>GET/onChainDynamicStore/{storeId}/valuesGet On-Chain Dynamic Store Values (Paginated)
bb api onchain-stores get-on-chain-dynamic-stores-by-creator <address>GET/onChainDynamicStores/by-creator/{address}Get On-Chain Dynamic Stores by Creator

pages

Utility page routes (6 routes).

CommandMethodPathDescription
bb api pages create-utility-pagePOST/utilityPagesCreate Utility Page
bb api pages delete-utility-pageDELETE/utilityPagesDelete Utility Page
bb api pages get-utility-page <listingId>GET/utilityPages/{listingId}Get Utility Page
bb api pages get-utility-pagesPOST/utilityPages/fetchGet Utility Pages - Batch
bb api pages search-utility-pagesGET/utilityPages/searchSearch Utility Pages
bb api pages update-utility-pagePUT/utilityPagesUpdate Utility Page

assets

DEX, pools, and asset pair routes (30 routes).

CommandMethodPathDescription
bb api assets browse-intentsGET/intentsBrowse All Intents
bb api assets estimate-swapPOST/swap/estimateEstimate Swap
bb api assets estimate-swap-legacyPOST/swaps/estimate[DEPRECATED] Estimate Swap
bb api assets get-all-poolsGET/poolsGet All Pools
bb api assets get-asset-pairsGET/assetPairsGet Asset Pairs
bb api assets get-by-denomsPOST/assetPairs/byDenomsGet Asset Pairs by Denoms
bb api assets get-by-priceGET/assetPairs/priceSortedGet by Price
bb api assets get-highest-volumeGET/assetPairs/highestVolumeGet Highest Volume
bb api assets get-intents <address>GET/intents/{address}Get Exchange-Approval Intents
bb api assets get-liquidity-pair-price-historyGET/liquidityPairPriceHistoryGet Liquidity Pair Price History
bb api assets get-pool-info-by-id <poolId>GET/pools/{poolId}Get Pool Info by ID
bb api assets get-pool-infos-by-assetsGET/pools/byAssetsGet Pool Infos by Assets
bb api assets get-pool-infos-by-denomGET/pools/byDenomGet Pool Infos by Denom
bb api assets get-pools-batchPOST/pools/batchGet Pools (Batch)
bb api assets get-skip-assetsGET/skip/assets[DEPRECATED] Get Skip:Go Assets
bb api assets get-skip-balancesPOST/skip/balances[DEPRECATED] Get Skip:Go Balances
bb api assets get-skip-chainsGET/skip/chains[DEPRECATED] Get Skip:Go Chains
bb api assets get-skip-tx-statusGET/skip/v2/tx/status[DEPRECATED] Get Skip:Go Transaction Status
bb api assets get-swap-activitiesGET/swapActivitiesGet Swap Activities
bb api assets get-swap-assetsGET/swap/assetsGet Swap Assets
bb api assets get-swap-balancesPOST/swap/balancesGet Swap Balances
bb api assets get-swap-chainsGET/swap/chainsGet Swap Chains
bb api assets get-swap-statusGET/swap/statusGet Swap Transaction Status
bb api assets get-top-gainersGET/assetPairs/topGainersGet Top Gainers
bb api assets get-top-losersGET/assetPairs/topLosersGet Top Losers
bb api assets get-weekly-top-gainersGET/assetPairs/weeklyTopGainersGet Weekly Top Gainers
bb api assets get-weekly-top-losersGET/assetPairs/weeklyTopLosersGet Weekly Top Losers
bb api assets search-asset-pairs-by-textGET/assetPairs/searchSearch Asset Pairs by Text
bb api assets track-skip-txPOST/skip/v2/tx/track[DEPRECATED] Track Skip:Go Transaction
bb api assets track-swapPOST/swap/trackTrack Swap Transaction

misc

Miscellaneous routes (6 routes).

CommandMethodPathDescription
bb api misc browsePOST/browseBrowse Collections, Tokens, Users
bb api misc create-api-keyPOST/apiKeysCreate API Key
bb api misc delete-api-keyDELETE/apiKeysDelete API Key
bb api misc fetch-api-keysPOST/apiKeys/fetchFetch API Keys
bb api misc get-statusGET/statusGet Status
bb api misc rotate-api-keyPOST/apiKeys/rotateRotate API Key

Flags

FlagDescription
--body <json>Request body: inline JSON, @file.json, or - for stdin. On GET routes it is converted to query params.
--query <json>Query params as a JSON object
--dry-runPrint method, URL, headers, and body without sending
--schemaPrint the route's request body fields, query params, and SDK type names. No API call.
--with-sessionAttach the cookie of the active address for the resolved network (see Auth)
--as-address <addr>Attach the cookie of a specific stored address (overrides --with-session)
--condensed, --output-file <path>Output flags
--api-key, --network, --mainnet, --testnet, --local, --urlNetwork flags

Discovery

bb api --search <keyword> scans route name, path, tag, and description (case-insensitive substring) and returns matches in the envelope. bb api --search balance prints (trimmed to the first three matches):

json
{
  "ok": true,
  "data": {
    "search": "balance",
    "matches": [
      { "name": "get-user-balances", "method": "GET", "path": "/account/{address}/balances", "tag": "accounts", "description": "Get User Balances" },
      { "name": "get-balance-by-address-specific-token", "method": "GET", "path": "/collection/{collectionId}/{tokenId}/balance/{address}", "tag": "tokens", "description": "Get Balance By Address - Specific Token" },
      { "name": "get-balance-by-address", "method": "GET", "path": "/collection/{collectionId}/balance/{address}", "tag": "tokens", "description": "Get Balances By Address" }
    ]
  },
  "warnings": [],
  "error": null
}

bb api <group> <route> --schema prints the route shape so an agent can build a valid body offline. For bb api tokens get-collection --schema:

json
{
  "ok": true,
  "data": {
    "name": "get-collection",
    "method": "GET",
    "path": "/collection/{collectionId}",
    "description": "Get Collection",
    "pathParams": ["collectionId"],
    "hasBody": false,
    "sdkLinks": {
      "response": "iGetCollectionSuccessResponse",
      "function": "BitBadgesAPI.getCollection"
    },
    "queryParams": [],
    "bodyFields": [],
    "requestSchema": null,
    "responseSchema": null,
    "example": null
  },
  "warnings": [],
  "error": null
}

Behavior

  • An API key is required on every call (bb settings set apiKey "$BITBADGES_API_KEY" or the BITBADGES_API_KEY variable). Get one at bitbadges.io/developer.
  • Routes gated by Full Access also need a user session. On HTTP 401 or 403 the envelope carries a hint that says to run bb auth login and retry with --with-session; if a cookie was already attached, the hint suggests a re-login.
  • --with-session is opt-in; the CLI never attaches a cookie silently.
  • Credits, limits, and error shapes: API.

Edit this page on GitHub