get_historical_data(request)
Gets historical values for channel(s).
Arguments
channelids
(string|list): one or more channel ids to get data forbegintime
: (string|int): start of time range to get data for, either millseconds since the epoch, or an ISO date stringendtime
: (string|int): end of time range to get data for, either milliseconds since the epoch, or an ISO date string
Returns
(dict): a parsed JSON Historical Data object
Raises
JCoreAPIAuthException
: if authentication is required and the connection is not authenticated.JCoreAPITimeoutException
: if the request times out.JCoreAPIConnectionClosedException
: if the connection closes or was already closed.JCoreAPIErrorResponseException
: if the server responds with an error.JCoreAPIInvalidMessageException
: if the client receives an invalid response.
Example
conn.get_historical_data(channelids='andysDevice^analog1', begintime='2016-05-03T15:50:00.000Z', endtime='2016-05-03T16:10:00.000Z')
# returns {u'endTime': 1462291800000, u'data': {u'andysDevice^analog1': {u't': [1462290600329, 1462290610506, 1462290620691, 1462290630874, 1462290641071, 1462290651071, 1462290661258, 1462290671430, 1462290681625, 1462290691825, 1462290702008, 1462290712166, 1462290722344, 1462290732531, 1462290742726, 1462290752909, 1462290762909, 1462290763109, 1462290773308, 1462290783496, 1462290793694, 1462290803836, 1462290813988, 1462290824002, 1462290834167, 1462290844361, 1462290854362, 1462290864560, 1462290874757, 1462290884943, 1462290895139, 1462290905308, 1462290915485, 1462290925485, 1462290925685, 1462290935686, 1462290935886, 1462290945890, 1462290956078, 1462290966270, 1462290976440, 1462290986440, 1462290996444, 1462291006632, 1462291016632, 1462291026642, 1462291036645, 1462291046842, 1462291057016, 1462291067041, 1462291077062, 1462291087262, 1462291097436, 1462291107602, 1462291117608, 1462291127612, 1462291137797, 1462291147987, 1462291158149, 1462291168319, 1462291178519, 1462291188709, 1462291198909, 1462291209089, 1462291219099, 1462291229293, 1462291239294, 1462291249294, 1462291259473, 1462291269669, 1462291279677, 1462291289859, 1462291299863, 1462291310049, 1462291320236, 1462291330241, 1462291340440, 1462291350634, 1462291360634, 1462291370640, 1462291380841, 1462291390843, 1462291401040, 1462291411047, 1462291421247, 1462291431263, 1462291441280, 1462291451289, 1462291461475, 1462291471672, 1462291481869, 1462291491871, 1462291502048, 1462291512060, 1462291522070, 1462291532087, 1462291542097, 1462291552294, 1462291562488, 1462291572488, 1462291572689, 1462291582698, 1462291592699, 1462291592901, 1462291603100, 1462291613260, 1462291623456, 1462291633643, 1462291643828, 1462291654013, 1462291664210, 1462291674390, 1462291684416, 1462291694604, 1462291704777, 1462291714978, 1462291725173, 1462291735363, 1462291745556, 1462291755756, 1462291765957, 1462291776135, 1462291786327, 1462291796524], u'v': [2.57063566, 4.6942725130000005, 4.535189134, 2.260044301, 0.21468657100000002, 0.492451201, 2.8105232950000003, 4.7927527, 4.391256553000001, 2.0151064, 0.128832049, 0.6742607770000001, 3.0882879250000004, 4.881132355, 4.196821312, 1.7423920360000003, 0.064960713, 0.054133925, 0.8888970820000001, 3.3736279540000003, 4.939210414000001, 3.9771347410000004, 1.4823033370000003, 0.016240167, 1.0656563920000002, 3.578163727, 4.956886345, 3.8231016280000003, 1.3030188940000003, 0.0027066819999999985, 1.2777675640000001, 3.792800032, 4.959411478000001, 3.6135155890000004, 3.568063195, 1.095957988, 1.053030727, 0.013533470000000002, 1.4974541350000001, 3.9973358050000005, 4.934160148, 3.3887787520000003, 0.9393997420000001, 0.04060044, 1.6312861840000001, 4.0730897950000005, 4.926584749000001, 3.2902985650000005, 0.8257687570000001, 0.062254015999999995, 1.7348166370000002, 4.194296179, 4.883657488000001, 3.10091359, 0.7146629050000001, 0.100147774, 1.9191513460000003, 4.325603095, 4.830629695000001, 2.919104014, 0.5581046590000001, 0.194485507, 2.2044913750000004, 4.502362405, 4.739724907, 2.6691158470000005, 0.436898275, 0.25508869900000003, 2.3484239560000004, 4.588216927, 4.671546316000001, 2.522658133, 0.358619152, 0.34599348700000004, 2.5479094630000003, 4.6614457840000005, 4.573066129000001, 2.320647493, 0.262664098, 0.429322876, 2.704467709, 4.732149508, 4.484686474, 2.2145919070000004, 0.19701064000000001, 0.522752797, 2.818098694, 4.777601902000001, 4.413982750000001, 2.0555085280000003, 0.141457714, 0.6237581170000001, 3.0125339350000004, 4.845780493, 4.315502563000001, 1.9494529420000002, 0.12125665, 0.6969869740000001, 3.123639787, 4.878607222, 4.891232887, 4.201871578, 1.7954198290000003, 1.7449171690000003, 0.054133925, 0.87879655, 3.363527422, 4.939210414000001, 3.9771347410000004, 1.4747279380000002, 0.010826773000000001, 1.1136339190000002, 3.5907893920000005, 4.9619366110000005, 3.7751241010000003, 1.2525162340000002, 0.0027066819999999985, 1.3307953570000002, 3.8483529580000004, 4.954361212, 3.5049348700000005, 1.002528067, 0.027066955, 1.6035097210000002]}}, u'beginTime': 1462290600000}