observablehq / feedback

Customer submitted bugs and feature requests
42 stars 3 forks source link

An "API cell" #492

Open enjalot opened 1 year ago

enjalot commented 1 year ago

Is your feature request related to a problem? Please describe. SQL and Data cells are awesome for working with data from databases, but a lot of the time I need to work with data from an API. There are a number of things that could be more convenient about that in Observable.

Describe the solution you'd like I want a way to explicitly manage data from an API, know when it was last loaded, be able to cache it (pin it?), be able to trigger a new request and also not have to memorize the fetch API. Make it easy to submit post requests using data from other cells, make it easy to get back JSON, plain text or error content.

Describe alternatives you've considered The alternative is similar to stringing together several cells to make a db.query(), i write a cell which fetches and then has to handle responses with promises etc.

Additional context This might also be a great place to plugin things like a CORS proxy and Secrets without needing to code them. I can imagine authed api calls from a cell being a very powerful feature for teams working with secure data in APIs.