4 ms·
If you were unanaware, most telescopes have data available online these days, provided their data is also public and not embargoed. There's REST API you basical
by batbomb 9y ago
If you were unanaware, most telescopes have data available online these days, provided their data is also public and not embargoed. There's REST API you basically do something like:
POST /tap/sync?query=select * from object a where ... HTTP/1.1
The SDSS server is probably most used.
- Sharlin 9y agoI don't think you have the same definition of "REST API" as I.
- proaralyst 9y agoRest doesn't mean Json, just that communication is stateless. HTTP itself is a Rest API. [0]: https://en.wikipedia.org/wiki/Representational_state_transfer https://en.wikipedia.org/wiki/Representational_state_transfe...
- Sharlin 9y agoI never said anything about JSON. REST (in HTTP's case) is about a) identifying resources (instead of, say, operations) by URIs and b) effecting state changes on those resources using HTTP verbs. HTTP/1.1 GET /foo/deleteWidget.asp?id=1234 is not REST (but such things were and are still common) HTTP/1.1 DELETE /foo/widgets/1234 is. If a Web service where you can execute database queries by passing raw SQL as a GET parameter (I really hope the database has its permissions set properly, otherwise holy SQL injection, Batman!) is a REST API then every Web service that has ever existed is a REST API and the term is completely meaningless. Edit: A doc link from another comment shows that they do have an actual REST API: http://www.sciserver.org/wp-content/uploads/2016/05/CasJobs_REST_API.pdf http://www.sciserver.org/wp-content/uploads/2016/05/CasJobs_...
- jerf 9y ago"every Web service that has ever existed is a REST API and the term is completely meaningless." Yes, the term is completely meaningless. In the strictest sense that some people insist on there appears to be 0 "real" REST APIs in the world. In the loose sense, as you say, everything is a REST API. I've really never seen a definition of "REST API" that usefully splits the world of HTTP-based APIs into "REST" and "not REST" that anyone is willing to stick with; the term seems to beg for people to start a purity spiral that ends with whatever supposed REST API was being held up as an example of a REST API turning out to violate some tenant or other of "real REST".
- batbomb 9y agoI didn't write the API, I just bitch about how it should be improved, but it really is a REST api. You post to a query resources, which creates a query-resource object for either sync or async queries. If it's an async query, you get a query id back, which you can use to query the status of... your query. When it's done, you can get back the results.
- justinclift 9y agoHmmm... do they really take raw queries like that? Seems like it'd be open to attack :(, unless very carefully parsed and handled.
- justinclift 9y agoFrom a bit of quick searching online, this seems like the thing: • http://cas.sdss.org/casjobs/ http://cas.sdss.org/casjobs/ • http://www.sciserver.org/wp-content/uploads/2016/05/CasJobs_REST_API.pdf http://www.sciserver.org/wp-content/uploads/2016/05/CasJobs_... And the source: • https://github.com/sciserver https://github.com/sciserver
- batbomb 9y agoYes, there's super-subset of SQL-92 called ADQL which is ran, but no inserts/deletes/updates are allowed. You can upload data to the services as XML files.
- justinclift 9y agoInteresting, thanks. :)