Skip to content

Market Data

The MarketData engine provides a couple of methods for search data based on a given condition, limit, or date. Also with the possibility of getting historical and security data.

from everysk.sdk.engines.market_data import MarketData
market_data = MarketData()

Search method

The search method allows the searching of assets based on a given condition, limit, or date. The method receives the following parameters:

  • conditions: Each condition is a list or tuple with a (field, operator, value) structure.
  • fields: A list of fields to be returned.
  • order_by: The field to order the results.
  • limit: The maximum number of records to be returned.
  • date: The date to be used in the search.
market_data.search([
    ['everysk_symbol', '=', 'AAPL']
],

fields=['instrument_class', 'name', 'gics_sector'],
date='20250129',
limit=10
)

Below there are all the columns that we can search for in the conditions fields, they are all database columns inside the PostgreSQL.

  • everysk_id
  • historical_data
  • everysk_symbol
  • country_of_risk
  • currency
  • error_text
  • error_type
  • exchange
  • gics_sector
  • extra_data
  • instrument_class
  • isin
  • last_prices
  • mkt_cap
  • name
  • security_class
  • updated_at
  • vendor_symbol
  • volume
  • tsv_search

Understanding the extra_data column

This column serves as a way to store extra attributes for a specific security, because of the way that is implemented we can run a direct search for these attributes, look at the example below:

market_data.search(
    [["raw_sector", "=", "Technology"]],
    fields=["instrument_class", "name", "gics_sector"],
    limit=1,
)

[
    {
        "everysk_symbol": "000660:XKRX",
        "name": "SK Hynix Inc",
        "instrument_class": "Equity",
        "everysk_id": "EQTY:000660:XKRX",
        "gics_sector": "Information Technology",
    }
]

The raw_sector is an attribute inside the extra_data JSON, but we can still run a search just like the other main columns.

Note that the search method has a 14400 seconds cache for each different request.

Using the date argument

The date parameter defines the reference date used for querying the dataset in a bitemporal model. When provided, the query returns the state of the data as of that specific date. When omitted, the query defaults to the latest dataset, which is a copy of the most recent data available.

market_data.search(
    [
        ["instrument_class", "=", "FXSpot"],
        ["everysk_symbol", "in", ["KWDUSD", "AEDUSD"]],
    ],
    fields=["last_prices"],
    date="20250915",
    limit=2,
)

[
    {
        "everysk_id": "FXSP_CURR:AED:USD",
        "last_prices": {
            "low": 0.2723,
            "date": "2025-09-08",
            "high": 0.2723,
            "open": 0.2723,
            "close": 0.2723,
            "volume": 0.0,
            "average": 0.2723,
            "adjusted_close": 0.2723,
        },
        "everysk_symbol": "AEDUSD",
    },
    {
        "everysk_id": "FXSP_CURR:KWD:USD",
        "last_prices": {
            "low": 3.2717,
            "date": "2025-09-08",
            "high": 3.2749,
            "open": 3.2748,
            "close": 3.2717,
            "volume": 0.0,
            "average": 3.2717,
            "adjusted_close": 3.2717,
        },
        "everysk_symbol": "KWDUSD",
    }
]

Below, let's search without the date argument to contextualize:

market_data.search(
    [
        ["instrument_class", "=", "FXSpot"],
        ["everysk_symbol", "in", ["KWDUSD", "AEDUSD"]],
    ],
    fields=["last_prices"],
    limit=2,
)

[
    {
        "everysk_id": "FXSP_CURR:AED:USD",
        "last_prices": {
            "low": 0.2723,
            "date": "2025-09-08",
            "high": 0.2723,
            "open": 0.2723,
            "close": 0.2723,
            "volume": 0.0,
            "average": 0.2723,
            "adjusted_close": 0.2723,
        },
        "everysk_symbol": "AEDUSD",
    },
    {
        "everysk_id": "FXSP_CURR:KWD:USD",
        "last_prices": {
            "low": 3.2717,
            "date": "2025-09-08",
            "high": 3.2749,
            "open": 3.2748,
            "close": 3.2717,
            "volume": 0.0,
            "average": 3.2717,
            "adjusted_close": 3.2717,
        },
        "everysk_symbol": "KWDUSD",
    }
]