5.5 – get_data

Request

MethodURL
GETidata/get_data/

Parameters

Params TypeValues
typeStringType Data type. Valid values are :  
●    “company_list”,
●    “company_list_all”
●    ”sources”
●    “source_categories”
●    “indexes”
●    “exchanges”
versionStringCurrent version of the data.   Server will return the data only if the version reported is older than currently available at server.
last_updateNumbervalues:
●    0 means, there is no valid last updated data
●    In case of any non zero value, the response will have valid “data” only if the current data at server is newer than the last updated version reported by the client

Response

StatusResponse
200Data structure for the response will depend on the data type. Refer the table below for each data type

Data Type & Response Data Structure

company_list

company_list_all

{ 
     "last_update" : <integer timestamp>  // value ‘0’ will return current data 
     "data" : { 
          "version" : <version>, 
          "data" : [
               {     
                    "name" : <company name>
                    "nameid" : <company_id>
                    "ticker" : <company ticker>
                    "place" : <place name>
                    "exchange" : <exchange name>   
               }, 
               { … }
          ]
     }
}

commodity_list

{ 
     "last_update" : <integer timestamp> // value ‘0’ will return current data
     "data" : { 
          "version" : <version>,
          "data" : [
               {
                    "name" : <commodity name>
                    "nameid" :  <cm_<commodity_id>
                    "class" : <commodity class Symbol> 
                    "type" : <commodity class Type> 
                    "subtype" : <commodity class SubType> 
               },               { … }
          ]
     }
}

sources

{
     "last_update" : <integer timestamp> // value ‘0’ will return current data
     "data" : { 
          {               "version" : <version>,
               "data" : [
                    {                         "name" : <source name>, 
                         "nameid" : o_<source_id>, 
                         "category" : <comma separated category id’s (ca_)> 
                     },                      {…}
               ]
          }
     }}
NOTES:  
●      Refer to the get_data  source_categories for the supported categories   source_categories      
●      Maximum support of 3 levels. Means “parent category”, “child category” and “child of child category”. 
●      The priority can be used to decide the order of  listing

source_categories

{
     "last_update" : <integer timestamp> // value ‘0’ will return current data
     "data" : { 
          {
               "version" : <version>,
               "data" : [
                    {
                         "name" : <category name>, 
                         "name_id" : ca_<category id>, 
                         "priority" : <number in 0 -10> 
                         "children" : [ 
                              "name":  ,
                              "priority" : , 
                         "children" : [ … ]
                     },
                     {…} 
               ]
          }
     }
}

indexes

{ 
     "last_update" : <integer timestamp> // value ‘0’ will return current data
     "data" : { 
          {
               "version" : <version>,
               "data" : [
                    {
                         "name : <index name>, 
                         "nameid" : in_<index_id>, 
                         "place_name" : <place_name>, 
                         "placeid" : pl_<place_id>,
                         "regionid" : pl_<region_id>,
                         "region_name" : <region name>,
                         "scoreid" : sc_<score_id>
                    },
                    {…}
               ]
          }
     }
}

exchanges

{ 
     "last_update" : <integer timestamp> // value ‘0’ will return current data
     "data" : { 
          {
               "version" : <version>,
               "data" : [ 
                    {
                         "name" : <exchange name>, 
                         "name_id" : <exchange id> 
                    },
                    {…}
               ]
          }
     }
}

places

{
     "last_update" : <integer timestamp> // value ‘0’ will return current data
     "data" : {
          {
               "version" : <version>,
               "data" : [
                    {
                         "place" : <place name>, 
                         "nameid" : pl_<place_id>
                    },
                    {…}
               ]
          }
     }
}