Coinigy / api

Coinigy API Examples
162 stars 65 forks source link

New to python and probably a dumb question #19

Closed Quixoticluck closed 6 years ago

Quixoticluck commented 6 years ago

I can use the API fine but when using web socket how do I get the data to a useable form that I can manipulate in my code, I've tried everything I can think of and google has confused me to no end. Thank you.

ByronAP commented 6 years ago

Provided you have created a valid socketcluster connection and are getting data, that data is in JSON format which is easy to work with. However I don't know and can not assume what would be considered a usable format for your use case.

Quixoticluck commented 6 years ago

I can see the JSON but how do I access the JSON? In the api call I could just iterate through but when trying to use the web socket I am having issues doing that.

ByronAP commented 6 years ago

Use the json library. Please see: https://pythonspot.com/json-encoding-and-decoding-with-python/