griffithlab / civic-server

Backend Server for CIViC Project
MIT License
39 stars 32 forks source link

Improved index endpoints #144

Open acoffman opened 8 years ago

acoffman commented 8 years ago

Example use cases:

ahwagner commented 8 years ago

This would be great--particularly getting that list of genes. From the related issue at civic-api-client:

Right now the api has a /genes endpoint that returns a subset of user-defined length with all genes and corresponding variants, variant groups, descriptions, etc. for those genes. It would be nice if this endpoint instead returned a list of ALL genes in the database, limited only to the id, name, and entrez_id fields, so that one could use this as a quick reference for getting the appropriate CIViC identifiers for detailed queries (e.g. if I'm interested in BRAF I could use the returned result {"id":5,"name":"BRAF","entrez_id":673} to do a subsequent API call for BRAF at https://civic.genome.wustl.edu/api/genes/5)

acoffman commented 8 years ago

Yeah, I totally agree - right now the endpoint is returning what @jmcmichael needs to power the various views in the frontend - but that's not likely to be exactly what's useful for a generic API client.

I am planning on introducing a versioned client API that will be more generically RESTful at /api/v1/ that may be easier for people doing scripting to use.

malachig commented 6 years ago

At present I do not see a "Sources" endpoint being documented in the API docs.

But for genes it seems that the following API query give what is requested above? https://civicdb.org/api/genes/?identifier_type=entrez_symbol&count=9999999999999