Mainly

Get a program

Metadata about a deployed program — who can upgrade it, when it changed, how big it is.

GET /programs/{programId}

Programs are Solana's smart contracts. This endpoint answers the due-diligence questions: is this address actually a program, can someone change its code (upgrade authority), and when was it last deployed?

Parameters

ParameterInTypeRequiredDescription
programIdpathstringYesThe program's address.

Example

curl https://api.sarg.am/v1/solana/programs/TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA \
  -H "Authorization: Bearer $MAINLY_API_KEY"
{
  "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
  "name": "SPL Token",
  "executable": true,
  "loader": "upgradeable",
  "upgradeAuthority": null,
  "lastDeployedSlot": 154680912,
  "sizeBytes": 134080
}

Response fields

FieldTypeDescription
namestring | nullHuman name from our registry of well-known programs (SPL Token, Jupiter v6, ...). null for unrecognized programs.
loaderstringupgradeable, legacy, or native.
upgradeAuthoritystring | nullWho can replace the program's code. null means immutable — the code can never change, which is what you want to see before depositing serious value.
lastDeployedSlotnumber | nullWhen the current code was deployed. A very recent deploy on a supposedly battle-tested program is worth investigating.
sizeBytesnumberSize of the compiled program.

Errors

codeWhen
invalid_addressThe path parameter isn't valid base58.
not_foundThe account exists but isn't executable — it's a regular account, not a program.

Under the hood

Replaces getAccountInfo on the program address plus a second getAccountInfo on its hidden ProgramData account — the upgradeable loader splits a program across two accounts, and the fields people actually want (upgrade authority, deploy slot) live in the second one.

On this page