API to get generic data type

Request:

GET: idata/get_data/

Parameters:

  • type [string]

Data type. Valid values are :

    • “company_list”,
    • “company_list_all”
    • ”sources”
    • “source_categories”
    • “indexes”
    • “exchanges”
  • version [number]

Current version of the data.

Server will return the data only if the version reported is older than currently available at server.

  • last_update [number]

last_update values:

    • 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

Examples:

None

Response:

200 

  • company_list or company_list_all

{“last_update”: , “data”: { “version”: < >, “data”: [ { “name”: < >, “nameid: , “ticker”: < >, “place”: < >, “exchange: < >}, { … } ] } }

  • commodity_list

{ “last_update”: , “data”: { “version”:, “data”: [ { “name”: < >, nameid: , “class”: < >, “type”: < >, “subtype”: < > }, { … } ] } }

  • sources

{“last_update”: , “data”: { “version”: < >, “data”:[ { “name”:  < >, “nameid”:  < o_ >,  “category”: < > }, {…} ] } }

NOTE: Refer to the get_data source_categories for the supported categories

  • source_categories

NOTE:

    • 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

{ last_update: < value ‘0’ will return current data >, data: { version:, data:[ { name: < >, “name_id”: , “priority”: < >, “children”: [“name”: < >, “priority”: < > , “children”: [ … ] ] }, {…} ] } }

  • indexes

{“last_update”: , “data”:{ “version”: < >, “data”:[ {“name”: , “nameid”: , “place_name”: < >, “placeid”: }, {…} ] } }

  • exchanges

{“last_update”: , “data”: { “version”: < >, “data”:[ {“name”: < > , “name_id”:  }, {…} ] } }

  • places

{“last_update”: <  value ‘0’ will return current data>,  “data”: { “version”: < >, “data”:[ { place: < >, “nameid”: < pl_ >, }, {…} ] } }

400 {“error”:”Invalid param.”}
401 {“error”:”Invalid API token.”}
500 {“error”:”Something went wrong. Please try again later.”}