---
title: "Get module by module id."
method: GET
path: "/accounts/{address}/module/{module_name}"
tags: ["accounts", "state"]
---

# Get module by module id.

`GET /accounts/{address}/module/{module_name}`

This API renders a Move module identified by the module id. A
module id consists of the module owner `address` and the
`module_name`. The module is rendered at a ledger version (AKA
transaction version) specified as a query param, otherwise the
latest version is used.

## Path parameters

- `address` string, address, required — Hex-encoded 16 bytes Aptos account address. Prefixed with `0x` and leading zeros are trimmed. See [doc](https://diem.github.io/move/address.html) for more details.
- `module_name` string, required

## Query parameters

- `version` string, uint64 — The version of the latest transaction in the ledger.

## Response `200`

Returns a move module.

- MoveModule
  - `bytecode` string, hex, required — All bytes data are represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte. Different with `Address` type, hex-encoded bytes should not trim any zeros.
  - `abi` MoveModuleABI — Move Module ABI is JSON representation of Move module binary interface.
    - `address` string, address, required — Hex-encoded 16 bytes Aptos account address. Prefixed with `0x` and leading zeros are trimmed. See [doc](https://diem.github.io/move/address.html) for more details.
    - `name` string, required
    - `friends` MoveModuleId[], required
    - `exposed_functions` MoveFunction[], required
      - `name` string, required — Move function name
      - `visibility` 'public' | 'script' | 'friend', required
      - `generic_type_params` object[], required
        - `constraints` MoveAbility[], required
      - `params` MoveTypeId[], required
      - `return` MoveTypeId[], required
    - `structs` MoveStruct[], required
      - `name` string, required
      - `is_native` boolean, required
      - `abilities` MoveAbility[], required
      - `generic_type_params` object[], required
        - `constraints` MoveAbility[], required
        - `is_phantom` boolean, required
      - `fields` MoveStructField[], required
        - `name` string, required
        - `type` string, required — String representation of an on-chain Move type identifier defined by the Move language. Values: - bool - u8 - u64 - u128 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>` - reference: immutable `&` and mutable `&mut` references. - generic_type_parameter: it is always start with `T` and following an index number, which is the position of the generic type parameter in the `struct` or `function` generic type parameters definition. Vector type value examples: * `vector<u8>` * `vector<vector<u64>>` * `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: * `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>` * `0x1::account::Account` Reference type value examples: * `&signer` * `&mut address` * `&mut vector<u8>`

## Other responses

- `400` — Bad request due to a client error: invalid request headers, parameters or body. Client should not retry the request without modification.
- `404` — Resource or data not found. Client may retry the request if it is waiting for transaction execution or ledger synchronization.
- `500` — Server internal error, caused by unexpected issues.

---

[API](https://skmtc.dev/apscan/apis/aptos-dev-api-specification.md) · [All operations](https://skmtc.dev/apscan/apis/aptos-dev-api-specification/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/apscan/aptos-dev-api-specification/revisions/45caa72817c2/schema)
