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
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
programId | path | string | Yes | The 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
| Field | Type | Description |
|---|---|---|
name | string | null | Human name from our registry of well-known programs (SPL Token, Jupiter v6, ...). null for unrecognized programs. |
loader | string | upgradeable, legacy, or native. |
upgradeAuthority | string | null | Who 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. |
lastDeployedSlot | number | null | When the current code was deployed. A very recent deploy on a supposedly battle-tested program is worth investigating. |
sizeBytes | number | Size of the compiled program. |
Errors
code | When |
|---|---|
invalid_address | The path parameter isn't valid base58. |
not_found | The 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.