•••
 
Documentation   /   API   /   API: Live data feeds
 
 

API: Live data feeds

 

Endpoints

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

report endpoints return task datasets. query endpoints return document datasets. The JSON endpoints return an array of rows, each an object keyed by column name.

Parameters

Parameter Required Description
h Yes The dataset ID.
key If not logged in The dataset's key, from its shareable link in Data Studio.
view Recommended 1 displays the data. 0 or omitted downloads it.
only No Return only these columns.
filter No Return only rows matching the conditions.
unique No 1 returns only unique rows.
sort No Sort by a column. Overrides the dataset's saved sort.
max, min, count, sum, avg No Return a single calculated value for a column. Task datasets support count; document datasets support all five.
hide_headers No /report-csv only: 1 leaves out the header row.

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%20not_match%20Test_AND_start_date%20last_90&sort=start_date%20down&unique=1

Encode spaces in parameter values as %20.

only

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

Works on task and document datasets.

filter

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

Works on every column of document datasets, and on the fixed columns of task datasets.

Match type Takes a value Matches when the column...
equals, not_equals Yes equals, or doesn't equal, the value
match (or contains), not_match (or not_contains) Yes contains, or doesn't contain, the value
greater_than, greater_than_or_equals, less_than, less_than_or_equals Yes compares as stated
before, after Yes, a date or timestamp is a date before, or on or after, the value
last_{days} No is a date within the last {days} days, e.g. last_7, last_30, last_90 (dates in the future also match)
previous_{days} No is a date in the {days} days before that, e.g. previous_30 is 60 to 30 days ago
true, false No is true or false
is_blank, is_not_blank No is empty or not empty

sort

&sort={column} {down|up}

Works on every column of document datasets, and on the fixed columns of task datasets.

Calculations

&max={column}
&min={column}
&count={column}
&sum={column}
&avg={column}
  • max and min can't be used together. If both are set, max is used.
  • When several rows share the maximum or minimum, the first one found is returned. Sort on a different column to change which.

Using feeds

  • Pull a feed into a Plainly document or web page with [[INCLUDE=data]]. See Pulling data into documents.
  • Connect it to Excel, Google Sheets, Google Data Studio or any tool that reads JSON or CSV from a URL.
Important

A feed URL contains the dataset key. Anyone with the URL can read the data. Share it only with people and systems that should see everything in the dataset, and remove the shareable link in Data Studio if it's exposed.