Hanzo
OpenapiCode

Returns one repository's file structure with a per-file symbol count —…

Returns one repository's file structure with a per-file symbol count — get_repo_structure over the org's own index, with no git checkout involved.

GET /v1/code/tree

Addresshttps://api.hanzo.ai/v1/code/tree
MethodGET
Operationget_code_tree
AuthAuthorization: Bearer $HANZO_API_KEY

Returns one repository's file structure with a per-file symbol count — get_repo_structure over the org's own index, with no git checkout involved. A repository that has not been indexed answers an empty tree rather than an error, so an agent can tell "nothing here" without handling a failure.

Request

1 field.

FieldInTypeRequiredDescription
repoquerystringRepo is the repository to walk.

Response

StatusBodyMeaning
200repoTreeok

200 body — 5 fields.

FieldInTypeAlwaysDescription
filesbodyTreeEntry[]Files are the repo's indexed files in path order, each with its language and how many symbols it defines.
files[].langbodystringLang is the language the indexer parsed the file as ("go", "python", …), or empty when it recognised none — in which case Symbols is 0 because nothing was…
files[].pathbodystringPath is the file, relative to the repo root.
files[].symbolsbodyintegerSymbols is how many top-level declarations the file defines.
repobodystringRepo echoes the repository that was walked.

Failure carries the platform error shape — see Errors.

Examples

hanzo code tree

Code API · All Hanzo APIs · Interactive reference

How is this guide?

On this page