Skip to main content
GET
Get IDL
The path parameters, response schema, and examples on this page are generated from the OpenAPI definition. Get IDL returns a program’s IDL as of a slot: the latest version that became active at or before slot. slot doesn’t need to match a version exactly, so you can pass any point in history. To fetch one specific version, pass its slot from List IDL Versions. The IDL comes from the same catalog that Parsed Events and Parsed Streams use to decode instructions. The Orb explorer uses these endpoints to show program IDLs.

Use Cases

  • Decode history with the right interface. Pass a transaction’s slot to get the IDL that was live when it executed. Programs change their instructions and accounts over time, so the current IDL can misread older transactions.
  • Find exact names for filters. Scan Transaction History match.programs[].instructions accepts instruction names as the IDL spells them.
  • Review interface changes. Fetch two versions and compare their instructions to see what an upgrade added or removed. See the example on List IDL Versions.

IDL Formats

The response is the IDL document as stored. Programs in the catalog use one of two Anchor formats, and one program’s versions can use both. Check which format you received before reading it: Both formats have instructions. Most IDLs also have accounts, types, and errors, and many have events.

Credits

Each request costs 10 credits and is available on all plans. See Credits.

Errors

Other errors return a JSON body with an error message, such as {"error": "no IDL found for program KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD at or before slot 1"}.

Request Parameters

string
required
Program address, base58-encoded.
number
required
Slot to look up. It doesn’t need to match a version’s activation slot. Pass a slot from List IDL Versions to get that exact version, or a transaction’s slot to get the IDL in effect when it executed.

Authorizations

api-key
string
query
required

Path Parameters

programId
string
required

Program address, base58-encoded.

Example:

"KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"

slot
integer<uint64>
required

Slot to look up. It doesn't need to match a version's activation slot. Pass a slot from List IDL Versions to get that exact version, or a transaction's slot to get the IDL in effect when it executed.

Required range: x >= 0
Example:

205509752

Response

The IDL document as stored. Both the legacy Anchor format and the Anchor 0.30+ format occur, so check which one you received before reading it.

An IDL document, returned as stored. Two formats occur:

  • Legacy Anchor (before 0.30): top-level name and version. Instruction accounts use isMut and isSigner.
  • Anchor 0.30+: top-level address and metadata (name, version, spec, description). Instructions carry a discriminator, and instruction accounts use writable and signer.

Both formats have instructions. Most IDLs also have accounts, types, and errors, and many have events. One program's versions can use different formats.