Skip to main content

REST API spec

For the full spec, checkout the API docs at https://api.parsomics.org.

Important

There is no public instance of this API. Instead, the parsomics team recommends self hosting the relational database and the REST API.

Querying API Specification

This API allows structured SQL-like queries using JSON. It supports SELECT, JOIN, and WHERE clauses. Results are read-only and come from composing simple model relationships.

Structure

{
"selects": [ /* list of fields to retrieve */ ],
"joins": [ /* list of join definitions */ ],
"wheres": [ /* list of filter conditions */ ]
}

Fields

selects (required)

An array of attributes to retrieve.

{ "mdl": "ModelName", "attr": "attribute_name" }
  • mdl: Name of the model/table.
  • attr: Name of the attribute/column to select.
  • Wildcard * is not supported; all fields must be listed explicitly.

joins (optional)

An array describing JOIN operations.

{
"mdl": "ModelToJoin",
"onclause": {
"mdl_l": "LeftModel",
"attr_l": "left_attr",
"mdl_r": "RightModel",
"attr_r": "right_attr"
},
"isouter": false,
"full": false
}
  • mdl: Model being joined.

  • onclause: Defines join condition.

    • mdl_l / attr_l: Left side of the join.
    • mdl_r / attr_r: Right side of the join.
  • isouter: If true, performs a LEFT OUTER JOIN.

  • full: If true, performs a FULL OUTER JOIN.

  • If both isouter and full are false, a regular INNER JOIN is used.

wheres (optional)

An array of filtering conditions.

{ "mdl": "ModelName", "attr": "attribute_name", "op": "==", "val": "value" }
  • mdl: Model/table the condition applies to.
  • attr: Attribute/column name.
  • op: Comparison operator (==, !=, <, <=, >, >=, in, not in).
  • val: Value to compare against. Can be a constant or parameter (e.g., $param).