Interacting with OneBalance API
How can I generate an API access token?
The OneBalance API uses API keys to authenticate requests. All API requests require authentication using an API key passed in the x-api-key
header:
A public API key is available for testing purposes with limited usage: f9703eaqsbma20tmtphg2jirm0hk8z8v2hkodrfrvhfm6ziesi7p38u991bnih5f
For production use, contact support@onebalance.io to get your custom API token with higher rate limits and full access to all features.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
What is a base URL?
OneBalance API is built on REST principles and is served over HTTPS. To ensure data privacy, unencrypted HTTP is not supported.
The Base URL for all API endpoints is:
How to fix CORS errors?
OneBalance API implements Cross Origin Resource Sharing (CORS) to allow requests from browsers on different domains.
CORS is generally handled by the server, not the client. If you’re experiencing CORS errors in your browser application, you have several options:
- Use a server-side proxy - Create a backend service that makes requests to OneBalance API and returns the data to your frontend
- Implement a middleware in Next.js - If using Next.js, create route handlers that proxy the requests to the API
- Contact us - If you need your domain allowed for direct browser access
Learn more about CORS in the API Reference.
What are the rate limits?
The OneBalance API implements rate limiting to ensure fair usage and availability of the service for all users:
- Public API Key: 100 requests per minute
- Authenticated Users: 400 requests per minute
If you exceed the rate limit, the API will return a 429 Too Many Requests
response. To handle rate limits effectively, monitor the rate limit headers in your API responses:
Learn more in the Rate Limits documentation.
How do I handle API errors?
The API uses standard HTTP status codes to indicate success or failure:
2xx
- Success4xx
- Client error (like invalid parameters)5xx
- Server error
For errors, the API returns a JSON response with details about what went wrong:
Always check the message
field for details on how to resolve the issue, and include the id
when contacting support.
See the Errors documentation for more information.
How can I paginate results?
For endpoints that return large collections of items, the API uses cursor-based pagination. To paginate results:
- Specify a
limit
parameter to control the number of items per page - Use the
continuation
token from the response to fetch the next page
Check the Pagination documentation for details.