Mainly

Quickstart

Make your first Mainly API call in under five minutes.

1. Get an API key

Create an account and generate a key from the dashboard. Keys look like mnly_live_... for mainnet and mnly_test_... for devnet.

Note: The platform is in early access. If you don't have a key yet, this reference still tells you exactly what to expect from every endpoint.

2. Base URL and authentication

All requests are scoped by chain and network:

NetworkBase URL
Solana mainnethttps://api.mainly.live/v1/solana
Solana devnethttps://api.mainly.live/v1/solana-devnet

Authenticate with a standard bearer token header — never put keys in the URL:

Authorization: Bearer $MAINLY_API_KEY

3. Your first request

Fetch the SOL balance of any wallet:

curl https://api.mainly.live/v1/solana/wallets/9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM/balance \
  -H "Authorization: Bearer $MAINLY_API_KEY"
{
  "address": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
  "lamports": 1529000000,
  "sol": 1.529
}

The same call with the official TypeScript SDK:

pnpm add @mainly-live/sdk
import { Mainly } from "@mainly-live/sdk";

const token = process.env.MAINLY_API_KEY;
if (!token) throw new Error("MAINLY_API_KEY is not set");

const client = new Mainly({ token });
const balance = await client.solana.wallets.getBalance({
  address: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
});

console.log(`Balance: ${balance.sol} SOL`);

See the SDK guides for installation and complete first-call examples in TypeScript, Go, and Rust. The REST API remains available directly from any HTTP client.

4. Something you can't do in one RPC call

Get every token the wallet holds — including names, symbols, logos, and USD prices — in a single request:

curl https://api.mainly.live/v1/solana/wallets/9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM/tokens \
  -H "Authorization: Bearer $MAINLY_API_KEY"

Against raw Solana RPC this takes four calls across two token programs plus a metadata service. See List wallet tokens for the full response shape.

Next steps

  1. Skim the four core concepts — units, confirmation, pagination, errors. Ten minutes, and the whole API becomes predictable.
  2. Browse the API reference for the complete endpoint catalogue.
  3. Choose an official TypeScript, Go, or Rust SDK.
  4. Building a transaction flow? Start at Send a transaction.

On this page