Solana Tokens API
Methods for querying SPL Token accounts, balances, and supply
Methods for querying SPL Token accounts, balances, and supply
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/solana-tokens-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Solana JSON-RPC Accounts Tokens API
description: Solana exposes a JSON-RPC 2.0 API over HTTP and WebSocket for querying accounts, transactions, programs, token balances, blocks, and cluster state, as well as submitting and simulating transactions. Three public clusters are available — Mainnet (https://api.mainnet.solana.com), Devnet (https://api.devnet.solana.com), and Testnet (https://api.testnet.solana.com) — with dedicated API nodes for each environment. All requests use HTTP POST with a JSON-RPC 2.0 request body.
version: '2.0'
contact:
name: Solana Developer Resources
url: https://solana.com/developers
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
termsOfService: https://solana.com/tos
servers:
- url: https://api.mainnet.solana.com
description: Solana Mainnet
- url: https://api.devnet.solana.com
description: Solana Devnet
- url: https://api.testnet.solana.com
description: Solana Testnet
tags:
- name: Tokens
description: Methods for querying SPL Token accounts, balances, and supply
paths:
/getTokenAccountBalance:
post:
operationId: getTokenAccountBalance
summary: getTokenAccountBalance
description: Returns the token balance of an SPL Token account.
tags:
- Tokens
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/JsonRpcRequest'
examples:
getTokenAccountBalance:
summary: Get token balance for an SPL Token account
value:
jsonrpc: '2.0'
id: 1
method: getTokenAccountBalance
params:
- 7fUAJdStEuGbc3sM84cKRL6yYaaSstyLSU4ve5oovLS7
responses:
'200':
description: Successful JSON-RPC response
content:
application/json:
schema:
$ref: '#/components/schemas/TokenAmountResponse'
x-solana-method: getTokenAccountBalance
x-solana-docs: https://solana.com/docs/rpc/http/gettokenaccountbalance
/getTokenAccountsByDelegate:
post:
operationId: getTokenAccountsByDelegate
summary: getTokenAccountsByDelegate
description: Returns all SPL Token accounts by approved Delegate. Either a mint or programId filter is required.
tags:
- Tokens
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/JsonRpcRequest'
examples:
getTokenAccountsByDelegate:
summary: Get token accounts by delegate address
value:
jsonrpc: '2.0'
id: 1
method: getTokenAccountsByDelegate
params:
- 4Nd1mBQtrMJVYVfKf2PX99kkXoHWdrS84XnTXFGnhrHu
- programId: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
- encoding: jsonParsed
responses:
'200':
description: Successful JSON-RPC response
content:
application/json:
schema:
$ref: '#/components/schemas/TokenAccountsResponse'
x-solana-method: getTokenAccountsByDelegate
x-solana-docs: https://solana.com/docs/rpc/http/gettokenaccountsbydelegate
/getTokenAccountsByOwner:
post:
operationId: getTokenAccountsByOwner
summary: getTokenAccountsByOwner
description: Returns all SPL Token accounts by token owner. Either a mint or programId filter is required.
tags:
- Tokens
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/JsonRpcRequest'
examples:
getTokenAccountsByOwner:
summary: Get all token accounts owned by an address
value:
jsonrpc: '2.0'
id: 1
method: getTokenAccountsByOwner
params:
- 4Qkev8aNZcqFNSRkXnKKPZo2hEMUzCjCJvzE3YHWoGg
- programId: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
- encoding: jsonParsed
responses:
'200':
description: Successful JSON-RPC response
content:
application/json:
schema:
$ref: '#/components/schemas/TokenAccountsResponse'
x-solana-method: getTokenAccountsByOwner
x-solana-docs: https://solana.com/docs/rpc/http/gettokenaccountsbyowner
/getTokenLargestAccounts:
post:
operationId: getTokenLargestAccounts
summary: getTokenLargestAccounts
description: Returns the 20 largest accounts of a particular SPL Token type.
tags:
- Tokens
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/JsonRpcRequest'
examples:
getTokenLargestAccounts:
summary: Get 20 largest token accounts for a mint
value:
jsonrpc: '2.0'
id: 1
method: getTokenLargestAccounts
params:
- 3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E
responses:
'200':
description: Successful JSON-RPC response
content:
application/json:
schema:
$ref: '#/components/schemas/TokenLargestAccountsResponse'
x-solana-method: getTokenLargestAccounts
x-solana-docs: https://solana.com/docs/rpc/http/gettokenlargestaccounts
/getTokenSupply:
post:
operationId: getTokenSupply
summary: getTokenSupply
description: Returns the total supply of an SPL Token mint.
tags:
- Tokens
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/JsonRpcRequest'
examples:
getTokenSupply:
summary: Get total supply of an SPL Token mint
value:
jsonrpc: '2.0'
id: 1
method: getTokenSupply
params:
- 3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E
responses:
'200':
description: Successful JSON-RPC response
content:
application/json:
schema:
$ref: '#/components/schemas/TokenAmountResponse'
x-solana-method: getTokenSupply
x-solana-docs: https://solana.com/docs/rpc/http/gettokensupply
components:
schemas:
TokenLargestAccountsResponse:
type: object
properties:
jsonrpc:
type: string
example: '2.0'
id:
oneOf:
- type: integer
- type: string
result:
type: object
properties:
context:
$ref: '#/components/schemas/RpcContext'
value:
type: array
items:
type: object
properties:
address:
type: string
description: Base58-encoded address of the token account
amount:
type: string
description: Raw token account balance
decimals:
type: integer
description: Number of decimal places configured for the token
uiAmount:
type:
- number
- 'null'
uiAmountString:
type: string
error:
$ref: '#/components/schemas/JsonRpcError'
JsonRpcError:
type: object
properties:
code:
type: integer
description: Error code
message:
type: string
description: Human-readable error message
data:
description: Additional error data
TokenAmountResponse:
type: object
properties:
jsonrpc:
type: string
example: '2.0'
id:
oneOf:
- type: integer
- type: string
result:
type: object
properties:
context:
$ref: '#/components/schemas/RpcContext'
value:
$ref: '#/components/schemas/TokenAmount'
error:
$ref: '#/components/schemas/JsonRpcError'
RpcContext:
type: object
properties:
slot:
type: integer
format: int64
description: The slot at which the operation was evaluated
JsonRpcRequest:
type: object
required:
- jsonrpc
- id
- method
properties:
jsonrpc:
type: string
enum:
- '2.0'
description: JSON-RPC protocol version
example: '2.0'
id:
oneOf:
- type: integer
- type: string
description: Client-provided identifier for the request
example: 1
method:
type: string
description: The JSON-RPC method name
example: getBalance
params:
type: array
description: Method-specific parameters
items:
oneOf:
- type: string
- type: integer
- type: boolean
- type: object
- type: array
items: {}
TokenAccountsResponse:
type: object
properties:
jsonrpc:
type: string
example: '2.0'
id:
oneOf:
- type: integer
- type: string
result:
type: object
properties:
context:
$ref: '#/components/schemas/RpcContext'
value:
type: array
items:
type: object
properties:
pubkey:
type: string
description: Base58-encoded public key of the token account
account:
$ref: '#/components/schemas/AccountInfo'
error:
$ref: '#/components/schemas/JsonRpcError'
AccountInfo:
type: object
properties:
lamports:
type: integer
format: int64
description: Number of lamports assigned to this account
owner:
type: string
description: Base58-encoded public key of the program that owns this account
data:
description: Data associated with the account (encoded or parsed)
oneOf:
- type: string
- type: array
items:
type: string
- type: object
executable:
type: boolean
description: Whether this account contains a program and is strictly read-only
rentEpoch:
type: integer
format: int64
description: The epoch at which this account will next owe rent
space:
type: integer
description: The data size of the account
TokenAmount:
type: object
properties:
amount:
type: string
description: Raw amount of tokens as a string
decimals:
type: integer
description: Number of decimal places configured for the token
uiAmount:
type:
- number
- 'null'
description: Token amount as a float, using mint-prescribed decimals (DEPRECATED)
uiAmountString:
type: string
description: Token amount as a string, using mint-prescribed decimals
externalDocs:
description: Solana RPC HTTP Methods Documentation
url: https://solana.com/docs/rpc/http