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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
43 2 6 9

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.

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

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
43 2 6 9

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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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