mirror of
https://github.com/qf3l3k/obsidian-data-fetcher.git
synced 2026-07-22 12:20:30 +00:00
2.7 KiB
2.7 KiB
Obsidian Data Fetcher
A plugin for Obsidian that allows users to fetch data from multiple sources (REST APIs, GraphQL, gRPC, RPC) and insert the results into notes.
Features
- Support for multiple data sources:
- REST APIs
- GraphQL endpoints
- gRPC services (via REST proxies)
- RPC services
- Two modes of operation:
- Directly define queries within notes
- Predefine endpoints in settings and reference them in notes
- Automatic caching of query results to reduce redundant requests
- Cache expiration settings
- Manual refresh capabilities
- Customizable headers for authentication
Installation
From Obsidian Community Plugins
- Open Obsidian Settings
- Go to Community Plugins
- Search for "Data Fetcher"
- Click Install, then Enable
Manual Installation
- Download the latest release from the releases page
- Extract the zip file into your Obsidian vault's
.obsidian/pluginsfolder - Enable the plugin in Obsidian settings
Usage
Method 1: Direct Query Definition
Create a code block with the language set to data-query and define your query in JSON format:
```data-query
{
"type": "rest",
"url": "https://api.example.com/data",
"method": "GET",
"headers": {
"Authorization": "Bearer your-token"
}
}
```
Method 2: Using Aliases
- First, define an endpoint alias in the plugin settings
- Then reference it in your notes:
```data-query
@my-api-alias
body: {"id": 123}
```
Configuration
Go to Settings > Data Fetcher to configure:
- Cache duration
- Pre-defined endpoint aliases
- Default headers
Examples
REST API Example
```data-query
{
"type": "rest",
"url": "https://jsonplaceholder.typicode.com/posts/1",
"method": "GET"
}
```
GraphQL Example
```data-query
{
"type": "graphql",
"url": "https://api.spacex.land/graphql",
"query": "{ launchesPast(limit: 5) { mission_name launch_date_local } }",
"variables": {}
}
```
Using Aliases
```data-query
@github-api
query: query { viewer { repositories(first: 5) { nodes { name } } } }
```
Support
If you encounter any issues or have feature requests, please file them on the GitHub issues page.
License
MIT
