API Overview

All methods are on the ExtendedMetadataCacheAPI interface, accessed via getAPI(app).api.

Interactive reference

See the API Reference table for a filterable, sortable view of all methods.

Tags

MethodReturnsDescription
getFilesWithTag(tag)ReadonlySet<string>Files with tag (body + frontmatter)
getFilesWithTagInBody(tag)ReadonlySet<string>Files with tag in note body only
getFilesWithTagInFrontmatter(tag)ReadonlySet<string>Files with tag in YAML frontmatter only
getAllTagsWithFiles()ReadonlyMapAll tags → file sets

See Tags Body vs Frontmatter for why the distinction matters.

MethodReturnsDescription
getBacklinksForFile(file)ReadonlySet<string>Files linking to target (combined)
getBacklinksFromBody(file)ReadonlySet<string>Body [[links]] only
getBacklinksFromFrontmatter(file)ReadonlySet<string>Frontmatter [[links]] only
getUnresolvedBacklinks(name)ReadonlySet<string>Files with unresolved links

See Links Body vs Frontmatter for how separation is determined.

Embeds

MethodReturnsDescription
getFilesEmbedding(file)ReadonlySet<string>Files that embed the target

See Embed Subpaths for how heading and block embeds are handled.

Headings

MethodReturnsDescription
getFilesWithHeading(heading)ReadonlySet<string>Files containing a heading
getAllHeadingsWithFiles()ReadonlyMapAll headings → file sets

Frontmatter

MethodReturnsDescription
getFilesWithFrontmatterKey(key)ReadonlySet<string>Files with a key present
getFilesWithFrontmatterValue(key, value)ReadonlySet<string>Files with key = value
getAllFrontmatterKeysWithFiles()ReadonlyMapAll keys → file sets

See Frontmatter Value Types for how different YAML types are handled.

Aliases

MethodReturnsDescription
getFilesWithAlias(alias)ReadonlySet<string>Files with a specific alias
getAllAliasesWithFiles()ReadonlyMapAll aliases → file sets

Blocks

MethodReturnsDescription
getFileWithBlockId(blockId)TFile | nullFile defining a block ID

Tasks

MethodReturnsDescription
getFilesWithTasks()ReadonlySet<string>Files with any tasks
getFilesWithTaskStatus(status)ReadonlySet<string>Files with specific status(es)
getAllTaskStatusesWithFiles()ReadonlyMapAll statuses → file sets
getFilesWithOpenTasks()ReadonlySet<string>Files with [ ] tasks
getFilesWithCompletedTasks()ReadonlySet<string>Files with non-space tasks

See Task Status Values for how Obsidian stores checkbox characters.

Lifecycle

FunctionReturnsDescription
getAPI(app, options?)ExtendedMetadataCacheHandleAcquire shared instance
hasAPI()booleanCheck if singleton exists
createExtendedMetadataCache(app, options?)ExtendedMetadataCacheAPICreate isolated instance