bb api
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
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 --schemabb api accounts get-account for the fixture address returns (mainnet output, views and empty arrays trimmed):
{
"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:
Fetch collection 1 and tell me whether bb1p0rrel3365scadq5k9pv0x0zp9j22js6dnw70d holds any of its tokens.Route Groups
bb api --help # groups with route counts
bb api tokens --help # routes in one group
bb api all --help # every route, flatGenerated from the SDK OpenAPI route registry: 134 routes across 11 active groups (bitbadges 0.45.15, revision f5253c8d7619).
| Group | Routes | Routes for |
|---|---|---|
accounts | 9 | Account and user routes |
tokens | 31 | Collection and token routes |
claims | 13 | Claim management routes |
auth | 13 | Sign In with BitBadges / OAuth routes |
tx | 4 | Transaction broadcast and simulation |
plugins | 7 | Plugin management routes |
stores | 11 | Dynamic data store routes |
onchain-stores | 4 | On-chain dynamic store routes |
pages | 6 | Utility page routes |
assets | 30 | DEX, pools, and asset pair routes |
misc | 6 | Miscellaneous routes |
all | 134 | Every 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).
| Command | Method | Path | Description |
|---|---|---|---|
bb api accounts get-account | GET | /user | Get Account |
bb api accounts get-accounts | POST | /users | Get Accounts - Batch |
bb api accounts get-claim-activity-for-user <address> | GET | /account/{address}/activity/claims | Get Claim Activity For User |
bb api accounts get-points-activity-for-user <address> | GET | /account/{address}/activity/points | Get Points Activity For User |
bb api accounts get-siwbb-requests-for-user <address> | GET | /account/{address}/requests/siwbb | Get SIWBB Requests For User |
bb api accounts get-tokens-view-for-user <address> | GET | /account/{address}/tokens | Get Tokens For User |
bb api accounts get-transfer-activity-for-user <address> | GET | /account/{address}/activity/tokens | Get Transfer Activity For User |
bb api accounts get-user-balances <address> | GET | /account/{address}/balances | Get User Balances |
bb api accounts get-votes-by-voter <voter> | GET | /voter/{voter}/votes | Get Votes By Voter |
tokens
Collection and token routes (31 routes).
| Command | Method | Path | Description |
|---|---|---|---|
bb api tokens filter-collection-approvals <collectionId> | POST | /collection/{collectionId}/filterApprovals | Filter Collection Approvals |
bb api tokens filter-tokens <collectionId> | POST | /collection/{collectionId}/filter | Filter Tokens in Collection |
bb api tokens get-all-listings <collectionId> | GET | /collection/{collectionId}/allListings | Get 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}/amountTracker | Get Collection Amount Tracker By ID |
bb api tokens get-collection-amount-trackers <collectionId> | GET | /collection/{collectionId}/amountTrackers | Get Collection Amount Trackers |
bb api tokens get-collection-challenge-tracker-by-id <collectionId> | GET | /collection/{collectionId}/challengeTracker | Get Collection Challenge Tracker By ID |
bb api tokens get-collection-challenge-trackers <collectionId> | GET | /collection/{collectionId}/challengeTrackers | Get Collection Challenge Trackers |
bb api tokens get-collection-claims <collectionId> | GET | /collection/{collectionId}/claims | Get Collection Claims |
bb api tokens get-collection-listings <collectionId> | GET | /collection/{collectionId}/listings | Get Collection Listings |
bb api tokens get-collection-offers <collectionId> | GET | /collection/{collectionId}/collectionOffers | Get Collection-Wide Offers |
bb api tokens get-collection-owners <collectionId> | GET | /collection/{collectionId}/owners | Get Collection Owners |
bb api tokens get-collection-transfer-activity <collectionId> | GET | /collection/{collectionId}/activity | Get Collection Transfer Activity |
bb api tokens get-collections-batch | POST | /collections | Get Collections - Batch |
bb api tokens get-filter-suggestions <collectionId> | POST | /collection/{collectionId}/filterSuggestions | Get 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}/owners | Get 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}/prices | Get Prediction Market Price History |
bb api tokens get-predictions | GET | /predictions | Browse Prediction Markets |
bb api tokens get-refresh-status <collectionId> | GET | /collection/{collectionId}/refreshStatus | Get Refresh Status |
bb api tokens get-token-activity <collectionId> <tokenId> | GET | /collection/{collectionId}/{tokenId}/activity | Get Token Activity |
bb api tokens get-token-metadata <collectionId> <tokenId> | GET | /collection/{collectionId}/{tokenId}/metadata | Get 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}/votes | Get Votes By Collection |
bb api tokens refresh-metadata <collectionId> | POST | /collection/{collectionId}/refresh | Refresh Metadata |
claims
Claim management routes (13 routes).
| Command | Method | Path | Description |
|---|---|---|---|
bb api claims complete-claim <claimId> <address> | POST | /claims/complete/{claimId}/{address} | Complete Claim |
bb api claims create-claim | POST | /claims | Create Claim |
bb api claims delete-claim | DELETE | /claims | Delete Claim |
bb api claims generate-code | GET | /codes | Get 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}/attempts | Get Claim Attempts |
bb api claims get-claims | POST | /claims/fetch | Get 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-claims | GET | /claims/search | Search Claims |
bb api claims simulate-claim <claimId> <address> | POST | /claims/simulate/{claimId}/{address} | Simulate Claim |
bb api claims update-claim | PUT | /claims | Update Claim |
auth
Sign In with BitBadges / OAuth routes (13 routes).
| Command | Method | Path | Description |
|---|---|---|---|
bb api auth check-sign-in-status | POST | /auth/status | Check Sign In Status |
bb api auth create-developer-app | POST | /developerApps | Create OAuth App |
bb api auth create-siwbb-request | POST | /siwbbRequest | Create SIWBB Request |
bb api auth delete-developer-app <clientId> | DELETE | /developerApps | Delete OAuth App |
bb api auth delete-siwbb-request | DELETE | /siwbbRequest | Delete SIWBB Request |
bb api auth exchange-siwbb-authorization-code | POST | /siwbb/token | Exchange SIWBB Code |
bb api auth fetch-developer-apps | POST | /developerApps/fetch | Fetch Developer Apps (Batch) |
bb api auth get-developer-app <clientId> | GET | /developerApp/{clientId} | Get OAuth App |
bb api auth get-siwbb-requests-for-developer-app | GET | /developerApps/siwbbRequests | Get SIWBB Requests For Developer App |
bb api auth revoke-oauth-authorization | POST | /siwbb/token/revoke | Revoke Authorization |
bb api auth rotate-siwbb-request | POST | /siwbbRequest/rotate | Rotate SIWBB Request |
bb api auth search-developer-apps | GET | /developerApps/search | Search Developer Apps |
bb api auth update-developer-app <clientId> | PUT | /developerApps | Update OAuth App |
tx
Transaction broadcast and simulation (4 routes).
| Command | Method | Path | Description |
|---|---|---|---|
bb api tx broadcast-tx | POST | /broadcast | Broadcast a transaction via the indexer API. NOTE: If using the chain CLI, prefer bitbadgeschaind tx for direct node broadcast. |
bb api tx broadcast-tx-evm | POST | /broadcast-evm | Broadcast EVM Transaction |
bb api tx simulate-tx | POST | /simulate | Simulate 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-evm | POST | /simulate-evm | Simulate EVM Transaction |
plugins
Plugin management routes (7 routes).
| Command | Method | Path | Description |
|---|---|---|---|
bb api plugins create-plugin | POST | /plugins | Create Plugin |
bb api plugins delete-plugin | DELETE | /plugins | Delete Plugin |
bb api plugins get-creator-plugins | GET | /plugins/creator | Get Creator Plugins |
bb api plugins get-plugin <pluginId> | GET | /plugin/{pluginId} | Get Plugin |
bb api plugins get-plugins | POST | /plugins/fetch | Get Plugins - Batch |
bb api plugins search-plugins | GET | /plugins/search | Search Plugins |
bb api plugins update-plugin | PUT | /plugins | Update Plugin |
stores
Dynamic data store routes (11 routes).
| Command | Method | Path | Description |
|---|---|---|---|
bb api stores create-dynamic-data-store | POST | /dynamicStores | Create Dynamic Data Store |
bb api stores delete-dynamic-data-store <dynamicStoreId> | DELETE | /dynamicStores | Delete Dynamic Data Store |
bb api stores get-dynamic-data-activity | GET | /dynamicStores/activity | Get 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}/value | Get Dynamic Data Store Value |
bb api stores get-dynamic-data-store-values-paginated <dynamicStoreId> | GET | /dynamicStore/{dynamicStoreId}/values | Get Dynamic Data Store Values Paginated |
bb api stores get-dynamic-data-stores | POST | /dynamicStores/fetch | Fetch Dynamic Data Stores - Batch |
bb api stores perform-store-action-batch-with-body-auth | POST | /storeActions/batch | Perform Batch Store Actions (Body Auth) |
bb api stores perform-store-action-single-with-body-auth | POST | /storeActions/single | Perform Single Store Action (Body Auth) |
bb api stores search-dynamic-data-stores | GET | /dynamicStores/search | Search Dynamic Data Stores For User |
bb api stores update-dynamic-data-store <dynamicStoreId> | PUT | /dynamicStores | Update Dynamic Data Store |
onchain-stores
On-chain dynamic store routes (4 routes).
| Command | Method | Path | Description |
|---|---|---|---|
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}/values | Get 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).
| Command | Method | Path | Description |
|---|---|---|---|
bb api pages create-utility-page | POST | /utilityPages | Create Utility Page |
bb api pages delete-utility-page | DELETE | /utilityPages | Delete Utility Page |
bb api pages get-utility-page <listingId> | GET | /utilityPages/{listingId} | Get Utility Page |
bb api pages get-utility-pages | POST | /utilityPages/fetch | Get Utility Pages - Batch |
bb api pages search-utility-pages | GET | /utilityPages/search | Search Utility Pages |
bb api pages update-utility-page | PUT | /utilityPages | Update Utility Page |
assets
DEX, pools, and asset pair routes (30 routes).
| Command | Method | Path | Description |
|---|---|---|---|
bb api assets browse-intents | GET | /intents | Browse All Intents |
bb api assets estimate-swap | POST | /swap/estimate | Estimate Swap |
bb api assets estimate-swap-legacy | POST | /swaps/estimate | [DEPRECATED] Estimate Swap |
bb api assets get-all-pools | GET | /pools | Get All Pools |
bb api assets get-asset-pairs | GET | /assetPairs | Get Asset Pairs |
bb api assets get-by-denoms | POST | /assetPairs/byDenoms | Get Asset Pairs by Denoms |
bb api assets get-by-price | GET | /assetPairs/priceSorted | Get by Price |
bb api assets get-highest-volume | GET | /assetPairs/highestVolume | Get Highest Volume |
bb api assets get-intents <address> | GET | /intents/{address} | Get Exchange-Approval Intents |
bb api assets get-liquidity-pair-price-history | GET | /liquidityPairPriceHistory | Get 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-assets | GET | /pools/byAssets | Get Pool Infos by Assets |
bb api assets get-pool-infos-by-denom | GET | /pools/byDenom | Get Pool Infos by Denom |
bb api assets get-pools-batch | POST | /pools/batch | Get Pools (Batch) |
bb api assets get-skip-assets | GET | /skip/assets | [DEPRECATED] Get Skip:Go Assets |
bb api assets get-skip-balances | POST | /skip/balances | [DEPRECATED] Get Skip:Go Balances |
bb api assets get-skip-chains | GET | /skip/chains | [DEPRECATED] Get Skip:Go Chains |
bb api assets get-skip-tx-status | GET | /skip/v2/tx/status | [DEPRECATED] Get Skip:Go Transaction Status |
bb api assets get-swap-activities | GET | /swapActivities | Get Swap Activities |
bb api assets get-swap-assets | GET | /swap/assets | Get Swap Assets |
bb api assets get-swap-balances | POST | /swap/balances | Get Swap Balances |
bb api assets get-swap-chains | GET | /swap/chains | Get Swap Chains |
bb api assets get-swap-status | GET | /swap/status | Get Swap Transaction Status |
bb api assets get-top-gainers | GET | /assetPairs/topGainers | Get Top Gainers |
bb api assets get-top-losers | GET | /assetPairs/topLosers | Get Top Losers |
bb api assets get-weekly-top-gainers | GET | /assetPairs/weeklyTopGainers | Get Weekly Top Gainers |
bb api assets get-weekly-top-losers | GET | /assetPairs/weeklyTopLosers | Get Weekly Top Losers |
bb api assets search-asset-pairs-by-text | GET | /assetPairs/search | Search Asset Pairs by Text |
bb api assets track-skip-tx | POST | /skip/v2/tx/track | [DEPRECATED] Track Skip:Go Transaction |
bb api assets track-swap | POST | /swap/track | Track Swap Transaction |
misc
Miscellaneous routes (6 routes).
| Command | Method | Path | Description |
|---|---|---|---|
bb api misc browse | POST | /browse | Browse Collections, Tokens, Users |
bb api misc create-api-key | POST | /apiKeys | Create API Key |
bb api misc delete-api-key | DELETE | /apiKeys | Delete API Key |
bb api misc fetch-api-keys | POST | /apiKeys/fetch | Fetch API Keys |
bb api misc get-status | GET | /status | Get Status |
bb api misc rotate-api-key | POST | /apiKeys/rotate | Rotate API Key |
Flags
| Flag | Description |
|---|---|
--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-run | Print method, URL, headers, and body without sending |
--schema | Print the route's request body fields, query params, and SDK type names. No API call. |
--with-session | Attach 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, --url | Network 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):
{
"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:
{
"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 theBITBADGES_API_KEYvariable). 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
hintthat says to runbb auth loginand retry with--with-session; if a cookie was already attached, the hint suggests a re-login. --with-sessionis opt-in; the CLI never attaches a cookie silently.- Credits, limits, and error shapes: API.