qf3l3k2k downloadsFetch data from multiple sources (REST APIs, RPC, gRPC, GraphQL) and insert results into notes
Data Fetcher is an Obsidian plugin that fetches data from external endpoints and renders it directly inside notes.
Use it to query REST APIs, GraphQL endpoints, JSON-RPC APIs, or gRPC-style HTTP proxy endpoints from data-query code blocks. Results can be rendered as JSON, tables, Markdown templates, copied to clipboard, saved into the note, cached, or written into note frontmatter.
params (available from 1.3.0).data-query blocks in the active note.Settings -> Community Plugins in Obsidian.Data Fetcher.manifest.json, main.js, and styles.css from the latest GitHub release..obsidian/plugins/data-fetcher in your vault.Data Fetcher.Create a fenced code block with language data-query:
{
"type": "rest",
"url": "https://api.github.com/users/octocat/repos",
"method": "GET",
"path": "0",
"template": "First repo: [{{name}}]({{html_url}})"
}
When the note is rendered, Data Fetcher executes the request, caches the response, and renders the selected output below the block.
For repeated use, configure endpoints in Settings -> Data Fetcher and reference them by alias.
Example endpoint:
github-reposRESThttps://api.github.com/users/octocat/reposGETThen use it in a note:
@github-repos
path: 0
template: First repo: [{{name}}]({{html_url}})
Endpoint settings support:
Header exports are disabled by default so API keys and tokens are not accidentally shared.
{
"type": "rest",
"url": "https://api.example.com/items",
"method": "GET",
"params": {
"page": 1,
"tag": "obsidian"
},
"headers": {
"Authorization": "Bearer your-token"
}
}
REST supports GET, POST, PUT, and DELETE. Use params for query-string parameters and body for request payloads.
REST aliases use an explicit params: line. For the github-repos alias configured above:
@github-repos
params: {"per_page": 5, "sort": "updated"}
format: table
This requests https://api.github.com/users/octocat/repos?per_page=5&sort=updated.
For an alias named some-api pointing to https://api.example.com/items, multiple parameters work like this:
@some-api
params: {"foo": "one", "bar": "two"}
format: json
The resulting URL is https://api.example.com/items?foo=one&bar=two. The example.com URL is a placeholder; replace it with your API endpoint.
Parameter rules:
null are not supported.{"tag": ["one", "two"]} becomes tag=one&tag=two. Your API must support this array convention.{"search": "hello world"} without pre-encoding it.params; explicit values replace all existing values for that key.foo=.params affects REST requests only and is included in cache keys.For REST, use params: {...} or the direct JSON "params" field. Neither query: "foo=bar" nor @some-api({"foo":"bar"}) supplies REST URL parameters. Inline alias arguments retain their existing GraphQL variable behavior.
params controls the request URL, path selects part of the returned JSON, and format controls how that result is displayed. Put API routes such as /cosmos/staking/v1beta1/validators in the endpoint URL, not in path.
{
"type": "graphql",
"url": "https://api.example.com/graphql",
"query": "query($first: Int) { viewer { repositories(first: $first) { nodes { name url } } } }",
"variables": {
"first": 5
},
"path": "data.viewer.repositories.nodes",
"format": "table"
}
With an alias, inline variables can be passed at the call site:
@github-api({"first": 5})
query: query($first: Int) { viewer { repositories(first: $first) { nodes { name url } } } }
path: viewer.repositories.nodes
format: table
=@alias({...}) is also supported as the first line inside a data-query block.
{
"type": "rpc",
"url": "https://rpc.example.com",
"query": "status",
"body": {}
}
RPC requests are sent as JSON-RPC-style POST requests. query is used as the RPC method name and body is used as params.
{
"type": "grpc",
"url": "https://proxy.example.com/my.Service/GetItem",
"body": {
"id": "123"
}
}
Obsidian does not provide native gRPC transport. This mode is intended for gRPC services exposed through an HTTP/JSON proxy.
pathUse dot notation to select nested response data:
@github-repos
path: 0.owner.login
Paths can include array indexes, for example items.0.name.
JSON is the default output format:
@github-repos
path: 0
format: json
Tables work best with arrays of objects:
@github-repos
params: {"per_page": 5}
format: table
If table rendering cannot find an array of objects, the plugin falls back to JSON output.
Templates turn API data into note-ready Markdown:
@github-repos
params: {"per_page": 5}
template: - [{{name}}]({{html_url}}) by {{owner.login}}
Template rules:
{{field}} inserts a field from the selected object.{{owner.login}} supports nested fields.{{value}}.template takes precedence over format: table.Use output: frontmatter to write selected data into note properties:
@github-repos
path: 0.name
output: frontmatter
property: external.firstRepo
Notes:
property is required.external.github.firstRepo.Each rendered result includes:
Refresh: reruns the query and updates the cache.Copy: copies the rendered output.Save to Note: inserts/replaces static Markdown output in the current note.Data Fetcher adds these commands:
Refresh data query: refresh all data-query blocks in the active note.Open cache browser: inspect and manage cached responses.Data Fetcher stores cached responses in .data-fetcher-cache in the vault root.
In settings, you can:
The cache browser can:
Endpoint configurations can be exported to JSON and imported on another device.
Export behavior:
Include headers only when you intentionally want to export secrets such as Authorization tokens.Import behavior:
Merge updates matching aliases and adds new ones.Replace overwrites the current endpoint list.Endpoint alias "..." not found: add the alias in settings or fix the alias name in the note.Variables must be valid JSON: use valid JSON, for example {"first": 5}.params: {"page": 2}.params, check the API's supported parameter names, and confirm you installed version 1.3.0 or newer.Path "..." not found: verify the response shape and the selected path.Table format requires an array of objects: point path at an array of objects or use JSON/template output.path.property is required when output: frontmatter is used: add a property value.Response too large for this device: reduce payload size, add filters/limits, or use a proxy endpoint.This plugin communicates with external services and stores response data locally.
requestUrl API.params), method, headers, body, query, and variables you configure..data-fetcher-cache.Build:
npm install
npm run build
Watch mode:
npm run dev
Test in a vault by linking or copying plugin files to .obsidian/plugins/data-fetcher.
MIT