Get, change, and otherwise interact with your notes in Obsidian via a REST API.

Overview

Local REST API for Obsidian

See our interactive docs: https://coddingtonbear.github.io/obsidian-local-rest-api/

Have you ever needed to automate interacting with your notes? This plugin gives Obsidian a REST API you can interact with your notes from other tools so you can automate what you need to automate.

This plugin provides a secure HTTPS interface gated behind api key authentication that allows you to:

  • Read, create, update or delete existing notes. There's even a PATCH HTTP method for inserting content into a particular section of a note.
  • List notes stored in your vault.
  • Create and fetch periodic notes.
  • Execute commands and list what commands are available.

This is particularly useful if you need to interact with Obsidian from a browser extension like Obsidian Web.

Credits

This was inspired by Vinzent03's advanced-uri plugin with hopes of expanding the automation options beyond the limitations of custom URL schemes.

Comments
  • Non-ascii folder names are not supported

    Non-ascii folder names are not supported

    Hi,

    I have emoji in my folder names (in order to replicate notion's folder icons), and from some initial testing, there seems to be some issue with that :

    GET on /vault/filename

    Yield to the following error in the obsidian console : node:internal/errors:464 Uncaught (in promise) TypeError: Invalid character in header content ["Content-Disposition"]

    GET on /periodic/period

    Yield the following error in the obsidian console :
    TypeError: Invalid character in header content ["Content-Location"]


    All request were done on the provided swagger UI, and all requests hangs instead of returning a 500 error, maybe that can also be a improvement ?

    And I want to say, I love the idea of the plugin, there is soo much potential to be plugged to external tools, but since nearly all of my files are in a folder that contains a emoji name, I'm not able to use this plugin

    bug 
    opened by beaussan 5
  • [Bug] Server hang after requesting folder for file-related `/vault/{filename}` endpoints

    [Bug] Server hang after requesting folder for file-related `/vault/{filename}` endpoints

    Consider the following folder structure:

    .
    ├── a
    │   └── a.md
    └── b
    

    Request /vault/{filename} related endpoints with filename = a (a is a folder, not a valid file).

    What I get from the server response: It's completely hung.

    image

    Similar results can get from GET, PUT, POST, DELETE endpoints.

    What I expected to get from the server response:

    It should return some errors instead of hanging (maybe 405 Bad Request?)

    OS: MacOS Monterey 12.2.1 (M1) Obsidian version: 0.14.6 Obsidian local rest API version: 1.3.5

    opened by kaiiiz 3
  • [Bug] Failed to upgrade/install on the obsidian community plugin page

    [Bug] Failed to upgrade/install on the obsidian community plugin page

    Thanks for the bug fixes in the latest release. However, the plugin install page can't work anymore. I'm not sure what problem it is since the developer console only shows 404 not found.

    image

    I suspect that there are two possible reasons:

    1. The release branch name should be master instead of main according to the Official Release Guides. It seems that the setting of community-plugin repo doesn't specify branch property, so it uses the default branch setting (master). However, Github may redirect the master branch to the main branch, so I'm not sure whether this is the root cause.
    2. The release name inconsistency. As mentioned in the latest release, there is no release version 1.3.7 in the Github repo, but the community plugin page shows that the latest version of the plugin is 1.3.7.
    opened by kaiiiz 2
  • Notes writen in the wrong file when core obsidian

    Notes writen in the wrong file when core obsidian "daily notes" are setup with path in date format

    I use Obsidian 1.0.3 and Local rest api plugin.

    I want my dailynotes in a subfolder per month : content/diary/YYYY/MM/DD.md

    So today in content/diary/2022/12/04/md

    But when I add a note from chrome using the extension configured with local API, my note is writen in content/diary/2017/12/04.dm (.dm is not a typo)

    The obsidian core daily notes is configure this way : date format : YYYY/MM/DD new file location : content/diary

    This is working fin in obsidian, I've the "Open daily note on startup check" and the right file is created at this moment.

    opened by pae23 1
  • GET/PUT/POST/PATCH/DELETE file opened in currently-focused editor pane

    GET/PUT/POST/PATCH/DELETE file opened in currently-focused editor pane

    This request has been raised a few different times over the last few months and I, too, see how this might be useful so I'm going to see about adding it as a new feature.

    enhancement 
    opened by coddingtonbear 1
  • POST /search/ support for Dataview DQL queries

    POST /search/ support for Dataview DQL queries

    As of https://github.com/blacksmithgu/obsidian-dataview/issues/374#issuecomment-1152040331 it appears that obsidian-dataview now provides an accessible API for running dataview queries. Let's add support for using such queries for search.

    enhancement 
    opened by coddingtonbear 1
  • Exceptions raised during request processing will not always be caught and returned as a 500 error

    Exceptions raised during request processing will not always be caught and returned as a 500 error

    An error report was received from @kaiiiz in #23:

    I notice a related issue, for the PUT /vault/{filename} endpoint, if the specified folder in the path doesn't exist, the server will hang forever. (e.g. filename = c/d.md and folder c doesn't exist)

    image

    What I expected to get from the server response:

    It should return 405 Bad Request or create the nested folder structure before creating the new file (maybe an optional parameter for this functionality?).

    Originally posted by @kaiiiz in https://github.com/coddingtonbear/obsidian-local-rest-api/issues/23#issuecomment-1133943674

    opened by coddingtonbear 1
  • [Bug] GET /vault/{pathToDirectory} doesn't return 404 not found error

    [Bug] GET /vault/{pathToDirectory} doesn't return 404 not found error

    Consider the following folder structure:

    .
    ├── a
    │   └── a.md
    └── b
    

    What I get from the server response:

    image

    What I expected to get from the server response:

    It should return 404 (Directory does not exist) instead of 200.

    OS: MacOS Monterey 12.2.1 (M1) Obsidian version: 0.14.6 Obsidian local rest API version: 1.3.5

    opened by kaiiiz 1
  • [Bug] GET /vault/ doesn't response empty folder

    [Bug] GET /vault/ doesn't response empty folder

    Consider the following folder structure:

    .
    ├── a
    │   └── a.md
    └── b
    

    What I get from the server response:

    image

    What I expected to get from the server response:

    {
      "files": [
        "a/",
    	"b/"
      ]
    }
    

    The server response should include the empty folder. I consider this as a bug since I'm implementing the function that chooses which directory should be used to create a new file, so all folders in the vault should be included in the response.

    OS: MacOS Monterey 12.2.1 (M1) Obsidian version: 0.14.6 Obsidian local rest API version: 1.3.5

    opened by kaiiiz 1
  • IOS problem

    IOS problem

    The mobile plug-in switch cannot be turned on [obsidian-local-rest-api] ,IOS Obsidian V1.2.0 is not supported. Hope the developer can solve it soon, thank you!

    opened by springrain1 1
  • [bug] cannot update HTTP port

    [bug] cannot update HTTP port

    • Changing the value of Insecure HTTP Server Port seems to actually change the HTTPS port
    Screen Shot 2022-03-12 at 19 15 46 Screen Shot 2022-03-12 at 19 16 33
    • Note I've kept the HTTPS port default, but modified HTTP to 27125, while the dev console shows HTTP still at 27123 and HTTPS at 27125. Changing the Secure HTTPS Server Port value also modifies the actual HTTPS port.

    • macOS 12.2.1

    • Obsidian v0.13.33

    opened by ericzinnikas 1
  • How to GET binary files?

    How to GET binary files?

    If i GET a JPEG image file from my vault it seems to be getting corrupted. I am using python uplink module which is wrapping requests. I cannot save the file using the response.content, or recover the actual file from json content. Is the API assuming all files are markdown? Markdown files are working as expected. Thanks.

    opened by geordielad 1
  • PATCH /vault/* support for inserting content relative to block references

    PATCH /vault/* support for inserting content relative to block references

    The patch method supports inserting content relative to a header if you send a request like:

    PATCH /path/to/some/file.md HTTP/1.1
    Content-Type: text/markdown
    Heading: Some heading in your document
    Content-Insertion-Position: end|beginning
    

    Obsidian also supports block references, and those references are available via the CachedMetadata API. These would require slightly different headers, though:

    • Block-Reference-Id: The ID of the block reference to insert content relative to.
    • Content-Insertion-Position: Valid values before, on, after. The values after and on differ from one another in that that on will insert text immediately before the block reference marker on the same line as it, whereas after will insert on the next line.

    Use of Heading and Block-Reference-Id in the same request or using a Content-Insertion-Position invalid for the provided reference (either Heading or Block-Reference-Id) will result in a 400 error.

    enhancement 
    opened by coddingtonbear 0
Releases(1.5.1)
Owner
Adam Coddington
Not affiliated with non-:rainbow_flag: types of bears.
Adam Coddington
A Zotero add-on that scans your Markdown reading notes, tags the associated Zotero items, and lets you open notes for the Zotero items in Obsidian.

Zotero Obsidian Citations Adds colored tags to Zotero items that have associated Markdown notes stored in an external folder. Open an associated Markd

Dae 210 Jan 4, 2023
Obsidian Web: Connect your browser with your Obsidian notes

Obsidian Web: Connect your browser with your Obsidian notes This is an unofficial Chrome extension for Obsidian that lets you send content from the we

Adam Coddington 97 Jan 3, 2023
A service for sharing encrypted Markdown notes from Obsidian. Notes are end-to-end-encrypted and are only stored temporarily.

?? Noteshare.space Noteshare.space is a service for sharing encrypted Markdown notes from Obsidian. Notes are end-to-end-encrypted and are only stored

Maxime Cannoodt 56 Dec 26, 2022
An Obsidian plugin for automatically creating notes when linking to non-existing notes

Note Auto Creator for Obsidian Automatically create notes when links are created to them. How to use After enabling the plugin in the settings menu, y

Simon Clement 31 Dec 14, 2022
To understand the history of SACCOs, a Savings and Credit cooperative otherwise known as a Sacco is a type of corporation that aims at pooling money together.

To understand the history of SACCOs, a Savings and Credit cooperative otherwise known as a Sacco is a type of corporation that aims at pooling money together. Depending on the Saccos, there are different types of supplies of merchandise. These include and are not limited to recognition servers, sedimentation, and call home eggs installation. More to these items include check glades, bankers, checks standing orders and safe detentions, and salary progress.

incredicoder 2 Oct 19, 2022
Change font for your notes and code.

Google fonts for Logseq A Logseq plugin to use Google Fonts for rendering. Google fonts have more than 1400+ fonts which can be used in Logseq now. Yo

Richard Yu 9 Dec 12, 2022
This is a vanilla Node.js rest API created to show that it is possible to create a rest API using only vanilla Node.js

This is a vanilla Node.js rest API created to show that it is possible to create a rest API using only vanilla Node.js. But in most cases, I would recommend you to use something like Express in a production project for productivity purposes.

Eduardo Dantas 7 Jul 19, 2022
A plugin for Obsidian (https://obsidian.md) that adds a button to its search view for copying the Obsidian search URL.

Copy Search URL This plugin adds a button to Obsidian's search view. Clicking it will copy the Obsidian URL for the current search to the clipboard. T

Carlo Zottmann 6 Dec 26, 2022
📝 You Can Create Your Own Short Notes With The Help of Sticky-Notes Website.

Hi ?? , I'm Sneh Agrawal A passionate Web developer from India ?? I’m currently working on Chatting Website Chit-Chat ?? How to reach me on My Gmail A

Sneh (Smilyboyy) 1 Feb 23, 2022
PublisherConnector is a class object that allows you to interact with the CHILI Publisher editorObject via postMessage without the complexity of postMessage.

PublisherConnector is a class object that allows you to interact with the CHILI Editor editorObject via postMessage without the complexity of postMessage.

CHILI publish 8 Nov 24, 2022
An Obsidian plugin to upload your notes' metadata to your database.

Obsidian + PostgreSQL = ❤️ An Obsidian plugin to upload your notes' metadata to your database. Features send the Dataview annotations of a page to a P

Camille Louédoc-Eyriès 33 Dec 19, 2022
🤗 A CLI for running Stable Diffusion locally via a REST API on an M1/M2 MacBook

Stable Diffusion REST API A CLI for running Stable Diffusion locally via a REST API on an M1/M2 MacBook Pre-requisites An M1/M2 MacBook Homebrew Pytho

Yuan Qing Lim 74 Dec 26, 2022
Easily publish notes to the web This plugin integrates with obsius.site to publish markdown notes on the web.

Obsius Publish Easily publish notes to the web This plugin integrates with obsius.site to publish markdown notes on the web. Limitations The type of c

Jon Grythe Stødle 66 Dec 20, 2022
An API that allows you to scrape blog posts and articles and get a list of notes or a summary back.

EZAI-Web-Scraper An API that allows you to scrape blog posts and articles and get a list of notes or a summary back. Recommendations Use browserless.i

null 9 Dec 8, 2022
Obsidian jTab adds the ability to show guitar chords and tabs directly in your notes.

Obsidian jTab Guide Obsidian jTab adds the ability to show guitar chords and tabs directly in your notes. It uses the jTab library to render the chord

David 24 Dec 25, 2022
A plugin for Obsidian that can create input fields inside your notes and bind them to metadata fields.

Obsidian Meta Bind Plugin This plugin can create input fields inside your notes and bind them to metadata fields. New docs I am currently working on n

Moritz Jung 57 Jan 4, 2023
A quick capture plugin for Obsidian, all data from your daily notes.

Obsidian Memos 中文文档 A new way for you to quick capture an idea in Obsidian. Which is highly based on the awesome open source project: memos and awesom

Boninall 551 Jan 3, 2023
This plugin allows you to track the progress of Atlassian Jira issues from your Obsidian notes.

Obsidian jira-issue This plugin allows you to track the progress of Atlassian Jira issues from your Obsidian notes. Usage Configuration Use the plugin

Marco Lucarella 74 Dec 30, 2022