• Stars
    star
    165
  • Rank 228,906 (Top 5 %)
  • Language
    JavaScript
  • Created about 4 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Private API to enable API access for Roam Research. Now you can connect Roam to your other projects.

Roam Private API

This project exposes command line tool (roam-api) and a node library to connect Roam Research to your other software. You can use it in bash scripts, Github actions, or as a dependency of your project.

How does it work?

It looks like Roam is not providing a REST API any time soon. If you want to bridge Roam with your other software, you can do so from within Roam (with JavaScript), but that has limited number of use cases. Without a REST API, this project launches an invisible browser and performs automated actions, just as you would manually. No need to install chrome, this library comes with one. It uses your login and password, so this won't work if you are using Google login. It wraps around import/export functionality and actions exposed via roamAlphaApi.

Command line tool roam-api

This package exposes a roam-api tool in your system. You can use it to automate Roam and bridge other systems with your Roam graph.

Installation:

This entire library is build on node, so you need node v12 and npm v6 in your system. You can install the package the following way:

npm i -g roam-research-private-api

Now you can use a variety of commands. All command take the following arguments, which you can also set as environmental variables:

  • -g, --graph or env variable ROAM_API_GRAPH - this is your graph name
  • -e, --email or env variable ROAM_API_EMAIL - email to log into your Roam
  • -p, --password or env variable ROAM_API_PASSWORD - password to your Roam.

roam-api export will export your Roam graph to a directory of your choice.

This example will export the graph to your desktop. It will appear as "db.json".

roam-api export ~/Desktop

It can also push the new version of the graph to an URL of your choosing. That way, you can upload the graph to some other system or use it with Zapier and similar tools.

roam-api export ~/Desktop http://secret.url?token=secret_token.

roam-api search will search your Roam graph for a phrase:

roam-api search "potatoes"

Result will be JSON array of objects { blockUid, pageTitle, string }

roam-api-query will let you do a full Datalog query.

This will find all block uids in your database which have the content "Import".

roam-api query '[:find ?uid :where [?b :block/string "Import"] [?b :block/uid ?uid]]'

Check out this fantastic article to know more about the Roam data structure.

roam-api create create a block under specified uid. If no uid is provided, it will be inserted into your daily page:

roam-api create "This will be prepended to my daily page"

Library to use in your project.

As mentioned, this is also a library that you can use within your project. Here are examples on how to do so:

Pull requests welcome and I take no responsibility in case this messes up your Roam Graph :).

More Repositories

1

SmartPi

$4 Smarthome with ESP8266 and Firebase. Works with IFTTT, HomeKit (Siri), has a web app
JavaScript
50
star
2

Reactive-Compass

React mixin and focus controller for navigation using arrow keys, TV remote, etc..
JavaScript
18
star
3

wp-writers-block-block

A WordPress Gutenberg Block that uses GPT-3 to generate seed content for you
JavaScript
16
star
4

shepherd

Helper to make you open Facebook less.
HTML
15
star
5

alfroam

Roam Research Alfred Workflow
PHP
13
star
6

Why-WordPress

Arguments for convincing a prospective client that he/she should choose WordPress.
10
star
7

logseq-wordpress-export

TypeScript
9
star
8

PersonalOS

PHP
9
star
9

help-me-read

HTML
8
star
10

wp-dao

Make your site web3-ready: Log in with Ethereum or create users based on governance tokens.
PHP
8
star
11

nodemcu-Minion

Plug&Play ESP8266 firmware with Web interface. Relay and RGB control built in.
Lua
7
star
12

LearnMinder

App for kids that blocks internet until coding challenge is solved
JavaScript
7
star
13

wp-roam-block

WordPress plugin with a block to Embed Roam Blocks in WordPress, just as you would in Roam
PHP
6
star
14

Mindfullnes-Journal

Daily Mindfullness Journal and todo list in Evernote
PHP
5
star
15

Alfred-Github-PR-ninja

Search, checkout and see PRs from your Alfred
PHP
4
star
16

odwolane.pl

Nie odpowiada Ci orzeczenie trybunału? Chcesz kogoś uniewinnić? Skasuj to z nami!
HTML
3
star
17

notable-podcasts

A podcast player that makes saving notes a breeze
HTML
3
star
18

Airplane

Cheap airlines connection checker
JavaScript
3
star
19

Formulate

Excel formulas in HTML tables and other macros
PHP
2
star
20

turbo-clipper

Turbo Clipper is a bookmarklet that lets you choose how you clip websites to evernote
JavaScript
1
star
21

FBUtils

Facebook Utility functions, posting as a page, etc.
PHP
1
star
22

Qualify

Performing Qualitative data analysis on text saved in Evernote
JavaScript
1
star
23

wp-create-block-template

A template for `@wordpress/create-block` with github actions, phpcs, and wp-env
HTML
1
star
24

wp-multilang-block

A WordPress gutenberg block to create hidden content visible only for speakers of other languages
JavaScript
1
star