Skip to content

Commit

Permalink
intial documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharm committed May 28, 2020
1 parent 8250ccf commit 0526ec7
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion API/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
Here we document the API that is accessible via ascl.net
Here we document the API that is currently accessible via dev.ascl.net/api/search/. The purpose of the API is to provide an interface through which complex queries and searches can be conducted on ASCL data, returning JSON.

# Syntax
The search API for ASCL entries can be accessed through the /api/search/ endpoint. The syntax of a query follows, loosely, the style of Apache Solr.

## Mandatory Parameters

### q
All queries **must** have the q parameter, which specifies a general search string. It can be empty or contain a string, but it **must** be included in quotation marks (""). Not including this parameter or not including quotation marks will return a 404 error.

## Optional parameters

### fl
The fl parameter describes the fields of the ASCL entry that will be returned in the call. It must be a string with each field delimited by commas (,).

### fq
The fq (filter query) parameter allows for further filtering of data through the use of specific operations. The sytax is as follows:

*field-name*[*optional-comparator*]:*value*

TODO: add support for multiple operations through AND or OR -- need to look into how Solr addresses this.


# Examples

1. example of a fielded query with multiple fields returned, and a filter query - century, abstract, bibcode, and id of all ASCL entries whose abstract contains "nasa" and whose century is strictly less than 20 (meaning the 21st century in normal parlance)
https://dev.ascl.net/api/search/?q=abstract:"nasa"&fl=century,abstract,bibcode,id&fq=century[lt]:20&


0 comments on commit 0526ec7

Please sign in to comment.