Getting Started

Getting Started - API Keys

By default, select routes are available publicly in a rate-limited way with no API key. API keys give you access to all routes with higher limits.

  1. Sign in and create an API key at https://bitbadges.io/developerarrow-up-right -> API Keys tab.

  2. Send requests to https://api.bitbadges.io/arrow-up-right with the HTTP header x-api-key.

  3. Top up API credits inline in the API Keys tab of the developer portal. Each request costs 1 API credit, and 1 USDC = 100,000 API credits.

See API Credits for the full pricing and rate-limit breakdown.

Number Types

Note: Numbers are stringified in responses to avoid precision loss. You will have to convert them to your desired type (preferably bigint). The SDK does this for you if you use it.

References

In this documentation, we often use the SDK format for explanation purposes. Please convert the corresponding function name to vanilla HTTP if you are not using the SDK from the documentation above.

Testnet Mode

A testnet version of the API is available with the base URL https://api.bitbadges.io/testnetarrow-up-right. Everything else is the same, just add the /testnet before all paths.

Note that this testnet API is an entirely separate service from normal API. Nothing carries over. It commmunicates with the frontend with testnet mode turned on and uses the testnet BitBadges blockchain.

If you are using JavaScript / TypeScript, consider using the typed API SDK for convenience. This will give you typed routes, provide quality checks, and also auto-convert all responses to your desired number type (bigint, Number, etc).

Using BitBadges JS/SDK

Check out the BitBadges JS/SDK for implementing further functionality beyond just API requests / responses, such as manipulating balances, handling approvals, checking permissions, etc.

βš’οΈBitBadges JS / SDKchevron-right

API Authorization

For most applications, you should be fine without needing to access private user authenticated information. However if you do, check out Sign In with BitBadges. This follows a standard OAuth 2.0 flow. Use the scopes to gain access to authenticated routes. Refer to the API reference to see what scopes are needed where.

Sign In with BitBadges (OAuth)chevron-right

Bookmarking

Throughout the API, we use a bookmark technique. For the first request, you will not need to specify a bookmark (e.g. ""), and it will fetch the first page. Within the response, it will return a bookmark and hasMore. hasMore defines whether there are more pages to be fetched. To fetch the next page, you will specify the returned bookmark from the previous request to the next request. This process can be repeated until all are loaded.

Last updated