Sync API / Way to access sync'd data

Hi! I’m looking to port over a twitter bot I wrote for my Roam Graph and am having trouble finding a way to access my sync’d Obsidian data. (I’m paying for the sync plan)

Is there a way to access this data via an API endpoint? From a little bit of reverse engineering, it seems that Obsidian is using websockets to do the actual syncing.

What I’m trying to achieve is a way to get access to “blocks” with specific tags, so I can tweet them out randomly. (I know blocks are not a thing in Obsidian)

5 Likes

+1 agreed this would be a value add to sync service

2 Likes

This sounds like a good idea; and I hope my following concerns are not interpreted as critical. I just think it would be good to get some assurances for the majority of people using Obsidian who wouldn’t use this functionality that it wouldn’t make their vaults, whether synced or not, potentially less secure.

Just figured I would put it out there. I am sure everything is fine, but because I don’t understand it completely, I am not completely sure, if you know what I mean.

Thanks!

It is a very good statement and would need to be very much part of the design.

I think the goal here would be the API is accessible through the Obsidian Sync service. So you have already opted in to your vault being stored in the cloud.

Second, since users can define their own encryption key, it would mean there are limitations about what could be read or written.

2 Likes

Exactly, even if there was an API endpoint to download a tar of the data, I would imagine, you would need the decryption key to go from blob data to markdown files.

I would also like this. I’m currently working with a workaround that has large drawbacks.

I have one computer that I use obsidian on most commonly, I wrote a script that gets executed every now and then to download new emails and copy them into my obsidian folder tree. In essence, using the filesystem as an API.

I believe this would be easier if you synced your obsidian vault with a service like Dropbox because you can then use their API, although this gets into really cumbersome territory quickly.

It works fine, but it’s a big drawback that you’d either have to replicate this script on all of your devices or have one device on (or a server) that runs this intermediary all the time.

1 Like

Same as others. It should be maybe great to have access to the Obsidian Sync service or provide software which able to sync to the Obsidian Sync service as a daemon service.

1 Like

Here’s my current workaround for others who stumbled on this issue. Currently, to get Obisidan mobile to work, you need either iCloud or Obsidian sync–I chose sync to be able to support the Obsidian team.

I also sync the same directory as my vault to Google Drive using the Google Drive desktop sync app. I can then use the GDrive API to get at the files and do as I please. Check the above source code to see how I do that. It’s not ideal but it works.

2 Likes

Definitely a very desired feature. Even a cutdown CLI version of obsidian that just does sync would be enough.

1 Like

Thought about this today as well. I consider writing a Markdown Reader for iOS in its simplest form with holding and highlighting options. I want to make progressive summarization as simple and comfortable as possible with touch highlighting. But to enable this i would need to sync the vault via obsidian sync into the app.

I’m writing a plugin+express.js server with prisma and sqlite designed to be hosted free on render.com for this purpose. The idea is you sync your markdown notes to the server, then you can use those as posts at /api/blog for example. I am wanting to implement some auth before making it public. I would love to know if this would fill your use case.