Skip to content

Datastore


Endpoints

POST      /datastores
GET       /datastores
GET       /datastores/:id
PUT       /datastores/:id
DELETE    /datastores/:id

Datastores are fully integrated repositories to manage and persist data. They can record data calculated by Everysk’s servers, proprietary data from the client or both. The most common usage is the storage of securities as rows and related properties as columns, but there are no constraints on the usage. They enable powerful data explorations and trend analysis to be performed.

The datastore object

What a datastore object looks like?

{
  "updated": 1625688283,
  "name": "My First Datastore",
  "tags": ["first", "datastore", "20210622"],
  "created": 1625688283,
  "workspace": "main",
  "date": "20210622",
  "data": [
    ["MIC", "SYMBOL", "LATEST SECURITY DATE", "LATEST SECURITY VALUE"],
    ["XKRX", "003550:XKRX", "20210429", 126500.0]
  ],
  "id": "dats_52KiJy2yFvosTtWM5aUJcOs1R",
  "description": "This is my first datastore"
}
Property Description
id string Unique identifier (UID) for the datastore.
created timestamp Time at which the object was created. Measured in seconds since the Unix epoch.
updated timestamp Time at which the object was updated. Measured in seconds since the Unix epoch.
name string The datastore's name.
description string An arbitrary string attached to the datastore. Often useful for finding detailed information about the datastore or for filtering a search based on the present hashtags.
tags array Sequence of hashtags used to find the related DataStore. The more hashtags that are used, the more elements that are filtered out from the search. Labels, dates and any other hashtag can be used.
version string Indicates the datastore's current version.
date string Datastore date in the format: YYYYMMDD. The Datastore Date is important because it instructs the API to use the market conditions and security prices prevailing on that date. In order to run the datastore using the market conditions prevailing today, use null.
data array The content that will be stored inside the Datastore.
workspace string The workspace where the datastore was generated.

Create a datastore

To create a new datastore, run the following:

curl https://api.everysk.com/v2/datastores \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -d '{
        "name": "My First Datastore",
        "tags": [
          "first",
          "datastore",
          "20210622"
        ],
        "description": "This is my second datastore",
        "date": "20210622",
        "data": [
          [
            "MIC",
            "SYMBOL",
            "LATEST SECURITY DATE",
            "LATEST SECURITY VALUE"
          ],
          [
            "XKRX",
            "003550:XKRX",
            "20210429",
            126500.0
          ]
        ],
        "workspace": "main"
      }' \
  -X POST

The above call returns the following JSON object:

{
  "datastore": {
    "updated": 1625688283,
    "name": "My First Datastore",
    "tags": ["first", "datastore", "20210622"],
    "created": 1625688283,
    "workspace": "main",
    "date": "20210622",
    "data": [
      ["MIC", "SYMBOL", "LATEST SECURITY DATE", "LATEST SECURITY VALUE"],
      ["XKRX", "003550:XKRX", "20210429", 126500.0]
    ],
    "id": "dats_52KiJy2yFvosTtWM5aUJcOs1R",
    "description": "This is my first datastore"
  }
}

Creates and then returns the new datastore.

HTTP Request

POST /datastores

HTTP Parameters

Parameter Description
name string REQUIRED A string to identify a datastore besides the datastore's id. Feel free to use a meaningful name for your datastore.
description string optional, default is null Provides detailed information about your datastore. You may add hashtags to create tags allowing you to search for them later.
tags string optional, default is null Filters the list of datastores through the tags added in the description. Do not use hashtags when passing a value to this parameter.
date string optional, default is null (today) Datastore date in the format: YYYYMMDD. The Datastore Date is important because it instructs the API to use the market conditions and security prices prevailing on that date. Therefore, historical datastores will be calculated without look ahead. In order to run the datastore using market conditions prevailing today, use null.
data array REQUIRED The content that will be stored inside the Datastore.
with_data boolean optional, default is True When True, the the data inside the generated datastore will be returned in the api response.
workspace string optional, default is main Determines on which workspace the request will be made.

List all datastores

To list all datastores, run the following:

curl https://api.everysk.com/v2/datastores?query=#20210622&workspace=main \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -G

The above call returns the following JSON object:

{
  "datastores": [
    {
      "updated": 1625507085,
      "name": "My First Datastore",
      "tags": [
        "first",
        "datastore",
        "20210622"
      ],
      "created": 1625507085,
      "workspace": "main",
      "date": "20210622",
      "id": "dats_xSYqUnLuQue8WwE9nEfgg0TVL",
      "description": "This is my first datastore"
    },
    ...
  ],
  "next_page_token": null
}

