For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
28 2 3 7

MarketByPrice via EWA/websocket; how can I read the value of Map/Entries/"Key" ?

accessed MarketByPrice (6501.T) data via EWA/Python. How can I read these "Key" value? isn't it a pair of side&price?

treprdp-apiwebsocketsrrto
mbp.png (15.3 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
361 1 4 3

Hi @kazuhisa.matsuda,

The key type of a MarketByPrice Map is a Buffer, which is Base64-encoded. Python can decode these values:

>>> 'OTE0MDAwMEE='.decode('base64')
'9140000A'
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
28 2 3 7

Thank you for the response. so for Python3, it should be following?

>>>base64.b64decode('OTE0MDAwMEE=')

b'9140000A'

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.