•••
 
Documentation   /   API   /   API - Live data feeds
 
 

API - Live data feeds

 

Endpoints

Datasets from tasks

GET https://plainly.com/report-json
GET https://plainly.com/report-csv 

Datasets from documents

GET https://plainly.com/query-json 
GET https://plainly.com/query-csv 

Parameters

h
Required. The ID of the relevant dataset.
key
Required if you're not logged in. Dataset-specific API key. Obtained from the Export tab for the relevant dataset in the Data Studio.
view
Optional but recommended. Options are 1 or 0. If set to 1, dataset is rendered. If set to 0 or not set, the dataset is downloaded.
only
Optional. Use this to return only certain columns. See below for more options.
filter
Optional. Use this to return only rows which match the filter. See below for more options.
unique
Optional. Options are 1 or 0. If set to 1, only unique rows are returned. If set to 0 or not set, all rows are returned.
sort
Optional. Sort the dataset by a particular column. See below for more options.

Examples

https://plainly.com/query-json?h=a1b2c3d4e5f6g7h8&key=8a7b6c5d4e3f2g1h&view=1
https://plainly.com/query-json?h=a1b2c3d4e5f6g7h8&key=8a7b6c5d4e3f2g1h&view=1&only=document_key[|]counterparty_name[|]start_date&filter=counterparty_name not_match Test_AND_start_date last_90&sort=start_date down&unique=1

URL parameter: only

Supported for document and task datasets.

Syntax

&only={column_name}[|]{column_name}[|]{column_name}

Example

&only=document_key[|]counterparty_name[|]start_date

URL parameter: filter

Supported for all columns in document datasets and fixed columns only in task datasets.

Syntax

Where match types take a value:

&filter={column_name} {match_type} {value}_AND_{column_name} {match_type} {value}

Where match types do not take a value:

&filter={column_name} {match_type}_AND_{column_name} {match_type}

Match types with values

  • match (also contains)
  • not_match (also not_contains)
  • equals
  • not_equals
  • greater_than_or_equals
  • greater_than
  • less_than_or_equals
  • less_than
  • before
  • after

Match types without values

  • true
  • false
  • last_90
  • last_30
  • last_14
  • last_7
  • previous_90
  • previous_30
  • previous_14
  • previous_7
  • is_blank
  • is_not_blank

Example

&filter=counterparty_name not_match Test_AND_start_date last_90

URL parameter: sort

Supported for all columns in document datasets and fixed columns only in task datasets. Overwrites any sort that's saved for the dataset in the Data Studio.

Syntax

&sort={column_name} {down|up}

Example

&sort=start_date down

Other parameters

Supported for document datasets only.

&max={column_name}
&min={column_name}
&count={column_name}
&sum={column_name}
&avg={column_name}

Notes

  • You can't have a valid max and min at the same time. In that case, max will show, not min. "Valid" means that the column key exists in the data set.
  • If there are multiple rows with the same max/min value, Plainly will show the first one it found. Therefore, if you want to change which row is used, sort on another column.