API Request

I’m not sure if any of the code still works, but it was at one point possible to use the API in an unofficial way to export the source of a notebook as a JSON file and also to create a new notebook as a JSON file. See the scripts mentioned in this forum post. You could presumably also adapt those scripts to use the API to merge a newly uploaded notebook into the old one, too.

By the way, I’m very excited to see your VS Code extension when it’s ready!

Another alternative is to try connecting to the websocket server at wss://ws.observablehq.com/document/[notebook-hash]/edit

A long time ago I played around with a notebook that sent and received messages with the websocket server here:

The websocket endpoint was locked down so the notebook no longer runs at all, but maybe some of the code will be useful to you if you decide to go this route.

1 Like