Skip to content
Menu
SilktideDevelopers

Tables

Results that answer with rows take columns, sort and search, and answer one page of rows at a time.

View as Markdown

Many results queries answer with a table: rows of the same shape, such as one row per page with its visitors and page views. Every table takes the same arguments for choosing its columns, its order and its rows, beside the arguments of its own.

Arguments#

ArgumentWhat it does
columnsThe columns to return, comma-separated: url,pageViews. Left out, the table returns its default columns.
sortThe column to sort by, then :a for ascending or :d for descending: pageViews:d. Left out, each table has an order of its own.
searchOnly the rows that match this text. What it searches depends on the table, most often a URL or a title.
page, rowsPerPageWhich page of rows to return, and how many a page holds. See Pagination.

Send columns as a comma-separated string, in the query string and in a JSON body alike. A table ignores a JSON array.

When you choose columns, also send sort naming one of them. Some tables fail when the columns you ask for leave out the one they sort by by default.

curl "https://api.eu.silktide.com/v1/results/analytics/pages?view=all&period=last-30-days&columns=url,pageViews&sort=pageViews:d&rowsPerPage=10" \
  -H "Authorization: silktide token=YOUR_API_KEY"

The answer#

A table answers with one page of its rows, and where that page sits among the rest:

{
  "result": {
    "page": 1,
    "minPage": 1,
    "maxPage": 4,
    "numRows": 37,
    "rowsPerPage": 10,
    "rows": [
      { "url": "https://fakewinebarrel.com/", "pageViews": 620 }
    ]
  },
  "selector": "/v1/results/analytics/pages",
  "duration": 0.03
}

Each table's page lists the columns its rows can have. A row can also carry fields its page does not list, for Silktide's own screens; ignore them, because they can change without notice.