API Reference

The SolanaFM APIs design principles revolves around serving RESTful endpoints and Websockets (WS). We offer a suite of endpoints that allows you to build and integrate your on-chain programs and projects much conveniently. Our APIs are designed with an object-oriented approach. We adhere to the standard HTTP responses with the use of appropriate response status code, and authentication.

The API endpoints differs for every user as we release newer versions of the APIs to users who have opted in for the beta.


Authentication

The SolanaFM APIs are free of charge but usages are gated by a rate-limiting middleware. To increase your rate limits we encourage users to generate their own API Keys to authenticate each request. You can view and manage your API keys in the Developer Portal dashboard.

API keys issued for trial will have the prefix of sk_trial_ and live mode API keys will have the prefix of sk_live_. API keys issued prior to June 2023 do not have a prefix.

Your API keys carry many privileges, so be sure to keep them secured! Do not share you API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

If you need to authenticate via bearer auth (e.g. for a cross-origin request), use -H "ApiKey: sk_test_sJRtKjCkNlJKNrZrOmtZaWlqj"

All API requests must be made over HTTPS. Calls made over plain HTTP will fail.


Errors

SolanaFM uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicates client side error which could be caused by required parameters are not populated for querying or datatypes mismatch. Codes in the 5xx indicates a server side error and can be caused by server's down time.

Some 4xx errors that could be handled programatically (e.g. and invalid block number) includes an error message that briefly explains the error raised.

Status CodeStatusResponses
200OKReturns the data in the response body
400Bad RequestRequest parameter(s) provided is incorrectly formatted or not provided
404Not FoundThe resource(s) requested is unavailable
429Too many RequestsRate-limit has been exceeded
500Internal Server ErrorThe server encountered an unexpected error that prevented it from fulfilling the request.