Returns a list of datastores you’ve previously created. The datastores are returned in sorted order, with the most recent datastore appearing first.

HTTP Request

GET /datastores

HTTP Parameters

Parameter Description
query string optional, default is null Request a list of datastores filtering it by name or tag. When using a tag to perform a query, each term must include a hashtag prefix. (e.g: query="#april #sample") See Filter with query.
workspace string optional, default is main Determines on which workspace the request will be made.
page_size integer optional, default is 10 Set the number of objects that will be listed per page.
page_token integer optional, default is null The token defines which page will be returned to the user. For further information, please check out our pagination guide.

Retrieve a datastore

To retrieve a datastore, run the following:

curl https://api.everysk.com/v2/datastores/dats_52KiJy2yFvosTtWM5aUJcOs1R?workspace=main \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -G

The above call returns the following JSON object:

{
  "datastore": {
    "updated": 1625688283,
    "name": "My First Datastore",
    "tags": ["first", "datastore", "20210622"],
    "created": 1625688283,
    "workspace": "main",
    "date": "20210622",
    "data": [
      ["MIC", "SYMBOL", "LATEST SECURITY DATE", "LATEST SECURITY VALUE"],
      ["XKRX", "003550:XKRX", "20210429", 126500.0]
    ],
    "id": "dats_52KiJy2yFvosTtWM5aUJcOs1R",
    "description": "This is my first datastore"
  }
}

Retrieves the details of an existing datastore by supplying the datastore's id.

HTTP Request

GET /datastores/:id

HTTP Parameters

Parameter Description
id string REQUIRED A unique identifier (UID) for a datastore. A datastore's id will always look like this: dats_52KiJy2yFvosTtWM5aUJcOs1R.
workspace string optional, default is main Determines on which workspace the request will be made.

Update a datastore

To update a datastore, run the following:

curl https://api.everysk.com/v2/datastores/dats_52KiJy2yFvosTtWM5aUJcOs1R \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -d '{
        "name": "My New Datastore Name",
        "description": "My new datastore description",
        "data": [
          [
            "MIC",
            "SYMBOL",
            "LATEST SECURITY DATE",
            "LATEST SECURITY VALUE"
          ],
          [
            "XLIF",
            "CAM:XLIF",
            "20190211",
            17.504
          ]
        ],
        "workspace": "main"
      }' \
  -X PUT

The above call returns the following JSON object:

{
  "datastore": {
    "updated": 1625690528,
    "name": "My New Datastore Name",
    "tags": ["first", "datastore", "20210622"],
    "created": 1625688283,
    "workspace": "main",
    "date": "20210622",
    "data": [
      ["MIC", "SYMBOL", "LATEST SECURITY DATE", "LATEST SECURITY VALUE"],
      ["XLIF", "CAM:XLIF", "20190211", 17.504]
    ],
    "id": "dats_52KiJy2yFvosTtWM5aUJcOs1R",
    "description": "My new datastore description"
  }
}

Updates a datastore and then returns the updated datastore.

HTTP Request

PUT /datastores/:id

HTTP Parameters

Parameter Description
id string REQUIRED A unique identifier (UID) for a datastore.
name string optional, default is null A string to identify a datastore besides the datastore's id. Feel free to use a meaningful name for your datastore.
description string optional, default is null Use this field to provide detailed information about your datastore. You also can add hashtags to create groups or categories allowing you to search for them later.
tags string optional, default is null Filters the list of datastores through the tags added in the description. Do not use hashtags when passing a value to this parameter.
data array The content that will be stored inside the Datastore.
workspace string optional, default is main Determines on which workspace the request will be made.

Delete a datastore

To delete a datastore, run the following:

curl https://api.everysk.com/v2/datastores/dats_52KiJy2yFvosTtWM5aUJcOs1R?workspace=main \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -X DELETE

The above call returns the following JSON object:

{
  "datastore": {
    "deleted": true,
    "id": "dats_52KiJy2yFvosTtWM5aUJcOs1R",
    "name": "My First Datastore"
  }
}

Permanently deletes a datastore. It cannot be undone. Returns an object with the datastore's id and an attribute specifying whether the datastore was successfully deleted or not.

HTTP Request

DELETE /datastores/:id

HTTP Parameters

Parameter Description
id string REQUIRED The datastore's unique indetifier.
workspace string optional, default is main Determines on which workspace the request will be made.