dbdb.io icon indicating copy to clipboard operation
dbdb.io copied to clipboard

REST API

Open jessicamrbr opened this issue 5 years ago • 10 comments

I would like to access the full list of banks and information to try creates a comparative tool.

Do you make this data available in any way?

jessicamrbr avatar Aug 08 '19 16:08 jessicamrbr

What do you mean by "full list of banks"?

apavlo avatar Aug 08 '19 18:08 apavlo

In the repository, initial data is available at:

dbdb.io/data/initial_data/

Would it be possible to access all current data?

jessicamrbr avatar Aug 08 '19 19:08 jessicamrbr

Let me see about adding a REST API.

apavlo avatar Aug 09 '19 02:08 apavlo

I started looking into adding djangorestframework but it as a bit more complex than what I had time for. The REST API should be strictly read-only:

https://github.com/cmu-db/dbdb.io/commit/1c4738dec906f932583fb2b85665ee8b9d0e46a9

apavlo avatar Nov 22 '19 18:11 apavlo

@apavlo what data would you like exposed in the API? Based on this thread, it looks like you only want it to be read-only. Should it only be accessible to users with accounts?

pembo13 avatar Jan 02 '20 06:01 pembo13

@pembo13 Yes, it should be read-only. The REST API can be open to the public.

apavlo avatar Jan 08 '20 00:01 apavlo

@apavlo which models (data) do you want exposed? For example, I'm guessing System but not SystemVisit

pembo13 avatar Jan 14 '20 07:01 pembo13

It should just be System.

apavlo avatar Jan 14 '20 10:01 apavlo

@apavlo please take a look at the demo, I'd like to know if you'd like me to add more fields, for example, the meta data: http://dbdb.devpreviews.com/api/v202004/systems

I do have a few questions:

  1. Should the API limited to users only?
  2. If limited to users only, should I allow them to generate an API key?
  3. I've put in throttling to limit to 4 requests per second

The code is in this branch if you'd like to review: https://github.com/cmu-db/dbdb.io/tree/issue_62

pembo13 avatar Apr 17 '20 06:04 pembo13

Fixed the Travis build in this branch as well.

pembo13 avatar Jun 25 '20 13:06 pembo13