Skip to main content

Get Module

Retrieves detailed information about a specific HDP module, including metadata, source code, ABI, and version information. This endpoint does not require authentication.

Endpoint

GET /modules/{id}

Path Parameters

ParameterTypeDescription
idstringThe unique module ID (ULID)

Example Request

curl -X GET https://staging.hdp.api.herodotus.cloud/modules/01JPJ03YJT1A93D6NF56G4GVEQ \
  -H "Content-Type: application/json"

Response

Success Response (200 OK)

{
  "id": "01JPJ03YJT1A93D6NF56G4GVEQ",
  "latestModuleVersionProgramHash": "0x34a16478e83f69c4f0bcdb7549d32f92c9b7776bb3f71da06de334f1871eba0",
  "compilerVersion": "2.7.0",
  "name": "my_module",
  "description": "My awesome HDP module",
  "usageCount": 42,
  "tags": ["example", "tutorial"],
  "downloadsCount": 100,
  "usersCount": 25,
  "isVerified": false,
  "publishedOnMarketplace": true,
  "creatorUser": "user@example.com",
  "license": "MIT",
  "abi": {
    "type": "interface",
    "items": []
  },
  "sourceCode": {
    "src/lib.cairo": "fn main() {}"
  },
  "scarbToml": "[package]\nname = \"my_module\"\n...",
  "createdAt": "2024-03-17T10:24:00Z",
  "updatedAt": "2024-03-17T10:25:00Z"
}

Not Found Response (404)

{
  "error": "Module not found"
}

Response Fields

FieldTypeDescription
idstringThe unique module ID (ULID)
latestModuleVersionProgramHashstring | nullProgram hash of the latest version
compilerVersionstringCompiler version used
namestringModule name
descriptionstring | nullModule description
usageCountintegerNumber of times this module has been used
tagsarray | nullArray of tags
downloadsCountintegerNumber of downloads
usersCountintegerNumber of unique users
isVerifiedbooleanWhether the module is verified
publishedOnMarketplacebooleanWhether the module is published on the marketplace
creatorUserstring | nullCreator user identifier
licensestring | nullLicense identifier
abiobject | nullModule ABI as JSON
sourceCodeobject | nullSource code files as JSON object mapping paths to content
scarbTomlstring | nullScarb.toml file content
createdAtstringISO 8601 timestamp of module creation
updatedAtstringISO 8601 timestamp of last update

Notes

  • No authentication is required for this endpoint
  • Returns all module metadata including source code and ABI
  • The sourceCode field contains a JSON object mapping file paths to file contents
  • The latestModuleVersionProgramHash points to the most recent version of the module