get_data: get_data

Description Usage Arguments Examples

Description

Retreives fields for instruments with the sepcified parameters and sort criteria. The result is returned in a data frame

Usage

1
2
get_data(instruments, fields, parameters = NULL, raw_output = FALSE,
  debug = FALSE)

Arguments

instruments:

string or list. A single instrument or list of instruments to request.

fields:

string, named list or list of string and/or named list - Single field as a string: 'TR.PriceClose' - Single field in a named list for providing parameters and/or sort option: ex: list('TR.GrossProfit'=list('params'=list( 'Scale'= 6, 'Curn'='EUR'))) list('TR.GrossProfit'= list('params'= list('Scale'= 6, 'Curn'= 'EUR'),sort_dir='desc')) - Multiple fields could be set in a non named list. Items could be strings and/or named lists ex: list('TR.PriceClose','TR.PriceOpen') list(list('TR.PriceClose'= list('sort_dir'='asc','sort_priority'=1)),list('TR.PriceOpen'=list('sort_dir'='asc','sort_priority'=0)))

You can use the function TR_Field to build the fields more easily: ex: fields = list(TR_Field('tr.revenue'),TR_Field('tr.open',NULL,'asc',1),TR_Field('TR.GrossProfit',list('Scale'=6, 'Curn'='EUR'),'asc',0)) data_frame = get_data(list("IBM","MSFT.O"),fields)

Tips: You can launch the Data Item Browser to discover fields and parameters or copy field names and parameters from TR Eikon - MS Office formulas

parameters:

string or named list. Single global parameter or a list of key=value in the named list.

raw_output:

boolean. By default the output is a data frame. Set raw_output=True to get data in Json format.

debug:

bool. When set to True, the json request and response are printed.

Examples

1
2
3
4
5
6
--------
> set_app_id('set your app id here')
> data_frame = get_data(list("IBM", "GOOG.O", "MSFT.O"), list("TR.PriceClose", "TR.Volume", "TR.PriceLow"))
> data_frame = get_data("IBM", list('TR.Employees', list('TR.GrossProfit'= list('params'=list('Scale'= 6, 'Curn'= 'EUR'),'sort_dir'='asc'))))
> fields = list(TR_Field('tr.revenue'),TR_Field('tr.open',NULL,'asc',1),TR_Field('TR.GrossProfit',list('Scale'=6, 'Curn'='EUR'),'asc',0))
> data_frame = get_data(list("IBM","MSFT.O"),fields)

ahmedmohamedali/eikonapir documentation built on May 10, 2019, 7:35 a.m.