API

API

The API is used for programmatic access to your tables.

In order to use the API, first generate a token in the console.

Querying

The query API is located at:

https://api.hyprcubd.com/v1/query

Headers

  • The Content-Type is expected to be JSON.
  • The Authorization header is to be used with the Bearer token. (e.g. if your API token is 1234, then the header should be: Authorization:Bearer 1234)

Example

Given a database same of “examples” and a table of “tweet”, here is a sample query:

Request

{
    "db": "examples",
    "query": "select time, id, author, hashtag from tweet"
}

Response

{
    "duration": 35,
    "result": {
        "columns": [
            "time",
            "id",
            "author",
            "hashtag"
        ],
        "data": [
            [
                "2020-04-27 14:29:00",
                1,
                1,
                "sqlrocks"
            ]
        ]
    }
}

duration

The number of milliseconds spent processing the query. This does not include network latency (round trip time).

result

Result contains the table data. columns is a list of names of columns from the select query. data is a 2d array of rows by columns.